LSST Applications 24.1.5,g02d81e74bb+fa3a7a026e,g180d380827+a53a32eff8,g2079a07aa2+86d27d4dc4,g2305ad1205+c0501b3732,g295015adf3+7d3e92f0ec,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+5dd1654d75,g48712c4677+3bf1020dcb,g487adcacf7+065c13d9cf,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+d7ac436cfb,g5a732f18d5+53520f316c,g64a986408d+fa3a7a026e,g858d7b2824+fa3a7a026e,g8a8a8dda67+585e252eca,g99cad8db69+a5a909b84f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+4cf350ccb2,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+f991a0b59f,gc120e1dc64+9ccbfdb8be,gc28159a63d+0e5473021a,gcf0d15dbbd+5dd1654d75,gd96a1ce819+42fd0ee607,gdaeeff99f8+f9a426f77a,ge6526c86ff+0d71447b4b,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+fa3a7a026e
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.computeExposureSummaryStats.ComputeExposureSummaryStatsTask Class Reference
Inheritance diagram for lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask:

Public Member Functions

 __init__ (self, **kwargs)
 
 run (self, exposure, sources, background)
 
 update_psf_stats (self, summary, psf, bbox, sources=None, image_mask=None, sources_is_astropy=False)
 
 update_wcs_stats (self, summary, wcs, bbox, visitInfo)
 
 update_photo_calib_stats (self, summary, photo_calib)
 
 update_background_stats (self, summary, background)
 
 update_masked_image_stats (self, summary, masked_image)
 
 update_effective_time_stats (self, summary, exposure)
 

Static Public Attributes

 ConfigClass = ComputeExposureSummaryStatsConfig
 

Static Protected Attributes

str _DefaultName = "computeExposureSummaryStats"
 

Detailed Description

Task to compute exposure summary statistics.

This task computes various quantities suitable for DPDD and other
downstream processing at the detector centers, including:
- psfSigma
- psfArea
- psfIxx
- psfIyy
- psfIxy
- ra
- dec
- zenithDistance
- zeroPoint
- skyBg
- skyNoise
- meanVar
- raCorners
- decCorners
- astromOffsetMean
- astromOffsetStd

These additional quantities are computed from the stars in the detector:
- psfStarDeltaE1Median
- psfStarDeltaE2Median
- psfStarDeltaE1Scatter
- psfStarDeltaE2Scatter
- psfStarDeltaSizeMedian
- psfStarDeltaSizeScatter
- psfStarScaledDeltaSizeScatter

These quantities are computed based on the PSF model and image mask
to assess the robustness of the PSF model across a given detector
(against, e.g., extrapolation instability):
- maxDistToNearestPsf
- psfTraceRadiusDelta

These quantities are computed to assess depth:
- effTime
- effTimePsfSigmaScale
- effTimeSkyBgScale
- effTimeZeroPointScale

Definition at line 144 of file computeExposureSummaryStats.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.__init__ ( self,
** kwargs )

Definition at line 190 of file computeExposureSummaryStats.py.

190 def __init__(self, **kwargs):
191 super().__init__(**kwargs)
192
193 self.makeSubtask("starSelector")
194

Member Function Documentation

◆ run()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.run ( self,
exposure,
sources,
background )
Measure exposure statistics from the exposure, sources, and
background.

Parameters
----------
exposure : `lsst.afw.image.ExposureF`
sources : `lsst.afw.table.SourceCatalog`
background : `lsst.afw.math.BackgroundList`

Returns
-------
summary : `lsst.afw.image.ExposureSummary`

Definition at line 196 of file computeExposureSummaryStats.py.

