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
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.fit_multiband.MultibandFitConfig Class Reference
Inheritance diagram for lsst.pipe.tasks.fit_multiband.MultibandFitConfig:
lsst.pipe.tasks.fit_multiband.MultibandFitConnections

Public Member Functions

def get_band_sets (self)
 
def adjustQuantum (self, inputs, outputs, label, data_id)
 

Static Public Attributes

 fit_multiband
 
 cat_ref
 
 cats_meas
 
 coadds
 
 cat_output
 
 cat_ref_schema
 
 cat_output_schema
 

Detailed Description

Configure a MultibandFitTask, including a configurable fitting subtask.

Definition at line 259 of file fit_multiband.py.

Member Function Documentation

◆ adjustQuantum()

def lsst.pipe.tasks.fit_multiband.MultibandFitConnections.adjustQuantum (   self,
  inputs,
  outputs,
  label,
  data_id 
)
inherited
Validates the `lsst.daf.butler.DatasetRef` bands against the
subtask's list of bands to fit and drops unnecessary bands.

Parameters
----------
inputs : `dict`
    Dictionary whose keys are an input (regular or prerequisite)
    connection name and whose values are a tuple of the connection
    instance and a collection of associated `DatasetRef` objects.
    The exact type of the nested collections is unspecified; it can be
    assumed to be multi-pass iterable and support `len` and ``in``, but
    it should not be mutated in place.  In contrast, the outer
    dictionaries are guaranteed to be temporary copies that are true
    `dict` instances, and hence may be modified and even returned; this
    is especially useful for delegating to `super` (see notes below).
outputs : `Mapping`
    Mapping of output datasets, with the same structure as ``inputs``.
label : `str`
    Label for this task in the pipeline (should be used in all
    diagnostic messages).
data_id : `lsst.daf.butler.DataCoordinate`
    Data ID for this quantum in the pipeline (should be used in all
    diagnostic messages).

Returns
-------
adjusted_inputs : `Mapping`
    Mapping of the same form as ``inputs`` with updated containers of
    input `DatasetRef` objects.  All inputs involving the 'band'
    dimension are adjusted to put them in consistent order and remove
    unneeded bands.
adjusted_outputs : `Mapping`
    Mapping of updated output datasets; always empty for this task.

Raises
------
lsst.pipe.base.NoWorkFound
    Raised if there are not enough of the right bands to run the task
    on this quantum.

Definition at line 114 of file fit_multiband.py.

114  def adjustQuantum(self, inputs, outputs, label, data_id):
115  """Validates the `lsst.daf.butler.DatasetRef` bands against the
116  subtask's list of bands to fit and drops unnecessary bands.
117 
118  Parameters
119  ----------
120  inputs : `dict`
121  Dictionary whose keys are an input (regular or prerequisite)
122  connection name and whose values are a tuple of the connection
123  instance and a collection of associated `DatasetRef` objects.
124  The exact type of the nested collections is unspecified; it can be
125  assumed to be multi-pass iterable and support `len` and ``in``, but
126  it should not be mutated in place. In contrast, the outer
127  dictionaries are guaranteed to be temporary copies that are true
128  `dict` instances, and hence may be modified and even returned; this
129  is especially useful for delegating to `super` (see notes below).
130  outputs : `Mapping`
131  Mapping of output datasets, with the same structure as ``inputs``.
132  label : `str`
133  Label for this task in the pipeline (should be used in all
134  diagnostic messages).
135  data_id : `lsst.daf.butler.DataCoordinate`
136  Data ID for this quantum in the pipeline (should be used in all
137  diagnostic messages).
138 
139  Returns
140  -------
141  adjusted_inputs : `Mapping`
142  Mapping of the same form as ``inputs`` with updated containers of
143  input `DatasetRef` objects. All inputs involving the 'band'
144  dimension are adjusted to put them in consistent order and remove
145  unneeded bands.
146  adjusted_outputs : `Mapping`
147  Mapping of updated output datasets; always empty for this task.
148 
149  Raises
150  ------
151  lsst.pipe.base.NoWorkFound
152  Raised if there are not enough of the right bands to run the task
153  on this quantum.
154  """
155  # Check which bands are going to be fit
156  bands_fit, bands_read_only = self.config.get_band_sets()
157  bands_needed = bands_fit.union(bands_read_only)
158 
159  adjusted_inputs = {}
160  for connection_name, (connection, dataset_refs) in inputs.items():
161  # Datasets without bands in their dimensions should be fine
162  if 'band' in connection.dimensions:
163  datasets_by_band = {dref.dataId['band']: dref for dref in dataset_refs}
164  if not bands_needed.issubset(datasets_by_band.keys()):
165  raise pipeBase.NoWorkFound(
166  f'DatasetRefs={dataset_refs} have data with bands in the'
167  f' set={set(datasets_by_band.keys())},'
168  f' which is not a superset of the required bands={bands_needed} defined by'
169  f' {self.config.__class__}.fit_multiband='
170  f'{self.config.fit_multiband._value.__class__}\'s attributes'
171  f' bands_fit={bands_fit} and bands_read_only()={bands_read_only}.'
172  f' Add the required bands={bands_needed.difference(datasets_by_band.keys())}.'
173  )
174  # Adjust all datasets with band dimensions to include just
175  # the needed bands, in consistent order.
176  adjusted_inputs[connection_name] = (
177  connection,
178  [datasets_by_band[band] for band in bands_needed]
179  )
180 
181  # Delegate to super for more checks.
182  inputs.update(adjusted_inputs)
183  super().adjustQuantum(inputs, outputs, label, data_id)
184  return adjusted_inputs, {}
185 
186 

◆ get_band_sets()

def lsst.pipe.tasks.fit_multiband.MultibandFitConfig.get_band_sets (   self)
Get the set of bands required by the fit_multiband subtask.

Returns
-------
bands_fit : `set`
    The set of bands that the subtask will fit.
bands_read_only : `set`
    The set of bands that the subtask will only read data
    (measurement catalog and exposure) for.

Definition at line 270 of file fit_multiband.py.

270  def get_band_sets(self):
271  """Get the set of bands required by the fit_multiband subtask.
272 
273  Returns
274  -------
275  bands_fit : `set`
276  The set of bands that the subtask will fit.
277  bands_read_only : `set`
278  The set of bands that the subtask will only read data
279  (measurement catalog and exposure) for.
280  """
281  try:
282  bands_fit = self.fit_multiband.bands_fit
283  except AttributeError:
284  raise RuntimeError(f'{__class__}.fit_multiband must have bands_fit attribute') from None
285  bands_read_only = self.fit_multiband.bands_read_only()
286  return set(bands_fit), set(bands_read_only)
287 
288 
daf::base::PropertySet * set
Definition: fits.cc:912

Member Data Documentation

◆ cat_output

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cat_output
staticinherited
Initial value:
= cT.Output(
doc="Measurement multi-band catalog",
name="{name_output_coadd}Coadd_{name_output_cat}",
storageClass="SourceCatalog",
dimensions=("tract", "patch", "skymap"),
)

Definition at line 97 of file fit_multiband.py.

◆ cat_output_schema

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cat_output_schema
staticinherited
Initial value:
= cT.InitOutput(
doc="Output of the schema used in deblending task",
name="{name_output_coadd}Coadd_{name_output_cat}_schema",
storageClass="SourceCatalog"
)

Definition at line 108 of file fit_multiband.py.

◆ cat_ref

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cat_ref
staticinherited
Initial value:
= cT.Input(
doc="Reference multiband source catalog",
name="{name_input_coadd}Coadd_ref",
storageClass="SourceCatalog",
dimensions=("tract", "patch", "skymap"),
)

Definition at line 77 of file fit_multiband.py.

◆ cat_ref_schema

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cat_ref_schema
staticinherited
Initial value:
= cT.InitInput(
doc="Schema associated with a ref source catalog",
storageClass="SourceCatalog",
name="{name_input_coadd}Coadd_ref_schema",
)

Definition at line 103 of file fit_multiband.py.

◆ cats_meas

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cats_meas
staticinherited
Initial value:
= cT.Input(
doc="Deblended single-band source catalogs",
name="{name_input_coadd}Coadd_meas",
storageClass="SourceCatalog",
multiple=True,
dimensions=("tract", "patch", "band", "skymap"),
)

Definition at line 83 of file fit_multiband.py.

◆ coadds

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.coadds
staticinherited
Initial value:
= cT.Input(
doc="Exposures on which to run fits",
name="{name_input_coadd}Coadd_calexp",
storageClass="ExposureF",
multiple=True,
dimensions=("tract", "patch", "band", "skymap"),
)

Definition at line 90 of file fit_multiband.py.

◆ fit_multiband

lsst.pipe.tasks.fit_multiband.MultibandFitConfig.fit_multiband
static
Initial value:
= pexConfig.ConfigurableField(
target=MultibandFitSubTask,
doc="Task to fit sources using multiple bands",
)

Definition at line 265 of file fit_multiband.py.


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