LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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 59 of file jointcal.py.

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

◆ 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 141 of file jointcal.py.

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

◆ 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 181 of file jointcal.py.

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

◆ writeModel()

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

Definition at line 571 of file jointcal.py.

571 def writeModel(model, filename, log):
572  """Write model to outfile."""
573  with open(filename, "w") as file:
574  file.write(repr(model))
575  log.info("Wrote %s to file: %s", model, filename)
576 
577 
578 @dataclasses.dataclass
def writeModel(model, filename, log)
Definition: jointcal.py:571

Variable Documentation

◆ Astrometry

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

Definition at line 55 of file jointcal.py.

◆ Photometry

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

Definition at line 54 of file jointcal.py.