196 def run(self, exposure, sources, background):
197 """Measure exposure statistics from the exposure, sources, and
198 background.
199
200 Parameters
201 ----------
202 exposure : `lsst.afw.image.ExposureF`
203 sources : `lsst.afw.table.SourceCatalog`
204 background : `lsst.afw.math.BackgroundList`
205
206 Returns
207 -------
208 summary : `lsst.afw.image.ExposureSummary`
209 """
210 self.log.info("Measuring exposure statistics")
211
213
214 bbox = exposure.getBBox()
215
216 psf = exposure.getPsf()
217 self.update_psf_stats(summary, psf, bbox, sources, image_mask=exposure.mask)
218
219 wcs = exposure.getWcs()
220 visitInfo = exposure.getInfo().getVisitInfo()
221 self.update_wcs_stats(summary, wcs, bbox, visitInfo)
222
223 photoCalib = exposure.getPhotoCalib()
224 self.update_photo_calib_stats(summary, photoCalib)
225
226 self.update_background_stats(summary, background)
227
228 self.update_masked_image_stats(summary, exposure.getMaskedImage())
229
230 self.update_effective_time_stats(summary, exposure)
231
232 md = exposure.getMetadata()
233 if 'SFM_ASTROM_OFFSET_MEAN' in md:
234 summary.astromOffsetMean = md['SFM_ASTROM_OFFSET_MEAN']
235 summary.astromOffsetStd = md['SFM_ASTROM_OFFSET_STD']
236
237 return summary
238

◆ update_background_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_background_stats ( self,
summary,
background )
Compute summary-statistic fields that depend only on the
background model.

Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
background : `lsst.afw.math.BackgroundList` or `None`
    Background model.  If `None`, all fields that depend on the
    background will be reset (generally to NaN).

Notes
-----
This does not include fields that depend on the background-subtracted
masked image; when the background changes, it should generally be
applied to the image and `update_masked_image_stats` should be called
as well.

Definition at line 450 of file computeExposureSummaryStats.py.

450 def update_background_stats(self, summary, background):
451 """Compute summary-statistic fields that depend only on the
452 background model.
453
454 Parameters
455 ----------
456 summary : `lsst.afw.image.ExposureSummaryStats`
457 Summary object to update in-place.
458 background : `lsst.afw.math.BackgroundList` or `None`
459 Background model. If `None`, all fields that depend on the
460 background will be reset (generally to NaN).
461
462 Notes
463 -----
464 This does not include fields that depend on the background-subtracted
465 masked image; when the background changes, it should generally be
466 applied to the image and `update_masked_image_stats` should be called
467 as well.
468 """
469 if background is not None:
470 bgStats = (bg[0].getStatsImage().getImage().array
471 for bg in background)
472 summary.skyBg = float(sum(np.median(bg[np.isfinite(bg)]) for bg in bgStats))
473 else:
474 summary.skyBg = float("nan")
475

◆ update_effective_time_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_effective_time_stats ( self,
summary,
exposure )
Compute effective exposure time statistics to estimate depth.

The effective exposure time is the equivalent shutter open
time that would be needed under nominal conditions to give the
same signal-to-noise for a point source as what is achieved by
the observation of interest. This metric combines measurements
of the point-spread function, the sky brightness, and the
transparency.

.. _teff_definitions:

The effective exposure time and its subcomponents are defined in [1]_

References
----------

.. [1] Neilsen, E.H., Bernstein, G., Gruendl, R., and Kent, S. (2016).
       Limiting Magnitude, \tau, teff, and Image Quality in DES Year 1
       https://www.osti.gov/biblio/1250877/


Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
exposure : `lsst.afw.image.ExposureF`
    Exposure to grab band and exposure time metadata

Definition at line 508 of file computeExposureSummaryStats.py.

