lsst.pipe.tasks
20.0.0-21-g7fb4cbd3+3f6d2a4614
|
Measure the PSF. More...
Public Member Functions | |
def | __init__ (self, schema=None, **kwargs) |
Create the detection task. More... | |
def | run (self, exposure, sources, expId=0, matches=None) |
Measure the PSF. More... | |
def | usesMatches (self) |
Public Attributes | |
candidateKey | |
usedKey | |
Static Public Attributes | |
ConfigClass | |
Measure the PSF.
A task that selects stars from a catalog of sources and uses those to measure the PSF.
The star selector is a subclass of lsst.meas.algorithms.BaseStarSelectorTask and the PSF determiner is a sublcass of lsst.meas.algorithms.BasePsfDeterminerTask
Create the detection task. Most arguments are simply passed onto pipe.base.Task.
schema | An lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog |
**kwargs | Keyword arguments passed to lsst.pipe.base.task.Task.__init__. |
If schema is not None, 'calib_psf_candidate' and 'calib_psf_used' fields will be added to identify which stars were employed in the PSF estimation.
Measure the PSF.
[in,out] | exposure | Exposure to process; measured PSF will be added. |
[in,out] | sources | Measured sources on exposure; flag fields will be set marking stars chosen by the star selector and the PSF determiner if a schema was passed to the task constructor. |
[in] | expId | Exposure id used for generating random seed. |
[in] | matches | A list of lsst.afw.table.ReferenceMatch objects (i.e. of lsst.afw.table.Match with first being of type lsst.afw.table.SimpleRecord and second type lsst.afw.table.SourceRecord — the reference object and detected object respectively) as returned by e.g. the AstrometryTask. Used by star selectors that choose to refer to an external catalog. |
See MeasurePsfConfig.
The command line task interface supports a flag -d
to import debug.py from your PYTHONPATH
; see Using lsstDebug to control debugging output for more about debug.py files.
display
Additionally you can enable any debug outputs that your chosen star selector and psf determiner support.
This code is in measurePsfTask.py in the examples directory, and can be run as e.g.
The example also runs SourceDetectionTask and SingleFrameMeasurementTask; see meas_algorithms_measurement_Example for more explanation.
Import the tasks (there are some other standard imports; read the file to see them all):
We need to create the tasks before processing any data as the task constructor can add an extra column to the schema, but first we need an almost-empty Schema:
We can now call the constructors for the tasks we need to find and characterize candidate PSF stars:
Note that we've chosen a minimal set of measurement plugins: we need the outputs of base_SdssCentroid
, base_SdssShape
and base_CircularApertureFlux
as inputs to the PSF measurement algorithm, while base_PixelFlags
identifies and flags bad sources (e.g. with pixels too close to the edge) so they can be removed later.
Now we can create and configure the task that we're interested in:
We're now ready to process the data (we could loop over multiple exposures/catalogues using the same task objects). First create the output table:
And process the image:
We can then unpack and use the results:
If you specified –doDisplay
you can see the PSF candidates:
To investigate the Debug variables, put something like
into your debug.py file and run measurePsfTask.py with the –debug
flag.
Definition at line 56 of file measurePsf.py.
def lsst.pipe.tasks.measurePsf.MeasurePsfTask.__init__ | ( | self, | |
schema = None , |
|||
** | kwargs | ||
) |
Create the detection task.
Most arguments are simply passed onto pipe.base.Task.
schema | An lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog |
**kwargs | Keyword arguments passed to lsst.pipe.base.task.Task.__init__. |
If schema is not None, 'calib_psf_candidate' and 'calib_psf_used' fields will be added to identify which stars were employed in the PSF estimation.
Definition at line 205 of file measurePsf.py.
def lsst.pipe.tasks.measurePsf.MeasurePsfTask.run | ( | self, | |
exposure, | |||
sources, | |||
expId = 0 , |
|||
matches = None |
|||
) |
Measure the PSF.
[in,out] | exposure | Exposure to process; measured PSF will be added. |
[in,out] | sources | Measured sources on exposure; flag fields will be set marking stars chosen by the star selector and the PSF determiner if a schema was passed to the task constructor. |
[in] | expId | Exposure id used for generating random seed. |
[in] | matches | A list of lsst.afw.table.ReferenceMatch objects (i.e. of lsst.afw.table.Match with first being of type lsst.afw.table.SimpleRecord and second type lsst.afw.table.SourceRecord — the reference object and detected object respectively) as returned by e.g. the AstrometryTask. Used by star selectors that choose to refer to an external catalog. |
Definition at line 240 of file measurePsf.py.
def lsst.pipe.tasks.measurePsf.MeasurePsfTask.usesMatches | ( | self | ) |
Return True if this task makes use of the "matches" argument to the run method
Definition at line 333 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.candidateKey |
Definition at line 220 of file measurePsf.py.
|
static |
Definition at line 202 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.usedKey |
Definition at line 225 of file measurePsf.py.