atompy.save_2d_as_txt#

atompy.save_2d_as_txt(H, xedges, yedges, fname, **savetxt_kwargs)[source]#

Save a 2d histogram to a file.

The first column in the file will be y, the second x, the third z. (this is chosen as such because the the standard hist2ascii-macro of the Atomic Physics group has this format)

Parameters:
Hndarray shape(nx,ny)

A bi-dimensional histogram of samples x and y.

xedgesndarray, shape(nx+1,)

Edges along x.

yedgesndarray, shape(ny+1,)

Edges along y.

fnamestr

Filename, including filetype.

**savetxt_kwargs

numpy.savetxt() keyword arguments. Useful to, e.g., set a header with the header keyword.