508 def update_effective_time_stats(self, summary, exposure):
509 """Compute effective exposure time statistics to estimate depth.
510
511 The effective exposure time is the equivalent shutter open
512 time that would be needed under nominal conditions to give the
513 same signal-to-noise for a point source as what is achieved by
514 the observation of interest. This metric combines measurements
515 of the point-spread function, the sky brightness, and the
516 transparency.
517
518 .. _teff_definitions:
519
520 The effective exposure time and its subcomponents are defined in [1]_
521
522 References
523 ----------
524
525 .. [1] Neilsen, E.H., Bernstein, G., Gruendl, R., and Kent, S. (2016).
526 Limiting Magnitude, \tau, teff, and Image Quality in DES Year 1
527 https://www.osti.gov/biblio/1250877/
528
529
530 Parameters
531 ----------
532 summary : `lsst.afw.image.ExposureSummaryStats`
533 Summary object to update in-place.
534 exposure : `lsst.afw.image.ExposureF`
535 Exposure to grab band and exposure time metadata
536
537 """
538 self.log.info("Updating effective exposure time")
539
540 nan = float("nan")
541 summary.effTime = nan
542 summary.effTimePsfSigmaScale = nan
543 summary.effTimeSkyBgScale = nan
544 summary.effTimeZeroPointScale = nan
545
546 exposureTime = exposure.getInfo().getVisitInfo().getExposureTime()
547 filterLabel = exposure.getFilter()
548 if (filterLabel is None) or (not filterLabel.hasBandLabel):
549 band = None
550 else:
551 band = filterLabel.bandLabel
552
553 if band is None:
554 self.log.warn("No band associated with exposure; effTime not calculated.")
555 return
556
557 # PSF component
558 if np.isnan(summary.psfSigma):
559 self.log.debug("PSF sigma is NaN")
560 f_eff = nan
561 elif band not in self.config.fiducialPsfSigma:
562 self.log.debug(f"Fiducial PSF value not found for {band}")
563 f_eff = nan
564 else:
565 fiducialPsfSigma = self.config.fiducialPsfSigma[band]
566 f_eff = (summary.psfSigma / fiducialPsfSigma)**-2
567
568 # Transparency component (note that exposure time may be removed from zeropoint)
569 if np.isnan(summary.zeroPoint):
570 self.log.debug("Zero point is NaN")
571 c_eff = nan
572 elif band not in self.config.fiducialZeroPoint:
573 self.log.debug(f"Fiducial zero point value not found for {band}")
574 c_eff = nan
575 else:
576 fiducialZeroPoint = self.config.fiducialZeroPoint[band]
577 zeroPointDiff = fiducialZeroPoint - (summary.zeroPoint - 2.5*np.log10(exposureTime))
578 c_eff = min(10**(-2.0*(zeroPointDiff)/2.5), self.config.maxEffectiveTransparency)
579
580 # Sky brightness component (convert to cts/s)
581 if np.isnan(summary.skyBg):
582 self.log.debug("Sky background is NaN")
583 b_eff = nan
584 elif band not in self.config.fiducialSkyBackground:
585 self.log.debug(f"Fiducial sky background value not found for {band}")
586 b_eff = nan
587 else:
588 fiducialSkyBackground = self.config.fiducialSkyBackground[band]
589 b_eff = fiducialSkyBackground/(summary.skyBg/exposureTime)
590
591 # Effective exposure time scale factor
592 t_eff = f_eff * c_eff * b_eff
593
594 # Effective exposure time (seconds)
595 effectiveTime = t_eff * exposureTime
596
597 # Output quantities
598 summary.effTime = float(effectiveTime)
599 summary.effTimePsfSigmaScale = float(f_eff)
600 summary.effTimeSkyBgScale = float(b_eff)
601 summary.effTimeZeroPointScale = float(c_eff)
602
603
int min

◆ update_masked_image_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_masked_image_stats ( self,
summary,
masked_image )
Compute summary-statistic fields that depend on the masked image
itself.

Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
masked_image : `lsst.afw.image.MaskedImage` or `None`
    Masked image.  If `None`, all fields that depend
    on the masked image will be reset (generally to NaN).

Definition at line 476 of file computeExposureSummaryStats.py.

476 def update_masked_image_stats(self, summary, masked_image):
477 """Compute summary-statistic fields that depend on the masked image
478 itself.
479
480 Parameters
481 ----------
482 summary : `lsst.afw.image.ExposureSummaryStats`
483 Summary object to update in-place.
484 masked_image : `lsst.afw.image.MaskedImage` or `None`
485 Masked image. If `None`, all fields that depend
486 on the masked image will be reset (generally to NaN).
487 """
488 nan = float("nan")
489 if masked_image is None:
490 summary.skyNoise = nan
491 summary.meanVar = nan
492 return
493 statsCtrl = afwMath.StatisticsControl()
494 statsCtrl.setNumSigmaClip(self.config.sigmaClip)
495 statsCtrl.setNumIter(self.config.clipIter)
496 statsCtrl.setAndMask(afwImage.Mask.getPlaneBitMask(self.config.badMaskPlanes))
497 statsCtrl.setNanSafe(True)
498
499 statObj = afwMath.makeStatistics(masked_image, afwMath.STDEVCLIP, statsCtrl)
500 skyNoise, _ = statObj.getResult(afwMath.STDEVCLIP)
501 summary.skyNoise = skyNoise
502
503 statObj = afwMath.makeStatistics(masked_image.variance, masked_image.mask, afwMath.MEANCLIP,
504 statsCtrl)
505 meanVar, _ = statObj.getResult(afwMath.MEANCLIP)
506 summary.meanVar = meanVar
507
Pass parameters to a Statistics object.
Definition Statistics.h:83
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition Statistics.h:361

