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
|
Calculate the zero point of an exposure given a lsst.afw.table.ReferenceMatchVector. More...
Public Member Functions | |
def | __init__ |
Create the photometric calibration task. More... | |
def | getSourceKeys |
Return a struct containing the source catalog keys for fields used by PhotoCalTask. More... | |
def | selectMatches |
Select reference/source matches according the criteria specified in the config. More... | |
def | extractMagArrays |
Extract magnitude and magnitude error arrays from the given matches. More... | |
def | run |
Do photometric calibration - select matches to use and (possibly iteratively) compute the zero point. More... | |
def | getZeroPoint |
Flux calibration code, returning (ZeroPoint, Distribution Width, Number of stars) More... | |
Public Attributes | |
scatterPlot | |
fig | |
outputField | |
Static Public Attributes | |
ConfigClass = PhotoCalConfig | |
Static Private Attributes | |
string | _DefaultName = "photoCal" |
Calculate the zero point of an exposure given a lsst.afw.table.ReferenceMatchVector.
Calculate the zero point of an exposure given a lsst.afw.table.ReferenceMatchVector.
Calculate an Exposure's zero-point given a set of flux measurements of stars matched to an input catalogue. The type of flux to use is specified by PhotoCalConfig.fluxField.
The algorithm clips outliers iteratively, with parameters set in the configuration.
Create the photometric calibration task. See PhotoCalTask.init for documentation
Do photometric calibration - select matches to use and (possibly iteratively) compute the zero point.
[in] | exposure | Exposure upon which the sources in the matches were detected. |
[in] | matches | Input lsst.afw.table.ReferenceMatchVector (i.e. a list 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 matched object respectively). (will not be modified except to set the outputField if requested.). |
The exposure is only used to provide the name of the filter being calibrated (it may also be used to generate debugging plots).
The reference objects:
photometric
; True for objects which should be considered as photometric standardsflux
; the flux used to impose a magnitude limit and also to calibrate the data to (unless a color term is specified, in which case ColorTerm.primary is used; See https://jira.lsstcorp.org/browse/DM-933)stargal
; if present, True means that the object is a starvar
; if present, True means that the object is variableThe measured sources:
RuntimeError | with the following strings: |
badFlags
in the config eliminated all candidate objects NaN
flux See PhotoCalConfig
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.
The available variables in PhotoCalTask are:
display
displaySources
scatterPlot
scatterPlot
is 2 or more, prompt to continue after each iteration) This code is in examples/photoCalTask.py, and can be run as e.g.
Import the tasks (there are some other standard imports; read the file for details)
We need to create both our tasks before processing any data as the task constructors can add extra columns to the schema which we get from the input catalogue, scrCat:
Astrometry first:
(thatfilterMap
line is because our test code doesn't use a filter that the reference catalogue recognises, so we tell it to use the r
band)
Then photometry:
If the schema has indeed changed we need to add the new columns to the source table (yes; this should be easier!)
We're now ready to process the data (we could loop over multiple exposures/catalogues using the same task objects):
We can then unpack and use the results:
To investigate the Debug variables, put something like
into your debug.py file and run photoCalTask.py with the –debug
flag.
Definition at line 142 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.__init__ | ( | self, | |
schema, | |||
kwds | |||
) |
Create the photometric calibration task.
See PhotoCalTask.init for documentation
Definition at line 270 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.extractMagArrays | ( | self, | |
matches, | |||
filterName, | |||
sourceKeys | |||
) |
Extract magnitude and magnitude error arrays from the given matches.
[in] | matches | Reference/source matches, a lsst::afw::table::ReferenceMatchVector |
[in] | filterName | Name of filter being calibrated |
[in] | sourceKeys | Struct of source catalog keys, as returned by getSourceKeys() |
Definition at line 419 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.getSourceKeys | ( | self, | |
schema | |||
) |
Return a struct containing the source catalog keys for fields used by PhotoCalTask.
Returned fields include:
Definition at line 282 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.getZeroPoint | ( | self, | |
src, | |||
ref, | |||
srcErr = None , |
|||
zp0 = None |
|||
) |
Flux calibration code, returning (ZeroPoint, Distribution Width, Number of stars)
We perform nIter iterations of a simple sigma-clipping algorithm with a couple of twists:
Definition at line 640 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.run | ( | self, | |
exposure, | |||
matches | |||
) |
Do photometric calibration - select matches to use and (possibly iteratively) compute the zero point.
[in] | exposure | Exposure upon which the sources in the matches were detected. |
[in] | matches | Input lsst.afw.table.ReferenceMatchVector (i.e. a list 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 matched object respectively). (will not be modified except to set the outputField if requested.). |
The exposure is only used to provide the name of the filter being calibrated (it may also be used to generate debugging plots).
The reference objects:
photometric
; True for objects which should be considered as photometric standardsflux
; the flux used to impose a magnitude limit and also to calibrate the data to (unless a color term is specified, in which case ColorTerm.primary is used; See https://jira.lsstcorp.org/browse/DM-933)stargal
; if present, True means that the object is a starvar
; if present, True means that the object is variableThe measured sources:
RuntimeError | with the following strings: |
badFlags
in the config eliminated all candidate objects NaN
flux Definition at line 534 of file photoCal.py.
def lsst.pipe.tasks.photoCal.PhotoCalTask.selectMatches | ( | self, | |
matches, | |||
sourceKeys, | |||
filterName, | |||
frame = None |
|||
) |
Select reference/source matches according the criteria specified in the config.
[in] | matches | ReferenceMatchVector (not modified) |
[in] | sourceKeys | Struct of source catalog keys, as returned by getSourceKeys() |
[in] | filterName | name of camera filter; used to obtain the reference flux field |
[in] | frame | ds9 frame number to use for debugging display if frame is non-None, display information about trimmed objects on that ds9 frame:
|
ValueError | There are no valid matches. |
Definition at line 299 of file photoCal.py.
|
staticprivate |
Definition at line 268 of file photoCal.py.
|
static |
Definition at line 267 of file photoCal.py.
lsst.pipe.tasks.photoCal.PhotoCalTask.fig |
Definition at line 275 of file photoCal.py.
lsst.pipe.tasks.photoCal.PhotoCalTask.outputField |
Definition at line 277 of file photoCal.py.
lsst.pipe.tasks.photoCal.PhotoCalTask.scatterPlot |
Definition at line 274 of file photoCal.py.