slit_best_source_alias

msaexp.msa.slit_best_source_alias(slit, require_primary=False, which='min', verbose=False)[source]

Get the “best” source id from the MSA metadata file associated with a particular slit extraction.

Parameters
slitstr, stdatamodels.jwst.datamodels.slit.SlitModel

Slit object or filename of one

require_primarybool

Include a test on “primary_source = Y” in the shutter table.

which‘most’, ‘min’, ‘max’

Criterion for picking the “best” source_id among multiple source ids assigned for a particular slitlet_id.

Returns
aliasstr

Source alias, either background_{id}``if no non-zero source ids found or ``{program}_{id} if a primary source found with a particular slitlet_id.