◆ update_photo_calib_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_photo_calib_stats ( self,
summary,
photo_calib )
Compute all summary-statistic fields that depend on the photometric
calibration model.

Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
photo_calib : `lsst.afw.image.PhotoCalib` or `None`
    Photometric calibration model.  If `None`, all fields that depend
    on the photometric calibration will be reset (generally to NaN).

Definition at line 433 of file computeExposureSummaryStats.py.

433 def update_photo_calib_stats(self, summary, photo_calib):
434 """Compute all summary-statistic fields that depend on the photometric
435 calibration model.
436
437 Parameters
438 ----------
439 summary : `lsst.afw.image.ExposureSummaryStats`
440 Summary object to update in-place.
441 photo_calib : `lsst.afw.image.PhotoCalib` or `None`
442 Photometric calibration model. If `None`, all fields that depend
443 on the photometric calibration will be reset (generally to NaN).
444 """
445 if photo_calib is not None:
446 summary.zeroPoint = float(2.5*np.log10(photo_calib.getInstFluxAtZeroMagnitude()))
447 else:
448 summary.zeroPoint = float("nan")
449

◆ update_psf_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_psf_stats ( self,
summary,
psf,
bbox,
sources = None,
image_mask = None,
sources_is_astropy = False )
Compute all summary-statistic fields that depend on the PSF model.

Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
psf : `lsst.afw.detection.Psf` or `None`
    Point spread function model.  If `None`, all fields that depend on
    the PSF will be reset (generally to NaN).
bbox : `lsst.geom.Box2I`
    Bounding box of the image for which summary stats are being
    computed.
sources : `lsst.afw.table.SourceCatalog` or `astropy.table.Table`
    Catalog for quantities that are computed from source table columns.
    If `None`, these quantities will be reset (generally to NaN).
    The type of this table must correspond to the
    ``sources_is_astropy`` argument.
image_mask : `lsst.afw.image.Mask`, optional
    Mask image that may be used to compute distance-to-nearest-star
    metrics.
sources_is_astropy : `bool`, optional
    Whether ``sources`` is an `astropy.table.Table` instance instead
    of an `lsst.afw.table.Catalog` instance.  Default is `False` (the
    latter).

Definition at line 239 of file computeExposureSummaryStats.py.

