lsst.obs.base

The lsst.obs.base module provides the framework and common API for telescope/camera specific “obs” packages. New cameras will derive from the classes defined here. lsst.obs.base.tests provides the tests that all “obs” packages should pass.

Contributing

lsst.obs.base is developed at https://github.com/lsst/obs_base. You can find Jira issues for this module under the obs_base component.

Command Line Interface

daf_butler implements a command line interface command called butler. The following subcommands are implemented by this package and available to the butler command when this package is setup.

butler

butler [OPTIONS] COMMAND [ARGS]...

convert

Convert a Butler gen 2 repository into a gen 3 repository.

REPO is the URI or path to the gen3 repository. Will be created if it does not already exist

butler convert [OPTIONS] REPO

Options

--gen2root <gen2root>

Required Root path of the gen 2 repo to be converted.

--skymap-name <skymap_name>

Name of the new gen3 skymap (e.g. ‘discrete/ci_hsc’).

--skymap-config <skymap_config>

Path to skymap config file defining the new gen3 skymap.

--calibs <calibs>

Path to the gen 2 calibration repo. It can be absolute or relative to gen2root.

--reruns <TEXT ...>

List of gen 2 reruns to convert.

-t, --transfer <transfer>

Mode to use to transfer files into the new repository.

Options:auto|link|symlink|hardlink|copy|move|relsymlink
-C, --config-file <config_file>

Path to a ConvertRepoConfig override to be included after the Instrument config overrides are applied.

Arguments

REPO

Required argument

define-visits

Define visits from exposures in the butler registry.

REPO is the URI or path to an existing data repository root or configuration file.

butler define-visits [OPTIONS] REPO

Options

-C, --config-file <config_file>

Path to a pex_config override to be included after the Instrument config overrides are applied.

--collections <TEXT ...>

The collections to be searched (in order) when reading datasets.

-i, --instrument <instrument>

Required The name or fully-qualified class name of an instrument.

Arguments

REPO

Required argument

ingest-raws

Ingest raw frames into from a directory into the butler registry

REPO is the URI or path to an existing data repository root or configuration file.

butler ingest-raws [OPTIONS] REPO

Options

-c, --config <TEXT=TEXT>

Config override, as a key-value pair.

-C, --config-file <config_file>

Path to a pex config override to be included after the Instrument config overrides are applied.

--output-run <output_run>

The name of the run datasets should be output to.

-d, --dir <directory>

The path to the directory containing the raws to ingest.

-f, --file <file>

The name of a file containing raws to ingest.

-t, --transfer <transfer>

The external data transfer mode.

Options:auto|link|symlink|hardlink|copy|move|relsymlink
--ingest-task <ingest_task>

The fully qualified class name of the ingest task to use.

Arguments

REPO

Required argument

register-instrument

Add an instrument to the data repository.

REPO is the URI or path to an existing data repository root or configuration file.

The fully-qualified name of an Instrument subclass.

butler register-instrument [OPTIONS] REPO INSTRUMENT ...

Arguments

REPO

Required argument

INSTRUMENT

Required argument(s)

write-curated-calibrations

Add an instrument’s curated calibrations to the data repository.

REPO is the URI or path to an existing data repository root or configuration file.

butler write-curated-calibrations [OPTIONS] REPO

Options

-i, --instrument <instrument>

Required The name or fully-qualified class name of an instrument.

--output-run <output_run>

The name of the run datasets should be output to.

Arguments

REPO

Required argument

Python API reference

lsst.obs.base Package

Functions

