lsst.jointcal gbb8dafda3b+da34e162e6
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
lsst.jointcal.jointcal.JointcalTask Class Reference
Inheritance diagram for lsst.jointcal.jointcal.JointcalTask:

Public Member Functions

 __init__ (self, **kwargs)
 
 runQuantum (self, butlerQC, inputRefs, outputRefs)
 
 run (self, inputSourceTableVisit, inputVisitSummary, inputCamera, tract=None)
 

Public Attributes

 astrometryRefObjLoader
 
 photometryRefObjLoader
 
 job
 
 focalPlaneBBox
 
 config
 
 sourceSelector
 
 log
 

Static Public Attributes

 ConfigClass = JointcalConfig
 

Protected Member Functions

 _put_metrics (self, butlerQC, job, outputRefs)
 
 _put_output (self, butlerQC, outputs, outputRefs, camera, setter)
 
 _load_data (self, inputSourceTableVisit, inputVisitSummary, associations, jointcalControl, camera)
 
 _make_one_input_data (self, visitRecord, catalog, detectorDict)
 
 _build_ccdImage (self, data, associations, jointcalControl)
 
 _getDebugPath (self, filename)
 
 _prep_sky (self, associations, filters)
 
 _get_refcat_coordinate_error_override (self, refCat, name)
 
 _compute_proper_motion_epoch (self, ccdImageList)
 
 _do_load_refcat_and_fit (self, associations, defaultFilter, center, radius, tract="", match_cut=3.0, reject_bad_fluxes=False, *name="", refObjLoader=None, referenceSelector=None, fit_function=None, epoch=None)
 
 _load_reference_catalog (self, refObjLoader, referenceSelector, center, radius, filterLabel, applyColorterms=False, epoch=None)
 
 _check_star_lists (self, associations, name)
 
 _logChi2AndValidate (self, associations, fit, model, chi2Label, writeChi2Name=None)
 
 _fit_photometry (self, associations, dataName=None)
 
 _fit_astrometry (self, associations, dataName=None)
 
 _check_stars (self, associations)
 
 _iterate_fit (self, associations, fitter, max_steps, name, whatToFit, dataName="", sigmaRelativeTolerance=0, doRankUpdate=True, doLineSearch=False)
 
 _make_output (self, ccdImageList, model, func)
 

Static Protected Attributes

str _DefaultName = "jointcal"
 

Detailed Description

Astrometricly and photometricly calibrate across multiple visits of the
same field.

Definition at line 495 of file jointcal.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.jointcal.jointcal.JointcalTask.__init__ ( self,
** kwargs )

Definition at line 503 of file jointcal.py.

Member Function Documentation

◆ _build_ccdImage()

lsst.jointcal.jointcal.JointcalTask._build_ccdImage ( self,
data,
associations,
jointcalControl )
protected
Extract the necessary things from this catalog+metadata to add a new
ccdImage.

Parameters
----------
data : `JointcalInputData`
    The loaded input data.
associations : `lsst.jointcal.Associations`
    Object to add the info to, to construct a new CcdImage
jointcalControl : `jointcal.JointcalControl`
    Control object for associations management

Returns
------
namedtuple or `None`
    ``wcs``
        The TAN WCS of this image, read from the calexp
        (`lsst.afw.geom.SkyWcs`).
    ``key``
        A key to identify this dataRef by its visit and ccd ids
        (`namedtuple`).
    `None`
    if there are no sources in the loaded catalog.

Definition at line 768 of file jointcal.py.

◆ _check_star_lists()

lsst.jointcal.jointcal.JointcalTask._check_star_lists ( self,
associations,
name )
protected

Definition at line 1047 of file jointcal.py.

◆ _check_stars()

lsst.jointcal.jointcal.JointcalTask._check_stars ( self,
associations )
protected
Count measured and reference stars per ccd and warn/log them.

Definition at line 1305 of file jointcal.py.

◆ _compute_proper_motion_epoch()

lsst.jointcal.jointcal.JointcalTask._compute_proper_motion_epoch ( self,
ccdImageList )
protected
Return the proper motion correction epoch of the provided images.

Parameters
----------
ccdImageList : `list` [`lsst.jointcal.CcdImage`]
    The images to compute the appropriate epoch for.

Returns
-------
epoch : `astropy.time.Time`
    The date to use for proper motion corrections.

Definition at line 887 of file jointcal.py.

◆ _do_load_refcat_and_fit()

lsst.jointcal.jointcal.JointcalTask._do_load_refcat_and_fit ( self,
associations,
defaultFilter,
center,
radius,
tract = "",
match_cut = 3.0,
reject_bad_fluxes = False,
* name = "",
refObjLoader = None,
referenceSelector = None,
fit_function = None,
epoch = None )
protected
Load reference catalog, perform the fit, and return the result.

Parameters
----------
associations : `lsst.jointcal.Associations`
    The star/reference star associations to fit.
defaultFilter : `lsst.afw.image.FilterLabel`
    filter to load from reference catalog.
center : `lsst.geom.SpherePoint`
    ICRS center of field to load from reference catalog.
radius : `lsst.geom.Angle`
    On-sky radius to load from reference catalog.
name : `str`
    Name of thing being fit: "astrometry" or "photometry".
refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader`
    Reference object loader to use to load a reference catalog.
referenceSelector : `lsst.meas.algorithms.ReferenceSourceSelectorTask`
    Selector to use to pick objects from the loaded reference catalog.
fit_function : callable
    Function to call to perform fit (takes Associations object).
tract : `str`, optional
    Name of tract currently being fit.
match_cut : `float`, optional
    Radius in arcseconds to find cross-catalog matches to during
    associations.associateCatalogs.
reject_bad_fluxes : `bool`, optional
    Reject refCat sources with NaN/inf flux or NaN/0 fluxErr.
epoch : `astropy.time.Time`, optional
    Epoch to which to correct refcat proper motion and parallax,
    or `None` to not apply such corrections.

Returns
-------
result : `Photometry` or `Astrometry`
    Result of `fit_function()`

Definition at line 904 of file jointcal.py.

◆ _fit_astrometry()

lsst.jointcal.jointcal.JointcalTask._fit_astrometry ( self,
associations,
dataName = None )
protected
Fit the astrometric data.

Parameters
----------
associations : `lsst.jointcal.Associations`
    The star/reference star associations to fit.
dataName : `str`
    Name of the data being processed (e.g. "1234_HSC-Y"), for
    identifying debugging files.

Returns
-------
fit_result : `namedtuple`
    fit : `lsst.jointcal.AstrometryFit`
        The astrometric fitter used to perform the fit.
    model : `lsst.jointcal.AstrometryModel`
        The astrometric model that was fit.
    sky_to_tan_projection : `lsst.jointcal.ProjectionHandler`
        The model for the sky to tangent plane projection that was used in the fit.

Definition at line 1205 of file jointcal.py.

◆ _fit_photometry()

lsst.jointcal.jointcal.JointcalTask._fit_photometry ( self,
associations,
dataName = None )
protected
Fit the photometric data.

Parameters
----------
associations : `lsst.jointcal.Associations`
    The star/reference star associations to fit.
dataName : `str`
    Name of the data being processed (e.g. "1234_HSC-Y"), for
    identifying debugging files.

Returns
-------
fit_result : `namedtuple`
    fit : `lsst.jointcal.PhotometryFit`
        The photometric fitter used to perform the fit.
    model : `lsst.jointcal.PhotometryModel`
        The photometric model that was fit.

Definition at line 1099 of file jointcal.py.

◆ _get_refcat_coordinate_error_override()

lsst.jointcal.jointcal.JointcalTask._get_refcat_coordinate_error_override ( self,
refCat,
name )
protected
Check whether we should override the refcat coordinate errors, and
return the overridden error if necessary.

Parameters
----------
refCat : `lsst.afw.table.SimpleCatalog`
    The reference catalog to check for a ``coord_raErr`` field.
name : `str`
    Whether we are doing "astrometry" or "photometry".

Returns
-------
refCoordErr : `float`
    The refcat coordinate error to use, or NaN if we are not overriding
    those fields.

Raises
------
lsst.pex.config.FieldValidationError
    Raised if the refcat does not contain coordinate errors and
    ``config.astrometryReferenceErr`` is not set.

Definition at line 840 of file jointcal.py.

◆ _getDebugPath()

lsst.jointcal.jointcal.JointcalTask._getDebugPath ( self,
filename )
protected
Constructs a path to filename using the configured debug path.

Definition at line 813 of file jointcal.py.

◆ _iterate_fit()

lsst.jointcal.jointcal.JointcalTask._iterate_fit ( self,
associations,
fitter,
max_steps,
name,
whatToFit,
dataName = "",
sigmaRelativeTolerance = 0,
doRankUpdate = True,
doLineSearch = False )
protected
Run fitter.minimize up to max_steps times, returning the final chi2.

Parameters
----------
associations : `lsst.jointcal.Associations`
    The star/reference star associations to fit.
fitter : `lsst.jointcal.FitterBase`
    The fitter to use for minimization.
max_steps : `int`
    Maximum number of steps to run outlier rejection before declaring
    convergence failure.
name : {'photometry' or 'astrometry'}
    What type of data are we fitting (for logs and debugging files).
whatToFit : `str`
    Passed to ``fitter.minimize()`` to define the parameters to fit.
dataName : `str`, optional
    Descriptive name for this dataset (e.g. tract and filter),
    for debugging.
sigmaRelativeTolerance : `float`, optional
    Convergence tolerance for the fractional change in the chi2 cut
    level for determining outliers. If set to zero, iterations will
    continue until there are no outliers.
doRankUpdate : `bool`, optional
    Do an Eigen rank update during minimization, or recompute the full
    matrix and gradient?
doLineSearch : `bool`, optional
    Do a line search for the optimum step during minimization?

Returns
-------
chi2: `lsst.jointcal.Chi2Statistic`
    The final chi2 after the fit converges, or is forced to end.

Raises
------
FloatingPointError
    Raised if the fitter fails with a non-finite value.
RuntimeError
    Raised if the fitter fails for some other reason;
    log messages will provide further details.

Definition at line 1318 of file jointcal.py.

◆ _load_data()

lsst.jointcal.jointcal.JointcalTask._load_data ( self,
inputSourceTableVisit,
inputVisitSummary,
associations,
jointcalControl,
camera )
protected
Read the data that jointcal needs to run.

Modifies ``associations`` in-place with the loaded data.

Parameters
----------
inputSourceTableVisit : `list` [`lsst.daf.butler.DeferredDatasetHandle`]
    References to visit-level DataFrames to load the catalog data from.
inputVisitSummary : `list` [`lsst.daf.butler.DeferredDatasetHandle`]
    Visit-level exposure summary catalog with metadata.
associations : `lsst.jointcal.Associations`
    Object to add the loaded data to by constructing new CcdImages.
jointcalControl : `jointcal.JointcalControl`
    Control object for C++ associations management.
camera : `lsst.afw.cameraGeom.Camera`
    Camera object for detector geometry.

Returns
-------
oldWcsList: `list` [`lsst.afw.geom.SkyWcs`]
    The original WCS of the input data, to aid in writing tests.
bands : `list` [`str`]
    The filter bands of each input dataset.

Definition at line 677 of file jointcal.py.

◆ _load_reference_catalog()

lsst.jointcal.jointcal.JointcalTask._load_reference_catalog ( self,
refObjLoader,
referenceSelector,
center,
radius,
filterLabel,
applyColorterms = False,
epoch = None )
protected
Load the necessary reference catalog sources, convert fluxes to
correct units, and apply color term corrections if requested.

Parameters
----------
refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader`
    The reference catalog loader to use to get the data.
referenceSelector : `lsst.meas.algorithms.ReferenceSourceSelectorTask`
    Source selector to apply to loaded reference catalog.
center : `lsst.geom.SpherePoint`
    The center around which to load sources.
radius : `lsst.geom.Angle`
    The radius around ``center`` to load sources in.
filterLabel : `lsst.afw.image.FilterLabel`
    The camera filter to load fluxes for.
applyColorterms : `bool`
    Apply colorterm corrections to the refcat for ``filterName``?
epoch : `astropy.time.Time`, optional
    Epoch to which to correct refcat proper motion and parallax,
    or `None` to not apply such corrections.

Returns
-------
refCat : `lsst.afw.table.SimpleCatalog`
    The loaded reference catalog.
fluxField : `str`
    The name of the reference catalog flux field appropriate for ``filterName``.

Definition at line 990 of file jointcal.py.

◆ _logChi2AndValidate()

lsst.jointcal.jointcal.JointcalTask._logChi2AndValidate ( self,
associations,
fit,
model,
chi2Label,
writeChi2Name = None )
protected
Compute chi2, log it, validate the model, and return chi2.

Parameters
----------
associations : `lsst.jointcal.Associations`
    The star/reference star associations to fit.
fit : `lsst.jointcal.FitterBase`
    The fitter to use for minimization.
model : `lsst.jointcal.Model`
    The model being fit.
chi2Label : `str`
    Label to describe the chi2 (e.g. "Initialized", "Final").
writeChi2Name : `str`, optional
    Filename prefix to write the chi2 contributions to.
    Do not supply an extension: an appropriate one will be added.

Returns
-------
chi2: `lsst.jointcal.Chi2Accumulator`
    The chi2 object for the current fitter and model.

Raises
------
FloatingPointError
    Raised if chi2 is infinite or NaN.
ValueError
    Raised if the model is not valid.

Definition at line 1056 of file jointcal.py.

◆ _make_one_input_data()

lsst.jointcal.jointcal.JointcalTask._make_one_input_data ( self,
visitRecord,
catalog,
detectorDict )
protected
Return a data structure for this detector+visit.

Definition at line 754 of file jointcal.py.

◆ _make_output()

lsst.jointcal.jointcal.JointcalTask._make_output ( self,
ccdImageList,
model,
func )
protected
Return the internal jointcal models converted to the afw
structures that will be saved to disk.

Parameters
----------
ccdImageList : `lsst.jointcal.CcdImageList`
    The list of CcdImages to get the output for.
model : `lsst.jointcal.AstrometryModel` or `lsst.jointcal.PhotometryModel`
    The internal jointcal model to convert for each `lsst.jointcal.CcdImage`.
func : `str`
    The name of the function to call on ``model`` to get the converted
    structure. Must accept an `lsst.jointcal.CcdImage`.

Returns
-------
output : `dict` [`tuple`, `lsst.jointcal.AstrometryModel`] or
         `dict` [`tuple`, `lsst.jointcal.PhotometryModel`]
    The data to be saved, keyed on (visit, detector).

Definition at line 1432 of file jointcal.py.

◆ _prep_sky()

lsst.jointcal.jointcal.JointcalTask._prep_sky ( self,
associations,
filters )
protected
Prepare on-sky and other data that must be computed after data has
been read.

Definition at line 818 of file jointcal.py.

◆ _put_metrics()

lsst.jointcal.jointcal.JointcalTask._put_metrics ( self,
butlerQC,
job,
outputRefs )
protected
Persist all measured metrics stored in a job.

Parameters
----------
butlerQC : `lsst.pipe.base.QuantumContext`
    A butler which is specialized to operate in the context of a
    `lsst.daf.butler.Quantum`; This is the input to `runQuantum`.
job : `lsst.verify.job.Job`
    Measurements of metrics to persist.
outputRefs : `list` [`lsst.pipe.base.OutputQuantizedConnection`]
    The DatasetRefs to persist the data to.

Definition at line 549 of file jointcal.py.

◆ _put_output()

lsst.jointcal.jointcal.JointcalTask._put_output ( self,
butlerQC,
outputs,
outputRefs,
camera,
setter )
protected
Persist the output datasets to their appropriate datarefs.

Parameters
----------
butlerQC : `lsst.pipe.base.QuantumContext`
    A butler which is specialized to operate in the context of a
    `lsst.daf.butler.Quantum`; This is the input to `runQuantum`.
outputs : `dict` [`tuple`, `lsst.afw.geom.SkyWcs`] or
          `dict` [`tuple, `lsst.afw.image.PhotoCalib`]
    The fitted objects to persist.
outputRefs : `list` [`lsst.pipe.base.OutputQuantizedConnection`]
    The DatasetRefs to persist the data to.
camera : `lsst.afw.cameraGeom.Camera`
    The camera for this instrument, to get detector ids from.
setter : `str`
    The method to call on the ExposureCatalog to set each output.

Definition at line 565 of file jointcal.py.

◆ run()

lsst.jointcal.jointcal.JointcalTask.run ( self,
inputSourceTableVisit,
inputVisitSummary,
inputCamera,
tract = None )

Definition at line 624 of file jointcal.py.

◆ runQuantum()

lsst.jointcal.jointcal.JointcalTask.runQuantum ( self,
butlerQC,
inputRefs,
outputRefs )

Definition at line 518 of file jointcal.py.

Member Data Documentation

◆ _DefaultName

str lsst.jointcal.jointcal.JointcalTask._DefaultName = "jointcal"
staticprotected

Definition at line 501 of file jointcal.py.

◆ astrometryRefObjLoader

lsst.jointcal.jointcal.JointcalTask.astrometryRefObjLoader

Definition at line 509 of file jointcal.py.

◆ config

lsst.jointcal.jointcal.JointcalTask.config

Definition at line 721 of file jointcal.py.

◆ ConfigClass

lsst.jointcal.jointcal.JointcalTask.ConfigClass = JointcalConfig
static

Definition at line 500 of file jointcal.py.

◆ focalPlaneBBox

lsst.jointcal.jointcal.JointcalTask.focalPlaneBBox

Definition at line 633 of file jointcal.py.

◆ job

lsst.jointcal.jointcal.JointcalTask.job

Definition at line 516 of file jointcal.py.

◆ log

lsst.jointcal.jointcal.JointcalTask.log

Definition at line 739 of file jointcal.py.

◆ photometryRefObjLoader

lsst.jointcal.jointcal.JointcalTask.photometryRefObjLoader

Definition at line 513 of file jointcal.py.

◆ sourceSelector

lsst.jointcal.jointcal.JointcalTask.sourceSelector

Definition at line 722 of file jointcal.py.


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