239 def update_psf_stats(self, summary, psf, bbox, sources=None, image_mask=None, sources_is_astropy=False):
240 """Compute all summary-statistic fields that depend on the PSF model.
241
242 Parameters
243 ----------
244 summary : `lsst.afw.image.ExposureSummaryStats`
245 Summary object to update in-place.
246 psf : `lsst.afw.detection.Psf` or `None`
247 Point spread function model. If `None`, all fields that depend on
248 the PSF will be reset (generally to NaN).
249 bbox : `lsst.geom.Box2I`
250 Bounding box of the image for which summary stats are being
251 computed.
252 sources : `lsst.afw.table.SourceCatalog` or `astropy.table.Table`
253 Catalog for quantities that are computed from source table columns.
254 If `None`, these quantities will be reset (generally to NaN).
255 The type of this table must correspond to the
256 ``sources_is_astropy`` argument.
257 image_mask : `lsst.afw.image.Mask`, optional
258 Mask image that may be used to compute distance-to-nearest-star
259 metrics.
260 sources_is_astropy : `bool`, optional
261 Whether ``sources`` is an `astropy.table.Table` instance instead
262 of an `lsst.afw.table.Catalog` instance. Default is `False` (the
263 latter).
264 """
265 nan = float("nan")
266 summary.psfSigma = nan
267 summary.psfIxx = nan
268 summary.psfIyy = nan
269 summary.psfIxy = nan
270 summary.psfArea = nan
271 summary.nPsfStar = 0
272 summary.psfStarDeltaE1Median = nan
273 summary.psfStarDeltaE2Median = nan
274 summary.psfStarDeltaE1Scatter = nan
275 summary.psfStarDeltaE2Scatter = nan
276 summary.psfStarDeltaSizeMedian = nan
277 summary.psfStarDeltaSizeScatter = nan
278 summary.psfStarScaledDeltaSizeScatter = nan
279 summary.maxDistToNearestPsf = nan
280 summary.psfTraceRadiusDelta = nan
281
282 if psf is None:
283 return
284 shape = psf.computeShape(bbox.getCenter())
285 summary.psfSigma = shape.getDeterminantRadius()
286 summary.psfIxx = shape.getIxx()
287 summary.psfIyy = shape.getIyy()
288 summary.psfIxy = shape.getIxy()
289 im = psf.computeKernelImage(bbox.getCenter())
290 # The calculation of effective psf area is taken from
291 # meas_base/src/PsfFlux.cc#L112. See
292 # https://github.com/lsst/meas_base/blob/
293 # 750bffe6620e565bda731add1509507f5c40c8bb/src/PsfFlux.cc#L112
294 summary.psfArea = float(np.sum(im.array)/np.sum(im.array**2.))
295
296 if image_mask is not None:
297 psfTraceRadiusDelta = psf_trace_radius_delta(
298 image_mask,
299 psf,
300 sampling=self.config.psfGridSampling,
301 bad_mask_bits=self.config.psfBadMaskPlanes
302 )
303 summary.psfTraceRadiusDelta = float(psfTraceRadiusDelta)
304
305 if sources is None:
306 # No sources are available (as in some tests and rare cases where
307 # the selection criteria in finalizeCharacterization lead to no
308 # good sources).
309 return
310
311 # Count the total number of psf stars used (prior to stats selection).
312 nPsfStar = sources[self.config.starSelection].sum()
313 summary.nPsfStar = int(nPsfStar)
314
315 psf_mask = self.starSelector.run(sources).selected
316 nPsfStarsUsedInStats = psf_mask.sum()
317
318 if nPsfStarsUsedInStats == 0:
319 # No stars to measure statistics, so we must return the defaults
320 # of 0 stars and NaN values.
321 return
322
323 if sources_is_astropy:
324 psf_cat = sources[psf_mask]
325 else:
326 psf_cat = sources[psf_mask].copy(deep=True)
327
328 starXX = psf_cat[self.config.starShape + '_xx']
329 starYY = psf_cat[self.config.starShape + '_yy']
330 starXY = psf_cat[self.config.starShape + '_xy']
331 psfXX = psf_cat[self.config.psfShape + '_xx']
332 psfYY = psf_cat[self.config.psfShape + '_yy']
333 psfXY = psf_cat[self.config.psfShape + '_xy']
334
335 # Use the trace radius for the star size.
336 starSize = np.sqrt(starXX/2. + starYY/2.)
337
338 starE1 = (starXX - starYY)/(starXX + starYY)
339 starE2 = 2*starXY/(starXX + starYY)
340 starSizeMedian = np.median(starSize)
341
342 # Use the trace radius for the psf size.
343 psfSize = np.sqrt(psfXX/2. + psfYY/2.)
344 psfE1 = (psfXX - psfYY)/(psfXX + psfYY)
345 psfE2 = 2*psfXY/(psfXX + psfYY)
346
347 psfStarDeltaE1Median = np.median(starE1 - psfE1)
348 psfStarDeltaE1Scatter = sigmaMad(starE1 - psfE1, scale='normal')
349 psfStarDeltaE2Median = np.median(starE2 - psfE2)
350 psfStarDeltaE2Scatter = sigmaMad(starE2 - psfE2, scale='normal')
351
352 psfStarDeltaSizeMedian = np.median(starSize - psfSize)
353 psfStarDeltaSizeScatter = sigmaMad(starSize - psfSize, scale='normal')
354 psfStarScaledDeltaSizeScatter = psfStarDeltaSizeScatter/starSizeMedian
355
356 summary.psfStarDeltaE1Median = float(psfStarDeltaE1Median)
357 summary.psfStarDeltaE2Median = float(psfStarDeltaE2Median)
358 summary.psfStarDeltaE1Scatter = float(psfStarDeltaE1Scatter)
359 summary.psfStarDeltaE2Scatter = float(psfStarDeltaE2Scatter)
360 summary.psfStarDeltaSizeMedian = float(psfStarDeltaSizeMedian)
361 summary.psfStarDeltaSizeScatter = float(psfStarDeltaSizeScatter)
362 summary.psfStarScaledDeltaSizeScatter = float(psfStarScaledDeltaSizeScatter)
363
364 if image_mask is not None:
365 maxDistToNearestPsf = maximum_nearest_psf_distance(
366 image_mask,
367 psf_cat,
368 sampling=self.config.psfSampling,
369 bad_mask_bits=self.config.psfBadMaskPlanes
370 )
371 summary.maxDistToNearestPsf = float(maxDistToNearestPsf)
372

◆ update_wcs_stats()

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.update_wcs_stats ( self,
summary,
wcs,
bbox,
visitInfo )
Compute all summary-statistic fields that depend on the WCS model.

Parameters
----------
summary : `lsst.afw.image.ExposureSummaryStats`
    Summary object to update in-place.
wcs : `lsst.afw.geom.SkyWcs` or `None`
    Astrometric calibration model.  If `None`, all fields that depend
    on the WCS will be reset (generally to NaN).
bbox : `lsst.geom.Box2I`
    Bounding box of the image for which summary stats are being
    computed.
visitInfo : `lsst.afw.image.VisitInfo`
    Observation information used in together with ``wcs`` to compute
    the zenith distance.

Definition at line 373 of file computeExposureSummaryStats.py.

373 def update_wcs_stats(self, summary, wcs, bbox, visitInfo):
374 """Compute all summary-statistic fields that depend on the WCS model.
375
376 Parameters
377 ----------
378 summary : `lsst.afw.image.ExposureSummaryStats`
379 Summary object to update in-place.
380 wcs : `lsst.afw.geom.SkyWcs` or `None`
381 Astrometric calibration model. If `None`, all fields that depend
382 on the WCS will be reset (generally to NaN).
383 bbox : `lsst.geom.Box2I`
384 Bounding box of the image for which summary stats are being
385 computed.
386 visitInfo : `lsst.afw.image.VisitInfo`
387 Observation information used in together with ``wcs`` to compute
388 the zenith distance.
389 """
390 nan = float("nan")
391 summary.raCorners = [nan]*4
392 summary.decCorners = [nan]*4
393 summary.ra = nan
394 summary.dec = nan
395 summary.zenithDistance = nan
396
397 if wcs is None:
398 return
399
400 sph_pts = wcs.pixelToSky(geom.Box2D(bbox).getCorners())
401 summary.raCorners = [float(sph.getRa().asDegrees()) for sph in sph_pts]
402 summary.decCorners = [float(sph.getDec().asDegrees()) for sph in sph_pts]
403
404 sph_pt = wcs.pixelToSky(bbox.getCenter())
405 summary.ra = sph_pt.getRa().asDegrees()
406 summary.dec = sph_pt.getDec().asDegrees()
407
408 date = visitInfo.getDate()
409
410 if date.isValid():
411 # We compute the zenithDistance at the center of the detector
412 # rather than use the boresight value available via the visitInfo,
413 # because the zenithDistance may vary significantly over a large
414 # field of view.
415 observatory = visitInfo.getObservatory()
416 loc = EarthLocation(lat=observatory.getLatitude().asDegrees()*units.deg,
417 lon=observatory.getLongitude().asDegrees()*units.deg,
418 height=observatory.getElevation()*units.m)
419 obstime = Time(visitInfo.getDate().get(system=DateTime.MJD),
420 location=loc, format='mjd')
421 coord = SkyCoord(
422 summary.ra*units.degree,
423 summary.dec*units.degree,
424 obstime=obstime,
425 location=loc,
426 )
427 with warnings.catch_warnings():
428 warnings.simplefilter('ignore')
429 altaz = coord.transform_to(AltAz)
430
431 summary.zenithDistance = float(90.0 - altaz.alt.degree)
432
A floating-point coordinate rectangle geometry.
Definition Box.h:413

Member Data Documentation

◆ _DefaultName

str lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask._DefaultName = "computeExposureSummaryStats"
staticprotected

Definition at line 188 of file computeExposureSummaryStats.py.

◆ ConfigClass

lsst.pipe.tasks.computeExposureSummaryStats.ComputeExposureSummaryStatsTask.ConfigClass = ComputeExposureSummaryStatsConfig
static

Definition at line 187 of file computeExposureSummaryStats.py.


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