lsst.pipe.drivers  13.0-17-g3ce57e5+17
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.drivers.constructCalibs.CalibTask Class Reference

Base class for constructing calibs. More...

Inheritance diagram for lsst.pipe.drivers.constructCalibs.CalibTask:
lsst.pipe.drivers.constructCalibs.BiasTask lsst.pipe.drivers.constructCalibs.DarkTask lsst.pipe.drivers.constructCalibs.FlatTask lsst.pipe.drivers.constructCalibs.FringeTask

Public Member Functions

def __init__
 
def batchWallTime
 
def run
 Construct a calib from a list of exposure references. More...
 
def getOutputId
 Generate the data identifier for the output calib. More...
 
def getMjd
 
def getFilter
 
def addMissingKeys
 
def updateMetadata
 Update the metadata from the VisitInfo. More...
 
def scatterProcess
 Scatter the processing among the nodes. More...
 
def process
 Process a CCD, specified by a data identifier. More...
 
def processSingle
 
def processWrite
 Write the processed CCD. More...
 
def processResult
 
def scale
 Determine scaling across CCDs and exposures. More...
 
def scatterCombine
 Scatter the combination of exposures across multiple nodes. More...
 
def combine
 Combine multiple exposures of a particular CCD and write the output. More...
 
def recordCalibInputs
 Record metadata including the inputs and creation details. More...
 
def interpolateNans
 
def write
 Write the final combined calib. More...
 

Static Public Attributes

 ConfigClass = CalibConfig
 
 RunnerClass = CalibTaskRunner
 
 filterName = None
 
 calibName = None
 
float exposureTime = 1.0
 

Detailed Description

Base class for constructing calibs.

This should be subclassed for each of the required calib types. The subclass should be sure to define the following class variables:

Definition at line 338 of file constructCalibs.py.

Constructor & Destructor Documentation

def lsst.pipe.drivers.constructCalibs.CalibTask.__init__ (   self,
  args,
  kwargs 
)
Constructor

Definition at line 354 of file constructCalibs.py.

Member Function Documentation

def lsst.pipe.drivers.constructCalibs.CalibTask.addMissingKeys (   self,
  dataId,
  butler,
  missingKeys = None,
  calibName = None 
)

Definition at line 471 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.batchWallTime (   cls,
  time,
  parsedCmd,
  numCores 
)

Definition at line 361 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.combine (   self,
  cache,
  struct,
  outputId 
)

Combine multiple exposures of a particular CCD and write the output.

Only the slave nodes execute this method.

Parameters
cacheProcess pool cache
structParameters for the combination, which has the following components:
  • ccdName Name tuple for CCD
  • ccdIdList List of data identifiers for combination
  • scales Scales to apply (expScales are scalings for each exposure, ccdScale is final scale for combined image)
outputIdData identifier for combined image (exposure part only)

Definition at line 646 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.getFilter (   self,
  butler,
  dataId 
)
Determine the filter from a data identifier

Definition at line 466 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.getMjd (   self,
  butler,
  dataId,
  timescale = dafBase.DateTime.UTC 
)
Determine the Modified Julian Date (MJD; in TAI) from a data identifier

Definition at line 453 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.getOutputId (   self,
  expRefList,
  calibId 
)

Generate the data identifier for the output calib.

The mean date and the common filter are included, using keywords from the configuration. The CCD-specific part is not included in the data identifier.

Parameters
expRefListList of data references at exposure level
calibIdData identifier elements for the calib provided by the user
Returns
data identifier

Definition at line 418 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.interpolateNans (   self,
  image 
)
Interpolate over NANs in the combined image

NANs can result from masked areas on the CCD.  We don't want them getting
into our science images, so we replace them with the median of the image.

Definition at line 718 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.process (   self,
  cache,
  ccdId,
  outputName = "postISRCCD" 
)

Process a CCD, specified by a data identifier.

After processing, optionally returns a result (produced by the 'processResult' method) calculated from the processed exposure. These results will be gathered by the master node, and is a means for coordinated scaling of all CCDs for flats, etc.

Only slave nodes execute this method.

Parameters
cacheProcess pool cache
ccdIdData identifier for CCD
outputNameOutput dataset name for butler
Returns
result from 'processResult'

Definition at line 540 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.processResult (   self,
  exposure 
)
Extract processing results from a processed exposure

This method generates what is gathered by the master node.
This can be a background measurement or similar for scaling
flat-fields.  It must be picklable!

Only slave nodes execute this method.

Definition at line 598 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.processSingle (   self,
  dataRef 
)
Process a single CCD, specified by a data reference

Generally, this simply means doing ISR.

Only slave nodes execute this method.

Definition at line 575 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.processWrite (   self,
  dataRef,
  exposure,
  outputName = "postISRCCD" 
)

Write the processed CCD.

We need to write these out because we can't hold them all in memory at once.

Only slave nodes execute this method.

Parameters
dataRefData reference
exposureCCD exposure to write
outputNameOutput dataset name for butler.

Definition at line 584 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.recordCalibInputs (   self,
  butler,
  calib,
  dataIdList,
  outputId 
)

Record metadata including the inputs and creation details.

This metadata will go into the FITS header.

Parameters
butlerData butler
calibCombined calib exposure.
dataIdListList of data identifiers for calibration inputs
outputIdData identifier for output

Definition at line 688 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.run (   self,
  expRefList,
  butler,
  calibId 
)

Construct a calib from a list of exposure references.

This is the entry point, called by the TaskRunner.__call__

Only the master node executes this method.

Parameters
expRefListList of data references at the exposure level
butlerData butler
calibIdIdentifier dict for calib

Definition at line 373 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.scale (   self,
  ccdIdLists,
  data 
)

Determine scaling across CCDs and exposures.

This is necessary mainly for flats, so as to determine a consistent scaling across the entire focal plane. This implementation is simply a placeholder.

Only the master node executes this method.

Parameters
ccdIdListsDict of data identifier lists for each CCD tuple
dataDict of lists of returned data for each CCD tuple
Returns
dict of Struct(ccdScale: scaling for CCD, expScales: scaling for each exposure ) for each CCD tuple

Definition at line 609 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.scatterCombine (   self,
  pool,
  outputId,
  ccdIdLists,
  scales 
)

Scatter the combination of exposures across multiple nodes.

In this case, we can only scatter across as many nodes as there are CCDs.

Only the master node executes this method.

Parameters
poolProcess pool
outputIdOutput identifier (exposure part only)
ccdIdListsDict of data identifier lists for each CCD name
scalesDict of structs with scales, for each CCD name

Definition at line 628 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.scatterProcess (   self,
  pool,
  ccdIdLists 
)

Scatter the processing among the nodes.

We scatter each CCD independently (exposures aren't grouped together), to make full use of all available processors. This necessitates piecing everything back together in the same format as ccdIdLists afterwards.

Only the master node executes this method.

Parameters
poolProcess pool
ccdIdListsDict of data identifier lists for each CCD name
Returns
Dict of lists of returned data for each CCD name

Definition at line 508 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.updateMetadata (   self,
  calibImage,
  exposureTime,
  darkTime = None,
  kwargs 
)

Update the metadata from the VisitInfo.

Parameters
calibImageThe image whose metadata is to be set
exposureTimeThe exposure time for the image
darkTimeThe time since the last read (default: exposureTime)

Definition at line 492 of file constructCalibs.py.

def lsst.pipe.drivers.constructCalibs.CalibTask.write (   self,
  butler,
  exposure,
  dataId 
)

Write the final combined calib.

Only the slave nodes execute this method

Parameters
butlerData butler
exposureCCD exposure to write
dataIdData identifier for output

Definition at line 733 of file constructCalibs.py.

Member Data Documentation

lsst.pipe.drivers.constructCalibs.CalibTask.calibName = None
static

Definition at line 351 of file constructCalibs.py.

lsst.pipe.drivers.constructCalibs.CalibTask.ConfigClass = CalibConfig
static

Definition at line 348 of file constructCalibs.py.

float lsst.pipe.drivers.constructCalibs.CalibTask.exposureTime = 1.0
static

Definition at line 352 of file constructCalibs.py.

lsst.pipe.drivers.constructCalibs.CalibTask.filterName = None
static

Definition at line 350 of file constructCalibs.py.

lsst.pipe.drivers.constructCalibs.CalibTask.RunnerClass = CalibTaskRunner
static

Definition at line 349 of file constructCalibs.py.


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