LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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: