populate_recarray

jwst.datamodels.utils.flat_multispec.populate_recarray(output_table, input_spec, columns, is_vector, ignore_columns=None)[source]

Populate the output table in-place with data from the input spectrum.

The output table is padded with NaNs to match the maximum number of data points for any spectrum in the exposure. The metadata columns are copied from the input spectrum assuming they have the same names as in the output table.

Parameters:
output_tablerecarray

The output table to be populated with the spectral data.

input_specSpecModel or CombinedSpecModel

The input data model containing the spectral data.

columnsndarray[tuple]

Array of tuples containing the column names and their dtypes.

is_vectorndarray[bool]

Array of booleans indicating whether each column is vector-like,

ignore_columnslist[str], optional

List of column names to ignore when copying data or metadata from the input spectrum to the output table. This is useful for columns that are not present in the input spectrum but are required in the output table, and are handled separately in the calling code.