open_fits_cube

threadcount.fit.open_fits_cube(data_filename, data_hdu_index=None, var_filename=None, var_hdu_index=None, **kwargs)[source]

Load a fits file using mpdaf.obj.Cube, and handle variance in separate file.

I highly recommend being explicit in the parameters and not relying on the guessing that mpdaf can perform.

Parameters:
  • data_filename (str) – Path to file containing data

  • data_hdu_index (int, optional) – Index indicating which hdu contains the data (starting with 0), by default None (then the mpdaf.obj.Cube constructor will attempt to guess the correct extension)

  • var_filename (str, optional) – Path to file containing variance, by default None (No variance will be loaded. Unless data_hdu_index = None, and then the mpdaf.obj.Cube constructor will attempt to automatically load variance from data_filename)

  • var_hdu_index (int, optional) – Index indicating which hdu contains the variance (starting with 0), by default None (then the mpdaf.obj.Cube constructor will attempt to guess the correct extension)

  • **kwargs (dict, optional) – Any keyword arguments to pass to mpdaf.obj.Cube, such as unit

Returns:

A data cube.

Return type:

mpdaf.obj.Cube