LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
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, datasetRefMap)
 

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 247 of file fit_multiband.py.

Member Function Documentation

◆ adjustQuantum()

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

Parameters
----------
datasetRefMap : `NamedKeyDict`
    Mapping from dataset type to a `set` of
    `lsst.daf.butler.DatasetRef` objects

Returns
-------
datasetRefMap : `NamedKeyDict`
    Modified mapping of input with possibly adjusted
    `lsst.daf.butler.DatasetRef` objects.

Raises
------
ValueError
    Raised if any of the per-band datasets have an inconsistent band
    set, or if the band set to fit is not a subset of the data bands.

Definition at line 114 of file fit_multiband.py.

114  def adjustQuantum(self, datasetRefMap):
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  datasetRefMap : `NamedKeyDict`
121  Mapping from dataset type to a `set` of
122  `lsst.daf.butler.DatasetRef` objects
123 
124  Returns
125  -------
126  datasetRefMap : `NamedKeyDict`
127  Modified mapping of input with possibly adjusted
128  `lsst.daf.butler.DatasetRef` objects.
129 
130  Raises
131  ------
132  ValueError
133  Raised if any of the per-band datasets have an inconsistent band
134  set, or if the band set to fit is not a subset of the data bands.
135 
136  """
137  datasetRefMap = super().adjustQuantum(datasetRefMap)
138  # Check which bands are going to be fit
139  bands_fit, bands_read_only = self.config.get_band_sets()
140  bands_needed = bands_fit.union(bands_read_only)
141 
142  bands_data = None
143  bands_extra = set()
144 
145  for type_d, ref_d in datasetRefMap.items():
146  # Datasets without bands in their dimensions should be fine
147  if 'band' in type_d.dimensions:
148  bands_set = {dref.dataId['band'] for dref in ref_d}
149  if bands_data is None:
150  bands_data = bands_set
151  if bands_needed != bands_data:
152  if not bands_needed.issubset(bands_data):
153  raise ValueError(
154  f'Datarefs={ref_d} have data with bands in the set={bands_set},'
155  f'which is not a subset of the required bands={bands_needed} defined by '
156  f'{self.config.__class__}.fit_multiband='
157  f'{self.config.fit_multiband._value.__class__}\'s attributes'
158  f' bands_fit={bands_fit} and bands_read_only()={bands_read_only}.'
159  f' Add the required bands={bands_needed.difference(bands_data)}.'
160  )
161  else:
162  bands_extra = bands_data.difference(bands_needed)
163  elif bands_set != bands_data:
164  raise ValueError(
165  f'Datarefs={ref_d} have data with bands in the set={bands_set}'
166  f' which differs from the previous={bands_data}); bandsets must be identical.'
167  )
168  if bands_extra:
169  for dref in ref_d:
170  if dref.dataId['band'] in bands_extra:
171  ref_d.remove(dref)
172  return datasetRefMap
173 
174 
daf::base::PropertySet * set
Definition: fits.cc:912

◆ 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 258 of file fit_multiband.py.

258  def get_band_sets(self):
259  """Get the set of bands required by the fit_multiband subtask.
260 
261  Returns
262  -------
263  bands_fit : `set`
264  The set of bands that the subtask will fit.
265  bands_read_only : `set`
266  The set of bands that the subtask will only read data
267  (measurement catalog and exposure) for.
268  """
269  try:
270  bands_fit = self.fit_multiband.bands_fit
271  except AttributeError:
272  raise RuntimeError(f'{__class__}.fit_multiband must have bands_fit attribute') from None
273  bands_read_only = self.fit_multiband.bands_read_only()
274  return set(bands_fit), set(bands_read_only)
275 
276 

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 253 of file fit_multiband.py.


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