|
lsst.afw
13.0-73-gb2a4e38
|
The photometric calibration of an exposure. More...
#include <PhotoCalib.h>
Public Member Functions | |
| PhotoCalib (PhotoCalib const &)=delete | |
| PhotoCalib (PhotoCalib &&)=delete | |
| PhotoCalib & | operator= (PhotoCalib const &)=delete |
| PhotoCalib & | operator= (PhotoCalib &&)=delete |
| PhotoCalib () | |
| Create a empty, zeroed calibration. More... | |
| PhotoCalib (double instFluxMag0, double instFluxMag0Err=0, afw::geom::Box2I const &bbox=afw::geom::Box2I()) | |
| Create a non-spatially-varying calibration. More... | |
| PhotoCalib (std::shared_ptr< afw::math::BoundedField > zeroPoint, double instFluxMag0Err=0) | |
| Create a spatially-varying calibration. More... | |
| PhotoCalib (double instFluxMag0, double instFluxMag0Err, std::shared_ptr< afw::math::BoundedField > zeroPoint, bool isConstant) | |
| Create a calibration with a pre-computed mean. More... | |
| double | instFluxToMaggies (double instFlux, afw::geom::Point< double, 2 > const &point) const |
| Convert instFlux in ADU to maggies at a point in the BoundedField. More... | |
| double | instFluxToMaggies (double instFlux) const |
| Measurement | instFluxToMaggies (double instFlux, double instFluxErr, afw::geom::Point< double, 2 > const &point) const |
| Convert instFlux and error in instFlux (ADU) to maggies and maggies error. More... | |
| Measurement | instFluxToMaggies (double instFlux, double instFluxErr) const |
| Measurement | instFluxToMaggies (const afw::table::SourceRecord &sourceRecord, std::string const &instFluxField) const |
| Convert sourceRecord[instFluxField_instFlux] (ADU) at location (sourceRecord.get('x'), sourceRecord.get('y')) (pixels) to maggies and maggie error. More... | |
| ndarray::Array< double, 2, 2 > | instFluxToMaggies (afw::table::SourceCatalog const &sourceCatalog, std::string const &instFluxField) const |
| Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('y')) (pixels) to maggies. More... | |
| void | instFluxToMaggies (afw::table::SourceCatalog &sourceCatalog, std::string const &instFluxField, std::string const &outField) const |
| Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('x')) (pixels) to maggies and write the results back to sourceCatalog[outField_mag]. More... | |
| double | instFluxToMagnitude (double instFlux, afw::geom::Point< double, 2 > const &point) const |
| Convert instFlux in ADU to AB magnitude. More... | |
| double | instFluxToMagnitude (double instFlux) const |
| Measurement | instFluxToMagnitude (double instFlux, double instFluxErr, afw::geom::Point< double, 2 > const &point) const |
| Convert instFlux and error in instFlux (ADU) to AB magnitude and magnitude error. More... | |
| Measurement | instFluxToMagnitude (double instFlux, double instFluxErr) const |
| Measurement | instFluxToMagnitude (afw::table::SourceRecord const &sourceRecord, std::string const &instFluxField) const |
| Convert sourceRecord[instFluxField_instFlux] (ADU) at location (sourceRecord.get('x'), sourceRecord.get('y')) (pixels) to AB magnitude. More... | |
| ndarray::Array< double, 2, 2 > | instFluxToMagnitude (afw::table::SourceCatalog const &sourceCatalog, std::string const &instFluxField) const |
| Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('y')) (pixels) to AB magnitudes. More... | |
| void | instFluxToMagnitude (afw::table::SourceCatalog &sourceCatalog, std::string const &instFluxField, std::string const &outField) const |
| Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('x')) (pixels) to AB magnitudes and write the results back to sourceCatalog[outField_mag]. More... | |
| double | magnitudeToInstFlux (double magnitude) const |
| Convert AB magnitude to instFlux (ADU), using the mean instFlux/magnitude scaling factor. More... | |
| double | getInstFluxMag0 () const |
| Get the mean instFlux/magnitude zero point. More... | |
| double | getInstFluxMag0Err () const |
| Get the mean instFlux/magnitude zero point error. More... | |
| std::shared_ptr < afw::math::BoundedField > | computeScaledZeroPoint () const |
| Calculates the spatially-variable zero point, normalized by the mean in the valid domain. More... | |
| std::shared_ptr < afw::math::BoundedField > | computeScalingTo (std::shared_ptr< PhotoCalib > other) const |
| Calculates the scaling between this PhotoCalib and another PhotoCalib. More... | |
| bool | operator== (PhotoCalib const &rhs) const |
| Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal. More... | |
| bool | operator!= (PhotoCalib const &rhs) const |
| Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal. More... | |
| bool | isPersistable () const |
| Return true if this particular object can be persisted using afw::table::io. More... | |
Public Member Functions inherited from lsst::afw::table::io::Persistable | |
| void | writeFits (std::string const &fileName, std::string const &mode="w") const |
| Write the object to a regular FITS file. More... | |
| void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
| Write the object to a FITS image in memory. More... | |
| void | writeFits (fits::Fits &fitsfile) const |
| Write the object to an already-open FITS object. More... | |
| virtual | ~Persistable () |
Protected Member Functions | |
| virtual std::string | getPersistenceName () const |
| Return the unique name used to persist this object and look up its factory. More... | |
| virtual void | write (OutputArchiveHandle &handle) const |
| Write the object to one or more catalogs. More... | |
Protected Member Functions inherited from lsst::afw::table::io::Persistable | |
| virtual std::string | getPythonModule () const |
| Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More... | |
| Persistable () | |
| Persistable (Persistable const &other) | |
| void | operator= (Persistable const &other) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, PhotoCalib const &photoCalib) |
Additional Inherited Members | |
Static Public Member Functions inherited from lsst::afw::table::io::PersistableFacade< PhotoCalib > | |
| static std::shared_ptr < PhotoCalib > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. More... | |
| static std::shared_ptr < PhotoCalib > | readFits (std::string const &fileName, int hdu=INT_MIN) |
| Read an object from a regular FITS file. More... | |
| static std::shared_ptr < PhotoCalib > | readFits (fits::MemFileManager &manager, int hdu=INT_MIN) |
| Read an object from a FITS file in memory. More... | |
Protected Types inherited from lsst::afw::table::io::Persistable | |
| typedef io::OutputArchiveHandle | OutputArchiveHandle |
The photometric calibration of an exposure.
A PhotoCalib is a BoundedField (a function with a specified domain) that converts between post-ISR counts-on-chip (ADU) to flux and magnitude. It is defined in terms of "maggies", which are a linear unit defined in SDSS (definition given in nanomaggies): http://www.sdss.org/dr12/algorithms/magnitudes/#nmgy
PhotoCalib is immutable.
The spatially varying flux/magnitude zero point is defined such that, at a position (x,y) in the domain of the boundedField zeroPoint and for a given measured source instFlux:
\[ instFlux / zeroPoint(x,y) = flux [maggies] \]
while the errors (constant on the domain) are defined as:
\[ sqrt((instFluxErr/instFlux)^2 + (zeroPointErr/zeroPoint)^2)*flux = fluxErr [maggies] \]
This implies that the conversions from instFlux and instFlux error to magnitude and magnitude error are as follows:
\[ -2.5 * log_{10}(instFlux / zeroPoint(x,y)) = magnitude \]
and
\[ 2.5/log(10) * sqrt((instFluxErr/instFlux)^2 + (zeroPointErr/zeroPoint)^2) = magnitudeErr \]
Definition at line 82 of file PhotoCalib.h.
|
delete |
|
delete |
|
inline |
Create a empty, zeroed calibration.
Definition at line 93 of file PhotoCalib.h.
|
inlineexplicit |
Create a non-spatially-varying calibration.
| [in] | instFluxMag0 | The constant instFlux/magnitude zero point (instFlux at magnitude 0). |
| [in] | instFluxMag0Err | The error on the zero point. |
| [in] | bbox | The bounding box on which this PhotoCalib is valid. If not specified, this PhotoCalib is valid at any point (i.e. an empty bbox). |
Definition at line 103 of file PhotoCalib.h.
|
inline |
Create a spatially-varying calibration.
| [in] | zeroPoint | The spatially varying photometric zero point. |
| [in] | instFluxMag0Err | The error on the zero point. |
Definition at line 118 of file PhotoCalib.h.
|
inline |
Create a calibration with a pre-computed mean.
Primarily for de-persistence.
| [in] | instFluxMag0 | The mean of the zeroPoint() over its bounding box. |
| [in] | zeroPoint | The spatially varying photometric zero point. |
| [in] | instFluxMag0Err | The error on the zero point. |
| [in] | isConstant | Is this PhotoCalib spatially constant? |
Definition at line 132 of file PhotoCalib.h.
| std::shared_ptr< math::BoundedField > lsst::afw::image::PhotoCalib::computeScaledZeroPoint | ( | ) | const |
Calculates the spatially-variable zero point, normalized by the mean in the valid domain.
This value is defined, for instFlux at (x,y), such that: instFlux * computeScaledZeroPoint()(x,y) * getInstFluxMag0() = instFluxToMaggies(instFlux, (x,y))
Definition at line 166 of file PhotoCalib.cc.
| std::shared_ptr< math::BoundedField > lsst::afw::image::PhotoCalib::computeScalingTo | ( | std::shared_ptr< PhotoCalib > | other | ) | const |
Calculates the scaling between this PhotoCalib and another PhotoCalib.
The BoundedFields of these PhotoCalibs must have the same BBoxes (or one or both must be empty).
With: c = instFlux at position (x,y) this = this PhotoCalib other = other PhotoCalib return = BoundedField returned by this method the return value from this method is defined as: this.instFluxToMaggies(c, (x,y)) * return(x, y) = other.instFluxToMaggies(c, (x,y))
| [in] | other | The PhotoCalib to scale to. |
Definition at line 170 of file PhotoCalib.cc.
|
inline |
Get the mean instFlux/magnitude zero point.
This value is defined, for instFlux at (x,y), such that: instFlux * computeScaledZeroPoint()(x,y) / getInstFluxMag0() = instFluxToMaggies(instFlux, (x,y))
Definition at line 319 of file PhotoCalib.h.
|
inline |
Get the mean instFlux/magnitude zero point error.
This value is defined such that for some instFluxErr, instFlux, and flux: sqrt((instFluxErr/instFlux)^2 + (zeroPointErr/zeroPoint(x,y))^2)*flux = fluxErr (in maggies)
Definition at line 331 of file PhotoCalib.h.
|
protectedvirtual |
Return the unique name used to persist this object and look up its factory.
Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 248 of file PhotoCalib.cc.
| double lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | double | instFlux, |
| afw::geom::Point< double, 2 > const & | point | ||
| ) | const |
Convert instFlux in ADU to maggies at a point in the BoundedField.
If passed point, use the exact calculation at that point, otherwise, use the mean scaling factor.
| [in] | instFlux | The source instFlux in ADU. |
| [in] | point | The point that instFlux is measured at. |
Definition at line 61 of file PhotoCalib.cc.
| double lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | double | instFlux | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 68 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | double | instFlux, |
| double | instFluxErr, | ||
| afw::geom::Point< double, 2 > const & | point | ||
| ) | const |
Convert instFlux and error in instFlux (ADU) to maggies and maggies error.
If passed point, use the exact calculation at that point, otherwise, use the mean scaling factor.
| [in] | instFlux | The source fluxinstFlux in ADU. |
| [in] | instFluxErr | The instFlux error (err). |
| [in] | point | The point that instFlux is measured at. |
Definition at line 70 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | double | instFlux, |
| double | instFluxErr | ||
| ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 82 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | const afw::table::SourceRecord & | sourceRecord, |
| std::string const & | instFluxField | ||
| ) | const |
Convert sourceRecord[instFluxField_instFlux] (ADU) at location (sourceRecord.get('x'), sourceRecord.get('y')) (pixels) to maggies and maggie error.
| [in] | sourceRecord | The source record to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
Definition at line 88 of file PhotoCalib.cc.
| ndarray::Array< double, 2, 2 > lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | afw::table::SourceCatalog const & | sourceCatalog, |
| std::string const & | instFluxField | ||
| ) | const |
Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('y')) (pixels) to maggies.
| [in] | sourceCatalog | The source catalog to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
Definition at line 95 of file PhotoCalib.cc.
| void lsst::afw::image::PhotoCalib::instFluxToMaggies | ( | afw::table::SourceCatalog & | sourceCatalog, |
| std::string const & | instFluxField, | ||
| std::string const & | outField | ||
| ) | const |
Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('x')) (pixels) to maggies and write the results back to sourceCatalog[outField_mag].
| [in] | sourceCatalog | The source catalog to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
| [in] | outField | The field to write the maggies and maggie errors to. Keys of the form "*_flux" and "*_fluxErr" must exist in the schema. |
Definition at line 103 of file PhotoCalib.cc.
| double lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
| afw::geom::Point< double, 2 > const & | point | ||
| ) | const |
Convert instFlux in ADU to AB magnitude.
If passed point, use the exact calculation at that point, otherwise, use the mean scaling factor.
| [in] | instFlux | The source instFlux in ADU. |
| [in] | point | The point that instFlux is measured at. |
Definition at line 111 of file PhotoCalib.cc.
| double lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 118 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
| double | instFluxErr, | ||
| afw::geom::Point< double, 2 > const & | point | ||
| ) | const |
Convert instFlux and error in instFlux (ADU) to AB magnitude and magnitude error.
If passed point, use the exact calculation at that point, otherwise, use the mean scaling factor.
| [in] | instFlux | The source instFlux in ADU. |
| [in] | instFluxErr | The instFlux error (standard deviation). |
| [in] | point | The point that instFlux is measured at. |
Definition at line 120 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
| double | instFluxErr | ||
| ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 132 of file PhotoCalib.cc.
| Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | afw::table::SourceRecord const & | sourceRecord, |
| std::string const & | instFluxField | ||
| ) | const |
Convert sourceRecord[instFluxField_instFlux] (ADU) at location (sourceRecord.get('x'), sourceRecord.get('y')) (pixels) to AB magnitude.
| [in] | sourceRecord | The source record to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
Definition at line 138 of file PhotoCalib.cc.
| ndarray::Array< double, 2, 2 > lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | afw::table::SourceCatalog const & | sourceCatalog, |
| std::string const & | instFluxField | ||
| ) | const |
Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('y')) (pixels) to AB magnitudes.
| [in] | sourceCatalog | The source catalog to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
Definition at line 146 of file PhotoCalib.cc.
| void lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | afw::table::SourceCatalog & | sourceCatalog, |
| std::string const & | instFluxField, | ||
| std::string const & | outField | ||
| ) | const |
Convert sourceCatalog[instFluxField_instFlux] (ADU) at locations (sourceCatalog.get('x'), sourceCatalog.get('x')) (pixels) to AB magnitudes and write the results back to sourceCatalog[outField_mag].
| [in] | sourceCatalog | The source catalog to get instFlux and position from. |
| [in] | instFluxField | The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must exist. For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux", "PsfFlux_instFluxErr" |
| [in] | outField | The field to write the magnitudes and magnitude errors to. Keys of the form "*_flux", "*_fluxErr", *_mag", and "*_magErr" must exist in the schema. |
Definition at line 154 of file PhotoCalib.cc.
|
inlinevirtual |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 372 of file PhotoCalib.h.
| double lsst::afw::image::PhotoCalib::magnitudeToInstFlux | ( | double | magnitude | ) | const |
Convert AB magnitude to instFlux (ADU), using the mean instFlux/magnitude scaling factor.
| [in] | magnitude | The AB magnitude to convert. |
Definition at line 162 of file PhotoCalib.cc.
|
inline |
Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal.
Definition at line 370 of file PhotoCalib.h.
|
delete |
|
delete |
| bool lsst::afw::image::PhotoCalib::operator== | ( | PhotoCalib const & | rhs | ) | const |
Two PhotoCalibs are equal if their component bounded fields and instFluxMag0Err are equal.
Definition at line 174 of file PhotoCalib.cc.
|
protectedvirtual |
Write the object to one or more catalogs.
The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 250 of file PhotoCalib.cc.
|
friend |
Definition at line 183 of file PhotoCalib.cc.
1.8.5