LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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: