LSST Applications g0da5cf3356+25b44625d0,g17e5ecfddb+50a5ac4092,g1c76d35bf8+585f0f68a2,g295839609d+8ef6456700,g2e2c1a68ba+cc1f6f037e,g38293774b4+62d12e78cb,g3b44f30a73+2891c76795,g48ccf36440+885b902d19,g4b2f1765b6+0c565e8f25,g5320a0a9f6+bd4bf1dc76,g56364267ca+403c24672b,g56b687f8c9+585f0f68a2,g5c4744a4d9+78cd207961,g5ffd174ac0+bd4bf1dc76,g6075d09f38+3075de592a,g667d525e37+cacede5508,g6f3e93b5a3+da81c812ee,g71f27ac40c+cacede5508,g7212e027e3+eb621d73aa,g774830318a+18d2b9fa6c,g7985c39107+62d12e78cb,g79ca90bc5c+fa2cc03294,g881bdbfe6c+cacede5508,g91fc1fa0cf+82a115f028,g961520b1fb+2534687f64,g96f01af41f+f2060f23b6,g9ca82378b8+cacede5508,g9d27549199+78cd207961,gb065e2a02a+ad48cbcda4,gb1df4690d6+585f0f68a2,gb35d6563ee+62d12e78cb,gbc3249ced9+bd4bf1dc76,gbec6a3398f+bd4bf1dc76,gd01420fc67+bd4bf1dc76,gd59336e7c4+c7bb92e648,gf46e8334de+81c9a61069,gfed783d017+bd4bf1dc76,v25.0.1.rc3
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.fit_multiband.MultibandFitConnections Class Reference
Inheritance diagram for lsst.pipe.tasks.fit_multiband.MultibandFitConnections:
lsst.pipe.tasks.fit_multiband.MultibandFitConfig

Public Member Functions

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

Static Public Attributes

 cat_ref
 
 cats_meas
 
 coadds
 
 cat_output
 
 cat_ref_schema
 
 cat_output_schema
 

Detailed Description

Definition at line 72 of file fit_multiband.py.

Member Function Documentation

◆ adjustQuantum()

def lsst.pipe.tasks.fit_multiband.MultibandFitConnections.adjustQuantum (   self,
  inputs,
  outputs,
  label,
  data_id 
)
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

Member Data Documentation

◆ cat_output

lsst.pipe.tasks.fit_multiband.MultibandFitConnections.cat_output
static
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
static
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
static
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
static
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
static
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
static
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.


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