save_binned_data_fits#

niriss_tools.sed.save_binned_data_fits(bin_labels, out_path, filter_keys, signal_paths, var_paths, crop=None, header=None, overwrite=True)[source]#

Create a binned photometric catalogue from a segmentation map.

Unlike save_binned_data_arr, this uses as input multiple FITS files containing the signal and variance arrays.

Parameters:
bin_labelsArrayLike

A 2D int array, containing the bin label assigned to each element of the input arrays.

out_pathPathLike

The path to save the output.

filter_keyslist

The names of the filters corresponding to each of the signal and variance image pairs. These will be used as column names in the photometric catalogue.

signal_pathslist

A list containing the locations of the direct images.

var_pathslist

A list containing the locations of the associated variance images.

croptuple | None, optional

A crop to be applied to the images before applying the binning scheme, by default None.

headerfits.Header | None = None

If supplied, this will be used to generate a header for the segmentation map in the output file. If None, a header will be taken from the first image in signal_paths.

overwritebool, optional

If a catalogue already exists at out_path, this determines if it should be written over. By default True.