Assume that we have a cube file that contains Ni * Nj * Nk points, and an origin at 0, 0, 0, where are the data points actually located?

Let's say the grid spacing along each direction is di, dj, dk in crystal coordinates (so di = 1 / (Ni - 1)).

Are the data points located at 0, di, 2 * di, ..., ... Nx * di or 0.5 * di, 1.5 * di, ..., (Nx + 0.5) * di (and correspondingly for other axes)? Meaning, is the sampled data at the origin and corresponding gridpoints, or are they between the gridpoints, similar to a mean value for voxels?

References (that may be useful, but don't answer the question above definitively):

  1. http://paulbourke.net/dataformats/cube/ A good exposition about the cube file format.
  2. https://gitlab.com/ase/ase/-/blob/master/ase/io/cube.py#L69 ASE's cube file reader.
  3. https://h5cube-spec.readthedocs.io/en/latest/cubeformat.html Another attempt at the specs of the cube file format.

1 Answer 1


The canonical source is probably Gaussian's user documentation according to which the cube file defines an initial point $(x_0, y_0, z_0)$, as well as three step directions $(x_i, y_i, z_i)$ and the corresponding number of steps $N_i$ for $i=1,2,3$. The data are computed at the gridpoints, since averaging would make grid data evaluation much more costly, and at the limit of an infinitely fine grid the two results coincide.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .