LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions | Variables
lsst.jointcal.jointcal Namespace Reference

Classes

class  JointcalRunner
 
class  JointcalTaskConnections
 
class  JointcalConfig
 
class  JointcalInputData
 
class  JointcalTask
 

Functions

def add_measurement (job, name, value)
 
def lookupStaticCalibrations (datasetType, registry, quantumDataId, collections)
 
def lookupVisitRefCats (datasetType, registry, quantumDataId, collections)
 
def writeModel (model, filename, log)
 

Variables

 Photometry = collections.namedtuple('Photometry', ('fit', 'model'))
 
 Astrometry = collections.namedtuple('Astrometry', ('fit', 'model', 'sky_to_tan_projection'))
 

Function Documentation

◆ add_measurement()

def lsst.jointcal.jointcal.add_measurement (   job,
  name,
  value 
)

Definition at line 60 of file jointcal.py.

60 def add_measurement(job, name, value):
61  meas = Measurement(job.metrics[name], value)
62  job.measurements.insert(meas)
63 
64 
def add_measurement(job, name, value)
Definition: jointcal.py:60

◆ lookupStaticCalibrations()

def lsst.jointcal.jointcal.lookupStaticCalibrations (   datasetType,
  registry,
  quantumDataId,
  collections 
)
Lookup function that asserts/hopes that a static calibration dataset
exists in a particular collection, since this task can't provide a single
date/time to use to search for one properly.

This is mostly useful for the ``camera`` dataset, in cases where the task's
quantum dimensions do *not* include something temporal, like ``exposure``
or ``visit``.

Parameters
----------
datasetType : `lsst.daf.butler.DatasetType`
    Type of dataset being searched for.
registry : `lsst.daf.butler.Registry`
    Data repository registry to search.
quantumDataId : `lsst.daf.butler.DataCoordinate`
    Data ID of the quantum this camera should match.
collections : `Iterable` [ `str` ]
    Collections that should be searched - but this lookup function works
    by ignoring this in favor of a more-or-less hard-coded value.

Returns
-------
refs : `Iterator` [ `lsst.daf.butler.DatasetRef` ]
    Iterator over dataset references; should have only one element.

Notes
-----
This implementation duplicates one in fgcmcal, and is at least quite
similar to another in cp_pipe.  This duplicate has the most documentation.
Fixing this is DM-29661.

Definition at line 142 of file jointcal.py.

142 def lookupStaticCalibrations(datasetType, registry, quantumDataId, collections):
143  """Lookup function that asserts/hopes that a static calibration dataset
144  exists in a particular collection, since this task can't provide a single
145  date/time to use to search for one properly.
146 
147  This is mostly useful for the ``camera`` dataset, in cases where the task's
148  quantum dimensions do *not* include something temporal, like ``exposure``
149  or ``visit``.
150 
151  Parameters
152  ----------
153  datasetType : `lsst.daf.butler.DatasetType`
154  Type of dataset being searched for.
155  registry : `lsst.daf.butler.Registry`
156  Data repository registry to search.
157  quantumDataId : `lsst.daf.butler.DataCoordinate`
158  Data ID of the quantum this camera should match.
159  collections : `Iterable` [ `str` ]
160  Collections that should be searched - but this lookup function works
161  by ignoring this in favor of a more-or-less hard-coded value.
162 
163  Returns
164  -------
165  refs : `Iterator` [ `lsst.daf.butler.DatasetRef` ]
166  Iterator over dataset references; should have only one element.
167 
168  Notes
169  -----
170  This implementation duplicates one in fgcmcal, and is at least quite
171  similar to another in cp_pipe. This duplicate has the most documentation.
172  Fixing this is DM-29661.
173  """
174  instrument = Instrument.fromName(quantumDataId["instrument"], registry)
175  unboundedCollection = instrument.makeUnboundedCalibrationRunName()
176  return registry.queryDatasets(datasetType,
177  dataId=quantumDataId,
178  collections=[unboundedCollection],
179  findFirst=True)
180 
181 
def lookupStaticCalibrations(datasetType, registry, quantumDataId, collections)
Definition: jointcal.py:142

◆ lookupVisitRefCats()

def lsst.jointcal.jointcal.lookupVisitRefCats (   datasetType,
  registry,
  quantumDataId,
  collections 
)
Lookup function that finds all refcats for all visits that overlap a
tract, rather than just the refcats that directly overlap the tract.

Parameters
----------
datasetType : `lsst.daf.butler.DatasetType`
    Type of dataset being searched for.
registry : `lsst.daf.butler.Registry`
    Data repository registry to search.
quantumDataId : `lsst.daf.butler.DataCoordinate`
    Data ID of the quantum; expected to be something we can use as a
    constraint to query for overlapping visits.
collections : `Iterable` [ `str` ]
    Collections to search.

Returns
-------
refs : `Iterator` [ `lsst.daf.butler.DatasetRef` ]
    Iterator over refcat references.

Definition at line 182 of file jointcal.py.

182 def lookupVisitRefCats(datasetType, registry, quantumDataId, collections):
183  """Lookup function that finds all refcats for all visits that overlap a
184  tract, rather than just the refcats that directly overlap the tract.
185 
186  Parameters
187  ----------
188  datasetType : `lsst.daf.butler.DatasetType`
189  Type of dataset being searched for.
190  registry : `lsst.daf.butler.Registry`
191  Data repository registry to search.
192  quantumDataId : `lsst.daf.butler.DataCoordinate`
193  Data ID of the quantum; expected to be something we can use as a
194  constraint to query for overlapping visits.
195  collections : `Iterable` [ `str` ]
196  Collections to search.
197 
198  Returns
199  -------
200  refs : `Iterator` [ `lsst.daf.butler.DatasetRef` ]
201  Iterator over refcat references.
202  """
203  refs = set()
204  # Use .expanded() on the query methods below because we need data IDs with
205  # regions, both in the outer loop over visits (queryDatasets will expand
206  # any data ID we give it, but doing it up-front in bulk is much more
207  # efficient) and in the data IDs of the DatasetRefs this function yields
208  # (because the RefCatLoader relies on them to do some of its own
209  # filtering).
210  for visit_data_id in set(registry.queryDataIds("visit", dataId=quantumDataId).expanded()):
211  refs.update(
212  registry.queryDatasets(
213  datasetType,
214  collections=collections,
215  dataId=visit_data_id,
216  findFirst=True,
217  ).expanded()
218  )
219  yield from refs
220 
221 
daf::base::PropertySet * set
Definition: fits.cc:912
def lookupVisitRefCats(datasetType, registry, quantumDataId, collections)
Definition: jointcal.py:182

◆ writeModel()

def lsst.jointcal.jointcal.writeModel (   model,
  filename,
  log 
)
Write model to outfile.

Definition at line 626 of file jointcal.py.

626 def writeModel(model, filename, log):
627  """Write model to outfile."""
628  with open(filename, "w") as file:
629  file.write(repr(model))
630  log.info("Wrote %s to file: %s", model, filename)
631 
632 
633 @dataclasses.dataclass
def writeModel(model, filename, log)
Definition: jointcal.py:626

Variable Documentation

◆ Astrometry

lsst.jointcal.jointcal.Astrometry = collections.namedtuple('Astrometry', ('fit', 'model', 'sky_to_tan_projection'))

Definition at line 56 of file jointcal.py.

◆ Photometry

lsst.jointcal.jointcal.Photometry = collections.namedtuple('Photometry', ('fit', 'model'))

Definition at line 55 of file jointcal.py.