LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask Class Reference
Inheritance diagram for lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask:
lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 run (self, exposure, dataRef)
 
 computeImageScaler (self, exposure, dataRef)
 

Static Public Attributes

 ConfigClass = SpatialScaleZeroPointConfig
 

Static Protected Attributes

str _DefaultName = "scaleZeroPoint"
 

Detailed Description

Compute spatially varying scale factor to scale exposures to a desired photometric zero point.

Definition at line 274 of file scaleZeroPoint.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.__init__ ( self,
* args,
** kwargs )

Reimplemented from lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.

Definition at line 281 of file scaleZeroPoint.py.

281 def __init__(self, *args, **kwargs):
282 ScaleZeroPointTask.__init__(self, *args, **kwargs)
283 self.makeSubtask("selectFluxMag0")
284

Member Function Documentation

◆ computeImageScaler()

lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.computeImageScaler ( self,
exposure,
dataRef )
Compute image scaling object for a given exposure.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure for which scaling is desired. Only wcs and bbox are used.
dataRef : `Unknown`
    Data reference of exposure.
    dataRef.dataId used to retrieve all applicable fluxMag0's from a database.

Returns
-------
result : `SpatialImageScaler`

Reimplemented from lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.

Definition at line 310 of file scaleZeroPoint.py.

310 def computeImageScaler(self, exposure, dataRef):
311 """Compute image scaling object for a given exposure.
312
313 Parameters
314 ----------
315 exposure : `lsst.afw.image.Exposure`
316 Exposure for which scaling is desired. Only wcs and bbox are used.
317 dataRef : `Unknown`
318 Data reference of exposure.
319 dataRef.dataId used to retrieve all applicable fluxMag0's from a database.
320
321 Returns
322 -------
323 result : `SpatialImageScaler`
324 """
325 wcs = exposure.getWcs()
326
327 fluxMagInfoList = self.selectFluxMag0.run(dataRef.dataId).fluxMagInfoList
328
329 xList = []
330 yList = []
331 scaleList = []
332
333 for fluxMagInfo in fluxMagInfoList:
334 # find center of field in tract coordinates
335 if not fluxMagInfo.coordList:
336 raise RuntimeError("no x,y data for fluxMagInfo")
337 ctr = geom.Extent2D()
338 for coord in fluxMagInfo.coordList:
339 # accumulate x, y
340 ctr += geom.Extent2D(wcs.skyToPixel(coord))
341 # and find average x, y as the center of the chip
342 ctr = geom.Point2D(ctr / len(fluxMagInfo.coordList))
343 xList.append(ctr.getX())
344 yList.append(ctr.getY())
345 scaleList.append(self.scaleFromFluxMag0(fluxMagInfo.fluxMag0).scale)
346
347 self.log.info("Found %d flux scales for interpolation: %s",
348 len(scaleList), [f"{s:%0.4f}" for s in scaleList])
349 return SpatialImageScaler(
350 interpStyle=self.config.interpStyle,
351 xList=xList,
352 yList=yList,
353 scaleList=scaleList,
354 )

◆ run()

lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.run ( self,
exposure,
dataRef )
Scale the specified exposure to the desired photometric zeropoint.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure to scale; masked image is scaled in place.
dataRef : `Unknown`
    Data reference for exposure.

Returns
-------
result : `lsst.pipe.base.Struct`
    Results as a struct with attributes:

    ``imageScaler``
        The image scaling object used to scale exposure.

Reimplemented from lsst.pipe.tasks.scaleZeroPoint.ScaleZeroPointTask.

Definition at line 285 of file scaleZeroPoint.py.

285 def run(self, exposure, dataRef):
286 """Scale the specified exposure to the desired photometric zeropoint.
287
288 Parameters
289 ----------
290 exposure : `lsst.afw.image.Exposure`
291 Exposure to scale; masked image is scaled in place.
292 dataRef : `Unknown`
293 Data reference for exposure.
294
295 Returns
296 -------
297 result : `lsst.pipe.base.Struct`
298 Results as a struct with attributes:
299
300 ``imageScaler``
301 The image scaling object used to scale exposure.
302 """
303 imageScaler = self.computeImageScaler(exposure=exposure, dataRef=dataRef)
304 mi = exposure.getMaskedImage()
305 imageScaler.scaleMaskedImage(mi)
306 return pipeBase.Struct(
307 imageScaler=imageScaler,
308 )
309

Member Data Documentation

◆ _DefaultName

str lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask._DefaultName = "scaleZeroPoint"
staticprotected

Definition at line 279 of file scaleZeroPoint.py.

◆ ConfigClass

lsst.pipe.tasks.scaleZeroPoint.SpatialScaleZeroPointTask.ConfigClass = SpatialScaleZeroPointConfig
static

Definition at line 278 of file scaleZeroPoint.py.


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