Exporting FITS files - hzovaro/spaxelsleuth GitHub Wiki

The function utils.exportfits.export_fits exports multi-extension FITS files for galaxies in a spaxelsleuth DataFrame created using io.make_df().

Each column in the DataFrame is stored as a 2D or 3D map depending on the dimensionality of the column. For example, quantities with multiple associated components - e.g., H$\alpha$ fluxes (with columns "HALPHA (component 1)", "HALPHA (component 2)", etc.) are stored as 3D arrays with dimensions M x N_y x N_x where (N_x, N_y) is the size in pixels of the 2D maps and the number of slices M is equal to ncomponents + 1, with slices as follows:

  • slice 0: "total" measurement, e.g. "HALPHA (total)". Note: for kinematic quantities for which the "total" measurement is undefined, e.g. "v_gas", slice 0 is all NaN.
  • slice 1: "component 1" measurement, e.g. "HALPHA (component 1)"
  • slice 2: "component 1" measurement, e.g. "HALPHA (component 2)" and so on.

All other quantities are simply stored as 2D maps with dimensions (N_x, N_y).

Metadata for each galaxy is taken from the corresponding "metadata" DataFrame (loaded by io.load_metadata_df()) and is stored as keywords in the header of the Primary HDU in the output FITS files. This header also records the parameters used to generate the input DataFrame, the spaxelsleuth version and the time and date of creation.

The output FITS files have the naming convention

f"{gal}_data_products_{fname_suffix}.fits"

and are saved to the directory specified in the config file as

settings[survey]["fits_output_path"] .