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 | Public Attributes | Static Public Attributes | List of all members
lsst.ip.diffim.imageMapReduce.ImageMapReduceTask Class Reference
Inheritance diagram for lsst.ip.diffim.imageMapReduce.ImageMapReduceTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def run (self, exposure, **kwargs)
 
def plotBoxes (self, fullBBox, skip=3)
 

Public Attributes

 boxes0
 
 boxes1
 

Static Public Attributes

 ConfigClass = ImageMapReduceConfig
 

Detailed Description

Split an Exposure into subExposures (optionally on a grid) and
perform the same operation on each.

Perform 'simple' operations on a gridded set of subExposures of a
larger Exposure, and then (by default) have those subExposures
stitched back together into a new, full-sized image.

Contrary to the expectation given by its name, this task does not
perform these operations in parallel, although it could be updatd
to provide such functionality.

The actual operations are performed by two subTasks passed to the
config. The exposure passed to this task's `run` method will be
divided, and those subExposures will be passed to the subTasks,
along with the original exposure. The reducing operation is
performed by the second subtask.

Definition at line 487 of file imageMapReduce.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.__init__ (   self,
args,
**  kwargs 
)
Create the image map-reduce task

Parameters
----------
args :
    arguments to be passed to
    `lsst.pipe.base.task.Task.__init__`
kwargs :
    additional keyword arguments to be passed to
    `lsst.pipe.base.task.Task.__init__`

Definition at line 508 of file imageMapReduce.py.

508  def __init__(self, *args, **kwargs):
509  """Create the image map-reduce task
510 
511  Parameters
512  ----------
513  args :
514  arguments to be passed to
515  `lsst.pipe.base.task.Task.__init__`
516  kwargs :
517  additional keyword arguments to be passed to
518  `lsst.pipe.base.task.Task.__init__`
519  """
520  pipeBase.Task.__init__(self, *args, **kwargs)
521 
522  self.boxes0 = self.boxes1 = None
523  self.makeSubtask("mapper")
524  self.makeSubtask("reducer")
525 

Member Function Documentation

◆ plotBoxes()

def lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.plotBoxes (   self,
  fullBBox,
  skip = 3 
)
Plot both grids of boxes using matplotlib.

Will compute the grid via `_generateGrid` if
`self.boxes0` and `self.boxes1` have not already been set.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure whose bounding box is gridded by this task.
skip : `int`
    Plot every skip-ped box (help make plots less confusing)

Definition at line 761 of file imageMapReduce.py.

761  def plotBoxes(self, fullBBox, skip=3):
762  """Plot both grids of boxes using matplotlib.
763 
764  Will compute the grid via `_generateGrid` if
765  `self.boxes0` and `self.boxes1` have not already been set.
766 
767  Parameters
768  ----------
769  exposure : `lsst.afw.image.Exposure`
770  Exposure whose bounding box is gridded by this task.
771  skip : `int`
772  Plot every skip-ped box (help make plots less confusing)
773  """
774  import matplotlib.pyplot as plt
775 
776  if self.boxes0 is None:
777  raise RuntimeError('Cannot plot boxes. Run _generateGrid first.')
778  self._plotBoxGrid(self.boxes0[::skip], fullBBox, ls='--')
779  # reset the color cycle -- see
780  # http://stackoverflow.com/questions/24193174/reset-color-cycle-in-matplotlib
781  plt.gca().set_prop_cycle(None)
782  self._plotBoxGrid(self.boxes1[::skip], fullBBox, ls=':')
783 

◆ run()

def lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.run (   self,
  exposure,
**  kwargs 
)
Perform a map-reduce operation on the given exposure.

Split the exposure into sub-expposures on a grid (parameters
given by `ImageMapReduceConfig`) and perform
`config.mapper.run()` on each. Reduce the resulting
sub-exposures by running `config.reducer.run()`.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    the full exposure to process
kwargs :
    additional keyword arguments to be passed to
    subtask `run` methods

Returns
-------
output of `reducer.run()`

Definition at line 527 of file imageMapReduce.py.

527  def run(self, exposure, **kwargs):
528  """Perform a map-reduce operation on the given exposure.
529 
530  Split the exposure into sub-expposures on a grid (parameters
531  given by `ImageMapReduceConfig`) and perform
532  `config.mapper.run()` on each. Reduce the resulting
533  sub-exposures by running `config.reducer.run()`.
534 
535  Parameters
536  ----------
537  exposure : `lsst.afw.image.Exposure`
538  the full exposure to process
539  kwargs :
540  additional keyword arguments to be passed to
541  subtask `run` methods
542 
543  Returns
544  -------
545  output of `reducer.run()`
546 
547  """
548  self.log.info("Mapper sub-task: %s", self.mapper._DefaultName)
549  mapperResults = self._runMapper(exposure, **kwargs)
550  self.log.info("Reducer sub-task: %s", self.reducer._DefaultName)
551  result = self._reduceImage(mapperResults, exposure, **kwargs)
552  return result
553 
def run(self, coaddExposures, bbox, wcs)
Definition: getTemplate.py:603

Member Data Documentation

◆ boxes0

lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.boxes0

Definition at line 522 of file imageMapReduce.py.

◆ boxes1

lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.boxes1

Definition at line 522 of file imageMapReduce.py.

◆ ConfigClass

lsst.ip.diffim.imageMapReduce.ImageMapReduceTask.ConfigClass = ImageMapReduceConfig
static

Definition at line 505 of file imageMapReduce.py.


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