Skip to content

Commit

Permalink
Convert block to numpydoc and create new task topic types
Browse files Browse the repository at this point in the history
  • Loading branch information
squisty committed May 21, 2021
1 parent aea1be3 commit d3c39e0
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 180 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. lsst-task-topic:: lsst.meas.algorithms.BasePsfDeterminerTask

#####################
BasePsfDeterminerTask
#####################

``BasePsfDeterminerTask`` is the base class for PSF determiners: override ``determinePsf`` to implement your algorithm, and register your new Task with ``psfDeterminerRegistry`` to allow it to be used in a pipeline.


.. _lsst.meas.algorithms.BasePsfDeterminerTask-api:

Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.BasePsfDeterminerTask

.. _lsst.meas.algorithms.BasePsfDeterminerTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.BasePsfDeterminerTask

.. _lsst.meas.algorithms.BasePsfDeterminerTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.BasePsfDeterminerTask
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. lsst-task-topic:: lsst.meas.algorithms.MakePsfCandidatesTask

#####################
MakePsfCandidatesTask
#####################

``MakePsfCandidatesTask`` creates PSF candidates given an input catalog.

.. _lsst.meas.algorithms.MakePsfCandidatesTask-api:

Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.MakePsfCandidatesTask

.. _lsst.meas.algorithms.MakePsfCandidatesTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.MakePsfCandidatesTask

.. _lsst.meas.algorithms.MakePsfCandidatesTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.MakePsfCandidatesTask

.. _lsst.meas.algorithms.MakePsfCandidatesTask-examples:
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. lsst-task-topic:: lsst.meas.algorithms.MatcherSourceSelectorTask

#########################
MatcherSourceSelectorTask
#########################

``MatcherSourceSelectorTask`` selects sources that are useful for matching, without checking footprints or bad flags.

.. _lsst.meas.algorithms.MatcherSourceSelectorTask-api:

Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.MatcherSourceSelectorTask

.. _lsst.meas.algorithms.MatcherSourceSelectorTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.MatcherSourceSelectorTask

.. _lsst.meas.algorithms.MatcherSourceSelectorTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.MatcherSourceSelectorTask
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. lsst-task-topic:: lsst.meas.algorithms.MeasureApCorrTask

#################
MeasureApCorrTask
#################

``MeasureApCorrTask`` measures aperture correction for the flux fields returned by `lsst.meas.base.getApCorrNameSet`.

.. _lsst.meas.algorithms.MeasureApCorrTask-api:

Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.MeasureApCorrTask

.. _lsst.meas.algorithms.MeasureApCorrTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.MeasureApCorrTask

.. _lsst.meas.algorithms.MeasureApCorrTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.MeasureApCorrTask

.. _lsst.meas.algorithms.MeasureApCorrTask-debug:

Debugging
=========

MeasureApCorrTask has a debug dictionary containing two boolean keys:

doPause
bool; Pause to inspect the residuals plot? If False, there will be a 4 second delay to allow for inspection of the plot before closing it and moving on.

display
bool; if True display debug information
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. lsst-task-topic:: lsst.meas.algorithms.ObjectSizeStarSelectorTask

##########################
ObjectSizeStarSelectorTask
##########################

``ObjectSizeStarSelectorTask`` selects likely stars by looking for a cluster of small objects in a size-magnitude plot.

.. _lsst.meas.algorithms.ObjectSizeStarSelectorTask-api:

Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.ObjectSizeStarSelectorTask

.. _lsst.meas.algorithms.ObjectSizeStarSelectorTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.ObjectSizeStarSelectorTask

.. _lsst.meas.algorithms.ObjectSizeStarSelectorTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.ObjectSizeStarSelectorTask

.. _lsst.meas.algorithms.ObjectSizeStarSelectorTask-debug:

Debugging
=========

ObjectSizeStarSelectorTask has a debug dictionary with the following boolean keys:

display
bool; if True display debug information

displayExpsoure
bool; if True display the exposure and spatial cells

plotMagSize
bool; if True display the magnitude-size relation using matplotlib

dumpData
bool; if True dump data to a pickle file


More information can be found in `lsstDebug`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. lsst-task-topic:: lsst.meas.algorithms.PcaPsfDeterminerTask

####################
PcaPsfDeterminerTask
####################

``PcaPsfDeterminerTask`` estimates PSFs of pre-selected likely stars using a PCA decomposition approach.


Python API summary
==================

.. lsst-task-api-summary:: lsst.meas.algorithms.PcaPsfDeterminerTask

.. _lsst.meas.algorithms.PcaPsfDeterminerTask-subtasks:

Retargetable subtasks
=====================

.. lsst-task-config-subtasks:: lsst.meas.algorithms.PcaPsfDeterminerTask

.. _lsst.meas.algorithms.PcaPsfDeterminerTask-configs:

Configuration fields
====================

.. lsst-task-config-fields:: lsst.meas.algorithms.PcaPsfDeterminerTask
12 changes: 8 additions & 4 deletions python/lsst/meas/algorithms/matcherSourceSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def selectSources(self, sourceCat, matches=None, exposure=None):
return Struct(selected=good)

def _getSchemaKeys(self, schema):
"""Extract and save the necessary keys from schema with asKey."""
"""Extract and save the necessary keys from schema with asKey.
"""
self.parentKey = schema["parent"].asKey()
self.centroidXKey = schema["slot_Centroid_x"].asKey()
self.centroidYKey = schema["slot_Centroid_y"].asKey()
Expand All @@ -111,18 +112,21 @@ def _getSchemaKeys(self, schema):
self.saturatedKey = schema["base_PixelFlags_flag_saturated"].asKey()

def _isParent(self, sourceCat):
"""Return True for each source that is the parent source."""
"""Return True for each source that is the parent source.
"""
test = (sourceCat.get(self.parentKey) == 0)
return test

def _hasCentroid(self, sourceCat):
"""Return True for each source that has a valid centroid"""
"""Return True for each source that has a valid centroid
"""
return np.isfinite(sourceCat.get(self.centroidXKey)) \
& np.isfinite(sourceCat.get(self.centroidYKey)) \
& ~sourceCat.get(self.centroidFlagKey)

def _goodSN(self, sourceCat):
"""Return True for each source that has Signal/Noise > config.minSnr."""
"""Return True for each source that has Signal/Noise > config.minSnr.
"""
if self.config.minSnr <= 0:
return True
else:
Expand Down

0 comments on commit d3c39e0

Please sign in to comment.