sncosmo.read_griddata_fits(name_or_obj, ext=0)[source]

Read a multi-dimensional grid of data from a FITS file, where the grid coordinates are encoded in the FITS-WCS header keywords.

name_or_objstr or file-like object
x0, x1, …ndarray

1-d arrays giving coordinates of grid. The number of these arrays will depend on the dimension of the data array. For example, if the data have two dimensions, a total of three arrays will be returned: x0, x1, y, with x0 giving the coordinates of the first axis of y. If the data have three dimensions, a total of four arrays will be returned: x0, x1, x2, y, and so on with higher dimensions.


n-d array of shape (len(x0), len(x1), ...). For three dimensions for example, the value at y[i, j, k] corresponds to coordinates (x0[i], x1[j], x2[k]).