addUnboundedCalibrationLabel(registry, …) Add a special ‘unbounded’ calibration_label dimension entry for the given camera that is valid for any exposure.
bboxFromIraf(irafBBoxStr) Return a Box2I corresponding to an IRAF-style BBOX
createInitialSkyWcs(visitInfo, detector[, flipX]) Create a SkyWcs from the telescope boresight and detector geometry.
exposureFromImage(image[, dataId, mapper, …]) Generate an Exposure from an image-like object
loadCamera(butler, dataId, Mapping[str, …) Attempt to load versioned camera geometry from a butler, but fall back to obtaining a nominal camera from the Instrument class if that fails.
makeExposureRecordFromObsInfo(obsInfo, universe) Construct an exposure DimensionRecord from astro_metadata_translator.ObservationInfo.
makeTransferChoiceField([doc, default]) Create a Config field with options for how to transfer files between data repositories.

Classes

CalibrationMapping(datasetType, policy, …) CalibrationMapping is a Mapping subclass for calibration-type products.
CameraMapper(policy, repositoryDir[, root, …]) CameraMapper is a base class for mappers that handle images from a camera and products derived from them.
DatasetMapping(datasetType, policy, …) DatasetMapping is a Mapping subclass for non-Exposure datasets that can be retrieved by the standard daf_persistence mechanism.
DefineVisitsConfig
DefineVisitsTask(config, *, butler, **kwargs) Driver Task for defining visits (and their spatial regions) in Gen3 Butler repositories.
ExposureIdInfo([expId, expBits, maxBits]) Exposure ID and number of bits used.
ExposureMapping(datasetType, policy, …) ExposureMapping is a Mapping subclass for normal exposures.
FilterDefinition(physical_filter, lambdaEff, …) The definition of an instrument’s filter bandpass.
FilterDefinitionCollection(*filters) An order-preserving collection of multiple FilterDefinition.
FitsRawFormatterBase(*args, **kwargs) Abstract base class for reading and writing raw data to and from FITS files.
GroupExposuresConfig
GroupExposuresTask(config, **kwargs) Abstract base class for the subtask of DefineVisitsTask that is responsible for grouping exposures into visits.
ImageMapping(datasetType, policy, registry, …) ImageMapping is a Mapping subclass for non-camera images.
InitialSkyWcsError For handling failures when creating a SkyWcs from a camera geometry and boresight.
Instrument() Base class for instrument-specific logic for the Gen3 Butler.
MakeRawVisitInfo([log, doStripHeader]) Base class functor to make a VisitInfo from the FITS header of a raw image.
MakeRawVisitInfoViaObsInfo([log, doStripHeader]) Base class functor to make a VisitInfo from the FITS header of a raw image using ObservationInfo translators.
Mapping(datasetType, policy, registry, …) Mapping is a base class for all mappings.
RawIngestConfig
RawIngestTask(config, *, butler, **kwargs) Driver Task for ingesting raw data into Gen3 Butler repositories.
VisitDefinitionData(instrument, id, name, …) Struct representing a group of exposures that will be used to define a visit.

Class Inheritance Diagram

Inheritance diagram of lsst.obs.base.mapping.CalibrationMapping, lsst.obs.base.cameraMapper.CameraMapper, lsst.obs.base.mapping.DatasetMapping, lsst.obs.base.defineVisits.DefineVisitsConfig, lsst.obs.base.defineVisits.DefineVisitsTask, lsst.obs.base.exposureIdInfo.ExposureIdInfo, lsst.obs.base.mapping.ExposureMapping, lsst.obs.base.filters.FilterDefinition, lsst.obs.base.filters.FilterDefinitionCollection, lsst.obs.base._fitsRawFormatterBase.FitsRawFormatterBase, lsst.obs.base.defineVisits.GroupExposuresConfig, lsst.obs.base.defineVisits.GroupExposuresTask, lsst.obs.base.mapping.ImageMapping, lsst.obs.base.utils.InitialSkyWcsError, lsst.obs.base._instrument.Instrument, lsst.obs.base.makeRawVisitInfo.MakeRawVisitInfo, lsst.obs.base.makeRawVisitInfoViaObsInfo.MakeRawVisitInfoViaObsInfo, lsst.obs.base.mapping.Mapping, lsst.obs.base.ingest.RawIngestConfig, lsst.obs.base.ingest.RawIngestTask, lsst.obs.base.defineVisits.VisitDefinitionData

lsst.obs.base.tests Module

Classes

ObsTests Aggregator class for all of the obs_* test classes.

Class Inheritance Diagram

Inheritance diagram of lsst.obs.base.tests.ObsTests

lsst.obs.base.formatters.fitsExposure Module

Classes

FitsExposureFormatter(fileDescriptor, …) Interface for reading and writing Exposures to and from FITS files.
FitsImageFormatter(fileDescriptor, dataId, …) Specialisation for Image reading.
FitsMaskFormatter(fileDescriptor, dataId, …) Specialisation for Mask reading.
FitsMaskedImageFormatter(fileDescriptor, …) Specialisation for MaskedImage reading.

Class Inheritance Diagram

Inheritance diagram of lsst.obs.base.formatters.fitsExposure.FitsExposureFormatter, lsst.obs.base.formatters.fitsExposure.FitsImageFormatter, lsst.obs.base.formatters.fitsExposure.FitsMaskFormatter, lsst.obs.base.formatters.fitsExposure.FitsMaskedImageFormatter

lsst.obs.base.formatters.fitsGeneric Module

Classes

FitsGenericFormatter(fileDescriptor, dataId, …) Interface for reading and writing objects that support the standard afw I/O readFits/writeFits methods.

Class Inheritance Diagram

Inheritance diagram of lsst.obs.base.formatters.fitsGeneric.FitsGenericFormatter