LSSTApplications
17.0+103,17.0+11,17.0+61,18.0.0+13,18.0.0+25,18.0.0+5,18.0.0+52,18.0.0-4-g68ffd23,18.1.0-1-g0001055+8,18.1.0-1-g03d53ef+1,18.1.0-1-g1349e88+28,18.1.0-1-g2505f39+22,18.1.0-1-g380d4d4+27,18.1.0-1-g5315e5e+1,18.1.0-1-g5e4b7ea+10,18.1.0-1-g7e8fceb+1,18.1.0-1-g85f8cd4+23,18.1.0-1-g9a6769a+13,18.1.0-1-ga1a4c1a+22,18.1.0-1-gd55f500+17,18.1.0-12-g42eabe8e+10,18.1.0-14-gd04256d+15,18.1.0-16-g430f6a53+1,18.1.0-17-gd2166b6e4,18.1.0-18-gb5d19ff+1,18.1.0-2-gfbf3545+7,18.1.0-2-gfefb8b5+16,18.1.0-3-g52aa583+13,18.1.0-3-g62b5e86+14,18.1.0-3-g8f4a2b1+17,18.1.0-3-g9bc06b8+7,18.1.0-3-gb69f684+9,18.1.0-4-g1ee41a7+1,18.1.0-5-g6dbcb01+13,18.1.0-5-gc286bb7+3,18.1.0-6-g48bdcd3+2,18.1.0-6-gd05e160+9,18.1.0-7-gc4d902b+2,18.1.0-7-gebc0338+8,18.1.0-9-gae7190a+10,w.2019.38
LSSTDataManagementBasePackage
|
Public Member Functions | |
def | getDatasetType (self) |
def | __init__ (self, config=None, butler, kwds) |
def | run (self, files) |
def | readHeaders (self, file) |
def | buildRegion (self, headers) |
def | ensureDimensions (self, file) |
def | ingestFile (self, file, headers, dataId, run=None) |
def | processFile (self, file) |
def | extractDataId (self, file, headers, obsInfo) |
def | getFormatter (self, file, headers, dataId) |
def | emptyMetadata (self) |
def | getSchemaCatalogs (self) |
def | getAllSchemaCatalogs (self) |
def | getFullMetadata (self) |
def | getFullName (self) |
def | getName (self) |
def | getTaskDict (self) |
def | makeSubtask (self, name, keyArgs) |
def | timer (self, name, logLevel=Log.DEBUG) |
def | makeField (cls, doc) |
def | __reduce__ (self) |
Public Attributes | |
butler | |
datasetType | |
dimensions | |
dimensionEntriesDone | |
instrumentCache | |
stashRun | |
visitRegions | |
metadata | |
log | |
config | |
Static Public Attributes | |
ConfigClass = RawIngestConfig | |
Driver Task for ingesting raw data into Gen3 Butler repositories. This Task is intended to be runnable from the command-line, but it doesn't meet the other requirements of CmdLineTask or PipelineTask, and wouldn't gain much from being one. It also wouldn't really be appropriate as a subtask of a CmdLineTask or PipelineTask; it's a Task essentially just to leverage the logging and configurability functionality that provides. Each instance of `RawIngestTask` writes to the same Butler and maintains a cache of Dimension entries that have already been added to or extracted from its Registry. Each invocation of `RawIngestTask.run` ingests a list of files (possibly semi-atomically; see `RawIngestConfig.onError`). RawIngestTask may be subclassed to specialize ingest for the actual structure of raw data files produced by a particular instrument, but this is usually unnecessary because the instrument-specific header-extraction provided by the ``astro_metadata_translator`` is usually enough. Parameters ---------- config : `RawIngestConfig` Configuration for whether/how to transfer files and how to handle conflicts and errors. butler : `~lsst.daf.butler.Butler` Butler instance. Ingested Datasets will be created as part of ``butler.run`` and associated with its Collection. Other keyword arguments are forwarded to the Task base class constructor.
def lsst.obs.base.gen3.ingest.RawIngestTask.__init__ | ( | self, | |
config = None , |
|||
butler, | |||
kwds | |||
) |
Definition at line 147 of file ingest.py.
|
inherited |
Pickler.
def lsst.obs.base.gen3.ingest.RawIngestTask.buildRegion | ( | self, | |
headers | |||
) |
Builds a region from information contained in a header Parameters ---------- headers : `lsst.daf.base.PropertyList` Property list containing the information from the header of one file. Returns ------- region : `lsst.sphgeom.ConvexPolygon` Raises ------ ValueError : If required header keys can not be found to construct region
Definition at line 242 of file ingest.py.
|
inherited |
Empty (clear) the metadata for this Task and all sub-Tasks.
Definition at line 153 of file task.py.
def lsst.obs.base.gen3.ingest.RawIngestTask.ensureDimensions | ( | self, | |
file | |||
) |
Extract metadata from a raw file and add exposure and visit Dimension entries. Any needed instrument, detector, and physical_filter Dimension entries must exist in the Registry before `run` is called. Parameters ---------- file : `str` or path-like object Absolute path to the file to be ingested. Returns ------- headers : `list` of `~lsst.daf.base.PropertyList` Result of calling `readHeaders`. dataId : `DataId` Data ID dictionary, as returned by `extractDataId`.
Definition at line 270 of file ingest.py.
def lsst.obs.base.gen3.ingest.RawIngestTask.extractDataId | ( | self, | |
file, | |||
headers, | |||
obsInfo | |||
) |
Return the Data ID dictionary that should be used to label a file. Parameters ---------- file : `str` or path-like object Absolute path to the file being ingested (prior to any transfers). headers : `list` of `~lsst.daf.base.PropertyList` All headers returned by `readHeaders()`. obsInfo : `astro_metadata_translator.ObservationInfo` Observational metadata extracted from the headers. Returns ------- dataId : `DataId` A mapping whose key-value pairs uniquely identify raw datasets. Must have ``dataId.dimensions() <= self.dimensions``, with at least instrument, exposure, and detector present.
Definition at line 404 of file ingest.py.
|
inherited |
Get schema catalogs for all tasks in the hierarchy, combining the results into a single dict. Returns ------- schemacatalogs : `dict` Keys are butler dataset type, values are a empty catalog (an instance of the appropriate lsst.afw.table Catalog type) for all tasks in the hierarchy, from the top-level task down through all subtasks. Notes ----- This method may be called on any task in the hierarchy; it will return the same answer, regardless. The default implementation should always suffice. If your subtask uses schemas the override `Task.getSchemaCatalogs`, not this method.
def lsst.obs.base.gen3.ingest.RawIngestTask.getDatasetType | ( | self | ) |
Return the DatasetType of the Datasets ingested by this Task.
def lsst.obs.base.gen3.ingest.RawIngestTask.getFormatter | ( | self, | |
file, | |||
headers, | |||
dataId | |||
) |
Return the Formatter that should be used to read this file after ingestion. The default implementation obtains the formatter from the Instrument class for the given data ID.
Definition at line 445 of file ingest.py.
|
inherited |
Get metadata for all tasks. Returns ------- metadata : `lsst.daf.base.PropertySet` The `~lsst.daf.base.PropertySet` keys are the full task name. Values are metadata for the top-level task and all subtasks, sub-subtasks, etc.. Notes ----- The returned metadata includes timing information (if ``@timer.timeMethod`` is used) and any metadata set by the task. The name of each item consists of the full task name with ``.`` replaced by ``:``, followed by ``.`` and the name of the item, e.g.:: topLevelTaskName:subtaskName:subsubtaskName.itemName using ``:`` in the full task name disambiguates the rare situation that a task has a subtask and a metadata item with the same name.
Definition at line 210 of file task.py.
|
inherited |
Get the task name as a hierarchical name including parent task names. Returns ------- fullName : `str` The full name consists of the name of the parent task and each subtask separated by periods. For example: - The full name of top-level task "top" is simply "top". - The full name of subtask "sub" of top-level task "top" is "top.sub". - The full name of subtask "sub2" of subtask "sub" of top-level task "top" is "top.sub.sub2".
Definition at line 235 of file task.py.
|
inherited |
Get the name of the task. Returns ------- taskName : `str` Name of the task. See also -------- getFullName
|
inherited |
Get the schemas generated by this task. Returns ------- schemaCatalogs : `dict` Keys are butler dataset type, values are an empty catalog (an instance of the appropriate `lsst.afw.table` Catalog type) for this task. Notes ----- .. warning:: Subclasses that use schemas must override this method. The default implemenation returns an empty dict. This method may be called at any time after the Task is constructed, which means that all task schemas should be computed at construction time, *not* when data is actually processed. This reflects the philosophy that the schema should not depend on the data. Returning catalogs rather than just schemas allows us to save e.g. slots for SourceCatalog as well. See also -------- Task.getAllSchemaCatalogs
|
inherited |
Get a dictionary of all tasks as a shallow copy. Returns ------- taskDict : `dict` Dictionary containing full task name: task object for the top-level task and all subtasks, sub-subtasks, etc..
Definition at line 264 of file task.py.
def lsst.obs.base.gen3.ingest.RawIngestTask.ingestFile | ( | self, | |
file, | |||
headers, | |||
dataId, | |||
run = None |
|||
) |
Ingest a single raw file into the repository. All necessary Dimension entres must already be present. Parameters ---------- file : `str` or path-like object Absolute path to the file to be ingested. headers : `list` of `~lsst.daf.base.PropertyList` Result of calling `readHeaders`. dataId : `dict` Data ID dictionary, as returned by `extractDataId`. run : `~lsst.daf.butler.Run`, optional Run to add the Dataset to; defaults to ``self.butler.run``. Returns ------- ref : `DatasetRef` Reference to the ingested dataset. Raises ------ ConflictingDefinitionError Raised if the dataset already exists in the registry.
Definition at line 330 of file ingest.py.
|
inherited |
Make a `lsst.pex.config.ConfigurableField` for this task. Parameters ---------- doc : `str` Help text for the field. Returns ------- configurableField : `lsst.pex.config.ConfigurableField` A `~ConfigurableField` for this task. Examples -------- Provides a convenient way to specify this task is a subtask of another task. Here is an example of use:: class OtherTaskConfig(lsst.pex.config.Config) aSubtask = ATaskClass.makeField("a brief description of what this task does")
Definition at line 329 of file task.py.
|
inherited |
Create a subtask as a new instance as the ``name`` attribute of this task. Parameters ---------- name : `str` Brief name of the subtask. keyArgs Extra keyword arguments used to construct the task. The following arguments are automatically provided and cannot be overridden: - "config". - "parentTask". Notes ----- The subtask must be defined by ``Task.config.name``, an instance of pex_config ConfigurableField or RegistryField.
def lsst.obs.base.gen3.ingest.RawIngestTask.processFile | ( | self, | |
file | |||
) |
Ingest a single raw data file after extacting metadata. This creates any new exposure or visit Dimension entries needed to identify the ingest file, creates a new Dataset entry in the Registry and finally ingests the file itself into the Datastore. Any needed instrument, detector, and physical_filter Dimension entries must exist in the Registry before `run` is called. Parameters ---------- file : `str` or path-like object Absolute path to the file to be ingested.
Definition at line 366 of file ingest.py.
def lsst.obs.base.gen3.ingest.RawIngestTask.readHeaders | ( | self, | |
file | |||
) |
Read and return any relevant headers from the given file. The default implementation simply reads the header of the first non-empty HDU, so it always returns a single-element list. Parameters ---------- file : `str` or path-like object Absolute path to the file to be ingested. Returns ------- headers : `list` of `~lsst.daf.base.PropertyList` Single-element list containing the header of the first non-empty HDU.
Definition at line 219 of file ingest.py.
def lsst.obs.base.gen3.ingest.RawIngestTask.run | ( | self, | |
files | |||
) |
Ingest files into a Butler data repository. This creates any new exposure or visit Dimension entries needed to identify the ingested files, creates new Dataset entries in the Registry and finally ingests the files themselves into the Datastore. Any needed instrument, detector, and physical_filter Dimension entries must exist in the Registry before `run` is called. Parameters ---------- files : iterable over `str` or path-like objects Paths to the files to be ingested. Will be made absolute if they are not already.
Definition at line 183 of file ingest.py.
|
inherited |
Context manager to log performance data for an arbitrary block of code. Parameters ---------- name : `str` Name of code being timed; data will be logged using item name: ``Start`` and ``End``. logLevel A `lsst.log` level constant. Examples -------- Creating a timer context:: with self.timer("someCodeToTime"): pass # code to time See also -------- timer.logInfo
Definition at line 301 of file task.py.
|
static |
lsst.obs.base.gen3.ingest.RawIngestTask.dimensionEntriesDone |