LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Static Public Attributes | List of all members
lsst.pipe.tasks.extended_psf.StackBrightStarsTask Class Reference
Inheritance diagram for lsst.pipe.tasks.extended_psf.StackBrightStarsTask:

Public Member Functions

def __init__ (self, initInputs=None, *args, **kwargs)
 
def run (self, bss_ref_list, region_name=None)
 

Static Public Attributes

 ConfigClass = StackBrightStarsConfig
 

Detailed Description

Stack bright stars together to build an extended PSF model.

Definition at line 311 of file extended_psf.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.pipe.tasks.extended_psf.StackBrightStarsTask.__init__ (   self,
  initInputs = None,
args,
**  kwargs 
)

Definition at line 317 of file extended_psf.py.

317  def __init__(self, initInputs=None, *args, **kwargs):
318  pipeBase.CmdLineTask.__init__(self, *args, **kwargs)
319 

Member Function Documentation

◆ run()

def lsst.pipe.tasks.extended_psf.StackBrightStarsTask.run (   self,
  bss_ref_list,
  region_name = None 
)
Read input bright star stamps and stack them together.

The stacking is done iteratively over smaller areas of the final model
image to allow for a great number of bright star stamps to be used.

Parameters
----------
bss_ref_list : `list` of
        `lsst.daf.butler._deferredDatasetHandle.DeferredDatasetHandle`
    List of available bright star stamps data references.
region_name : `str`, optional
    Name of the focal plane region, if applicable. Only used for
    logging purposes, when running over multiple such regions
    (typically from `MeasureExtendedPsfTask`)

Definition at line 334 of file extended_psf.py.

334  def run(self, bss_ref_list, region_name=None):
335  """Read input bright star stamps and stack them together.
336 
337  The stacking is done iteratively over smaller areas of the final model
338  image to allow for a great number of bright star stamps to be used.
339 
340  Parameters
341  ----------
342  bss_ref_list : `list` of
343  `lsst.daf.butler._deferredDatasetHandle.DeferredDatasetHandle`
344  List of available bright star stamps data references.
345  region_name : `str`, optional
346  Name of the focal plane region, if applicable. Only used for
347  logging purposes, when running over multiple such regions
348  (typically from `MeasureExtendedPsfTask`)
349  """
350  if region_name:
351  region_message = f' for region "{region_name}".'
352  else:
353  region_message = ''
354  self.log.info('Building extended PSF from stamps extracted from %d detector images%s',
355  len(bss_ref_list), region_message)
356  # read in example set of full stamps
357  example_bss = bss_ref_list[0].get(datasetType="brightStarStamps", immediate=True)
358  example_stamp = example_bss[0].stamp_im
359  # create model image
360  ext_psf = afwImage.MaskedImageF(example_stamp.getBBox())
361  # divide model image into smaller subregions
362  subregion_size = Extent2I(*self.config.subregion_size)
363  sub_bboxes = AssembleCoaddTask._subBBoxIter(ext_psf.getBBox(), subregion_size)
364  # compute approximate number of subregions
365  n_subregions = int(ext_psf.getDimensions()[0]/subregion_size[0] + 1)*int(
366  ext_psf.getDimensions()[1]/subregion_size[1] + 1)
367  self.log.info("Stacking will performed iteratively over approximately %d "
368  "smaller areas of the final model image.", n_subregions)
369  # set up stacking statistic
370  stats_control, stats_flags = self._set_up_stacking(example_stamp)
371  # perform stacking
372  for jbbox, bbox in enumerate(sub_bboxes):
373  all_stars = None
374  for bss_ref in bss_ref_list:
375  read_stars = bss_ref.get(datasetType="brightStarStamps", parameters={'bbox': bbox})
376  if self.config.do_mag_cut:
377  read_stars = read_stars.selectByMag(magMax=self.config.mag_limit)
378  if all_stars:
379  all_stars.extend(read_stars)
380  else:
381  all_stars = read_stars
382  # TODO: DM-27371 add weights to bright stars for stacking
383  coadd_sub_bbox = afwMath.statisticsStack(all_stars.getMaskedImages(), stats_flags, stats_control)
384  ext_psf.assign(coadd_sub_bbox, bbox)
385  return ext_psf
386 
387 
std::shared_ptr< lsst::afw::image::Image< PixelT > > statisticsStack(std::vector< std::shared_ptr< lsst::afw::image::Image< PixelT >>> &images, Property flags, StatisticsControl const &sctrl=StatisticsControl(), std::vector< lsst::afw::image::VariancePixel > const &wvector=std::vector< lsst::afw::image::VariancePixel >(0))
A function to compute some statistics of a stack of Images.
Extent< int, 2 > Extent2I
Definition: Extent.h:397
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

Member Data Documentation

◆ ConfigClass

lsst.pipe.tasks.extended_psf.StackBrightStarsTask.ConfigClass = StackBrightStarsConfig
static

Definition at line 314 of file extended_psf.py.


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