ingest_guider

lsst.obs.lsst.ingest_guider(butler: ~lsst.daf.butler._butler.Butler, locations: list[str | urllib.parse.ParseResult | lsst.resources._resourcePath.ResourcePath | pathlib.Path], *, file_filter: str = '.*SG.*_guider\\.fits$', group_files: bool = True, run: str | None = None, transfer: str = 'auto', register_dataset_type: bool = False, track_file_attrs: bool = True, on_success: ~collections.abc.Callable[[list[lsst.daf.butler._file_dataset.FileDataset]], ~typing.Any] = <function _do_nothing>, on_metadata_failure: ~collections.abc.Callable[[~lsst.resources._resourcePath.ResourcePath, Exception], ~typing.Any] = <function _do_nothing>, on_undefined_exposure: ~collections.abc.Callable[[~lsst.resources._resourcePath.ResourcePath, str], ~typing.Any] = <function _do_nothing>, on_ingest_failure: ~collections.abc.Callable[[list[lsst.daf.butler._file_dataset.FileDataset], Exception], ~typing.Any] = <function _do_nothing>, fail_fast: bool = False) list[lsst.daf.butler._dataset_ref.DatasetRef]

Ingest the given files into the butler repository.

Parameters:
butlerlsst.daf.butler.Butler

Butler in which to ingest the guider files.

locationslist [ lsst.resources.ResourcePathExpression ]

Guider files to ingest or directories of guider files.

file_filterstr, optional

The file filter to use if directories are to be searched.

group_files: `bool`, optional

If True files are ingested in groups based on the directories they are found in. If False directories are searched and all files are ingested together. If explicit files are given they are treated as their own group.

runstr or None, optional

The name of the run that will be receiving these datasets. By default. if None, a value of <INSTRUMENT>/raw/guider is used.

transferstr, optional

Transfer mode to use for ingest. Default is “auto”. If “direct” mode is used ingestion of a file that is already present in the butler repo will not be an error.

register_dataset_typebool, optional

If True the dataset type will be created if it is not defined. Default is False.

track_file_attrsbool, optional

Control whether file attributes such as the size or checksum should be tracked by the datastore. Whether this parameter is honored depends on the specific datastore implementation.

on_successCallable, optional

A callback invoked when all of the raws associated with a group are ingested. Will be passed a list of FileDataset objects, each containing one or more resolved DatasetRef objects. If this callback raises it will interrupt the entire ingest process, even if fail_fast is False.

on_metadata_failureCallable, optional

A callback invoked when a failure occurs trying to translate the metadata for a file. Will be passed the URI and the exception, in that order, as positional arguments. Guaranteed to be called in an except block, allowing the callback to re-raise or replace (with raise ... from) default exception handling.

on_undefined_exposureCallable, optional

A callback invoked when a guider file can’t be ingested because the corresponding exposure dimension record does not yet exist. Will be passed the URI and the OBSID.

on_ingest_failureCallable, optional

A callback invoked when dimension record or dataset insertion into the database fails for an exposure. Will be passed a list of FileDataset objects corresponding to the files being ingested, and the exception as positional arguments. Guaranteed to be called in an except block, allowing the callback to re-raise or replace (with raise ... from) to override the usual error handling (before fail_fast logic occurs).

fail_fastbool, optional

If True ingest will abort if there is any issue with any files. If False, an attempt will be made

Returns:
refslist [ DatasetRef ]

Butler datasets that were ingested.

Notes

Always uses a dataset type named “guider_raw” with dimensions instrument, detector, exposure. The exposure must already be defined.