LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Measure the PSF. More...
Public Member Functions | |
def | __init__ |
Create the detection task. More... | |
def | run |
Measure the PSF. More... | |
Public Attributes | |
candidateKey | |
usedKey | |
starSelector | |
psfDeterminer | |
Static Public Attributes | |
ConfigClass = MeasurePsfConfig | |
Static Private Attributes | |
string | _DefaultName = "measurePsf" |
Measure the PSF.
A task that wraps two algorithms set via a pair of registries specified in the task's Configuration parameters. Both algorithms are classes with a constructor taking a pex.config.Config object (e.g. lsst.meas.algorithms.objectSizeStarSelector.ObjectSizeStarSelector.__init__).
The algorithms are:
flagKey
set to "calib.psf.used" if a schema is passed to its constructor (see Task initialisation).See also lsst.meas.algorithms.starSelectorRegistry.starSelectorRegistry and lsst.meas.algorithms.psfDeterminerRegistry.psfDeterminerRegistry.
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] | 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 SourceMeasurementTask; 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 –ds9
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 41 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 212 of file measurePsf.py.
def lsst.pipe.tasks.measurePsf.MeasurePsfTask.run | ( | self, | |
exposure, | |||
sources, | |||
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] | 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 244 of file measurePsf.py.
|
staticprivate |
Definition at line 210 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.candidateKey |
Definition at line 227 of file measurePsf.py.
|
static |
Definition at line 209 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.psfDeterminer |
Definition at line 241 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.starSelector |
Definition at line 240 of file measurePsf.py.
lsst.pipe.tasks.measurePsf.MeasurePsfTask.usedKey |
Definition at line 232 of file measurePsf.py.