lsst.obs.base  19.0.0-8-g608b899+1
Public Member Functions | Public Attributes | List of all members
lsst.obs.base.gen2to3.repoConverter.RepoConverter Class Reference
Inheritance diagram for lsst.obs.base.gen2to3.repoConverter.RepoConverter:
lsst.obs.base.gen2to3.calibRepoConverter.CalibRepoConverter lsst.obs.base.gen2to3.standardRepoConverter.StandardRepoConverter lsst.obs.base.gen2to3.rootRepoConverter.RootRepoConverter

Public Member Functions

def __init__
 
def isDatasetTypeSpecial
 
def isDirectorySpecial
 
def iterMappings (self)
 
def makeDataIdExtractor
 
def iterDatasets (self)
 
def prep (self)
 
def insertDimensionData (self)
 
def ingest (self)
 
def getButler
 

Public Attributes

 task
 
 root
 
 subset
 

Detailed Description

An abstract base class for objects that help `ConvertRepoTask` convert
datasets from a single Gen2 repository.

Parameters
----------
task : `ConvertRepoTask`
    Task instance that is using this helper object.
root : `str`
    Root of the Gen2 repo being converted.
collections : `list` of `str`
    Gen3 collections with which all converted datasets should be
    associated.
subset : `ConversionSubset, optional
    Helper object that implements a filter that restricts the data IDs that
    are converted.

Notes
-----
`RepoConverter` defines the only public API users of its subclasses should
use (`prep`, `insertDimensionRecords`, and `ingest`).  These delegate to
several abstract methods that subclasses must implement.  In some cases,
subclasses may reimplement the public methods as well, but are expected to
delegate to ``super()`` either at the beginning or end of their own
implementation.

Definition at line 224 of file repoConverter.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.__init__ (   self,
  task 
)

Definition at line 251 of file repoConverter.py.

Member Function Documentation

◆ getButler()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.getButler (   self,
  datasetTypeName 
)

Definition at line 475 of file repoConverter.py.

◆ ingest()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.ingest (   self)
Insert converted datasets into the Gen3 repository.

Subclasses may override this method, but must delegate to the base
class implementation at some point in their own logic.  More often,
subclasses will specialize the behavior of `ingest` simply by
overriding `iterDatasets` and `isDirectorySpecial`, to which the base
implementation delegates.

This method is guaranteed to be called after both `prep` and
`insertDimensionData`.

Definition at line 444 of file repoConverter.py.

◆ insertDimensionData()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.insertDimensionData (   self)
Insert any dimension records uniquely derived from this repository
into the registry.

Subclasses may override this method, but may not need to; the default
implementation does nothing.

SkyMap and SkyPix dimensions should instead be handled by calling
`ConvertRepoTask.useSkyMap` or `ConvertRepoTask.useSkyPix`, because
these dimensions are in general shared by multiple Gen2 repositories.

This method is guaranteed to be called between `prep` and `ingest`.

Definition at line 429 of file repoConverter.py.

◆ isDatasetTypeSpecial()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.isDatasetTypeSpecial (   self,
  datasetTypeName 
)

Definition at line 261 of file repoConverter.py.

◆ isDirectorySpecial()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.isDirectorySpecial (   self,
  subdirectory 
)

Definition at line 279 of file repoConverter.py.

◆ iterDatasets()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.iterDatasets (   self,
  Iterator,
  FileDataset 
)
Iterate over all datasets in the repository that should be
ingested into the Gen3 repository.

Subclasses may override this method, but must delegate to the base
class implementation at some point in their own logic.

Yields
------
dataset : `FileDataset`
    Structures representing datasets to be ingested.  Paths should be
    absolute.
ref : `lsst.daf.butler.DatasetRef`
    Reference for the Gen3 datasets, including a complete `DatasetType`
    and data ID.

Definition at line 347 of file repoConverter.py.

◆ iterMappings()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.iterMappings (   self,
  Iterator,
  Tuple,
  str,
  CameraMapperMapping 
)
Iterate over all `CameraMapper` `Mapping` objects that should be
considered for conversion by this repository.

This this should include any datasets that may appear in the
repository, including those that are special (see
`isDatasetTypeSpecial`) and those that are being ignored (see
`ConvertRepoTask.isDatasetTypeIncluded`); this allows the converter
to identify and hence skip these datasets quietly instead of warning
about them as unrecognized.

Yields
------
datasetTypeName: `str`
    Name of the dataset type.
mapping : `lsst.obs.base.mapping.Mapping`
    Mapping object used by the Gen2 `CameraMapper` to describe the
    dataset type.

Definition at line 301 of file repoConverter.py.

◆ makeDataIdExtractor()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.makeDataIdExtractor (   self,
  datasetTypeName 
)

Definition at line 323 of file repoConverter.py.

◆ prep()

def lsst.obs.base.gen2to3.repoConverter.RepoConverter.prep (   self)
Prepare the repository by identifying the dataset types to be
converted and building `DataIdExtractor` instance for them.

Subclasses may override this method, but must delegate to the base
class implementation at some point in their own logic.  More often,
subclasses will specialize the behavior of `prep` simply by overriding
`iterMappings`, `isDatasetTypeSpecial`, and `makeDataIdExtractor`, to
which the base implementation delegates.

This should not perform any write operations to the Gen3 repository.
It is guaranteed to be called before `insertDimensionData` and
`ingest`.

Definition at line 389 of file repoConverter.py.

Member Data Documentation

◆ root

lsst.obs.base.gen2to3.repoConverter.RepoConverter.root

Definition at line 254 of file repoConverter.py.

◆ subset

lsst.obs.base.gen2to3.repoConverter.RepoConverter.subset

Definition at line 255 of file repoConverter.py.

◆ task

lsst.obs.base.gen2to3.repoConverter.RepoConverter.task

Definition at line 253 of file repoConverter.py.


The documentation for this class was generated from the following file: