LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
The photometric calibration of an exposure. More...
#include <PhotoCalib.h>
Public Member Functions | |
PhotoCalib (PhotoCalib const &)=default | |
PhotoCalib (PhotoCalib &&)=default | |
PhotoCalib & | operator= (PhotoCalib const &)=delete |
PhotoCalib & | operator= (PhotoCalib &&)=delete |
~PhotoCalib () override=default | |
PhotoCalib () | |
Create a empty, zeroed calibration. | |
PhotoCalib (double calibrationMean, double calibrationErr=0, lsst::geom::Box2I const &bbox=lsst::geom::Box2I()) | |
Create a non-spatially-varying calibration. | |
PhotoCalib (std::shared_ptr< afw::math::BoundedField > calibration, double calibrationErr=0) | |
Create a spatially-varying calibration. | |
PhotoCalib (double calibrationMean, double calibrationErr, std::shared_ptr< afw::math::BoundedField > calibration, bool isConstant) | |
Create a calibration with a pre-computed mean. | |
double | instFluxToNanojansky (double instFlux, lsst::geom::Point< double, 2 > const &point) const |
Convert instFlux in ADU to nJy at a point in the BoundedField. | |
double | instFluxToNanojansky (double instFlux) const |
Measurement | instFluxToNanojansky (double instFlux, double instFluxErr, lsst::geom::Point< double, 2 > const &point) const |
Convert instFlux and error in instFlux (ADU) to nJy and nJy error. | |
Measurement | instFluxToNanojansky (double instFlux, double instFluxErr) const |
Measurement | instFluxToNanojansky (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 flux and flux error (in nJy). | |
ndarray::Array< double, 2, 2 > | instFluxToNanojansky (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 nJy. | |
void | instFluxToNanojansky (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("y")) (pixels) to nJy and write the results back to sourceCatalog[outField_mag] . | |
double | instFluxToMagnitude (double instFlux, lsst::geom::Point< double, 2 > const &point) const |
Convert instFlux in ADU to AB magnitude. | |
double | instFluxToMagnitude (double instFlux) const |
Measurement | instFluxToMagnitude (double instFlux, double instFluxErr, lsst::geom::Point< double, 2 > const &point) const |
Convert instFlux and error in instFlux (ADU) to AB magnitude and magnitude error. | |
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. | |
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. | |
void | instFluxToMagnitude (afw::table::SourceCatalog &sourceCatalog, std::string const &instFluxField, std::string const &outField) const |
Convert instFluxes in a catalog to AB magnitudes and write back into the catalog. | |
MaskedImage< float > | calibrateImage (MaskedImage< float > const &maskedImage, bool includeScaleUncertainty=true) const |
Return a flux calibrated image, with pixel values in nJy. | |
MaskedImage< float > | uncalibrateImage (MaskedImage< float > const &maskedImage, bool includeScaleUncertainty=true) const |
Return a un-calibrated image, with pixel values in ADU (or whatever the original input to this photoCalib was). | |
afw::table::SourceCatalog | calibrateCatalog (afw::table::SourceCatalog const &catalog, std::vector< std::string > const &instFluxFields) const |
Return a flux calibrated catalog, with new _flux , _fluxErr , _mag , and _magErr fields. | |
afw::table::SourceCatalog | calibrateCatalog (afw::table::SourceCatalog const &catalog) const |
double | magnitudeToInstFlux (double magnitude, lsst::geom::Point< double, 2 > const &point) const |
Convert AB magnitude to instFlux (ADU). | |
double | magnitudeToInstFlux (double magnitude) const |
double | getCalibrationMean () const |
Get the mean photometric calibration. | |
double | getCalibrationErr () const |
Get the mean photometric calibration error. | |
bool | isConstant () const |
Is this photoCalib spatially constant? | |
double | getInstFluxAtZeroMagnitude () const |
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude). | |
double | getLocalCalibration (lsst::geom::Point< double, 2 > const &point) const |
Get the local calibration at a point. | |
std::shared_ptr< afw::math::BoundedField > | computeScaledCalibration () const |
Calculates the spatially-variable calibration, normalized by the mean in the valid domain. | |
std::shared_ptr< afw::math::BoundedField > | computeScalingTo (std::shared_ptr< PhotoCalib > other) const |
Calculates the scaling between this PhotoCalib and another PhotoCalib. | |
bool | operator== (PhotoCalib const &rhs) const |
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal. | |
bool | operator!= (PhotoCalib const &rhs) const |
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal. | |
bool | isPersistable () const noexcept override |
Return true if this particular object can be persisted using afw::table::io. | |
std::shared_ptr< typehandling::Storable > | cloneStorable () const override |
Create a new PhotoCalib that is a copy of this one. | |
std::string | toString () const override |
Create a string representation of this object. | |
bool | equals (typehandling::Storable const &other) const noexcept override |
Compare this object to another Storable. | |
virtual std::size_t | hash_value () const |
Return a hash of this object (optional operation). | |
void | writeFits (std::string const &fileName, std::string const &mode="w") const |
Write the object to a regular FITS file. | |
void | writeFits (fits::MemFileManager &manager, std::string const &mode="w") const |
Write the object to a FITS image in memory. | |
void | writeFits (fits::Fits &fitsfile) const |
Write the object to an already-open FITS object. | |
Static Public Member Functions | |
static std::shared_ptr< PhotoCalib > | readFits (fits::Fits &fitsfile) |
Read an object from an already open FITS object. | |
static std::shared_ptr< PhotoCalib > | readFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. | |
static std::shared_ptr< PhotoCalib > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. | |
static std::shared_ptr< PhotoCalib > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. | |
Protected Types | |
using | OutputArchiveHandle = io::OutputArchiveHandle |
Protected Member Functions | |
std::string | getPersistenceName () const override |
Return the unique name used to persist this object and look up its factory. | |
void | write (OutputArchiveHandle &handle) const override |
Write the object to one or more catalogs. | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. | |
Static Protected Member Functions | |
template<class T > | |
static bool | singleClassEquals (T const &lhs, Storable const &rhs) |
Test if a Storable is of a particular class and equal to another object. | |
Related Symbols | |
(Note that these are not member symbols.) | |
std::ostream & | operator<< (std::ostream &os, Storable const &storable) |
Output operator for Storable. | |
The photometric calibration of an exposure.
A PhotoCalib is a BoundedField (a function with a specified domain) that converts from post-ISR counts-on-chip (ADU) to flux and magnitude. It is defined such that a calibration of 1 means one count is equal to one nanojansky (nJy, 10^-35 W/m^2/Hz in SI units). The nJy was chosen because it represents a linear flux unit with values in a convenient range (e.g. LSST's single image depth of 24.5 is 575 nJy). See more detailed discussion in: https://pstn-001.lsst.io/
PhotoCalib is immutable.
The spatially varying flux calibration has units of nJy/ADU, and is defined such that, at a position (x,y) in the domain of the boundedField calibration and for a given measured source instFlux:
\[ instFlux*calibration(x,y) = flux [nJy] \]
while the errors (constant on the domain) are defined as:
\[ sqrt((instFluxErr/instFlux)^2 + (calibrationErr/calibration)^2)*flux = fluxErr [nJy] \]
This implies that the conversions from instFlux and instFlux error to magnitude and magnitude error are as follows:
\[ -2.5*log_{10}(instFlux*calibration(x,y)*1e-9/referenceFlux) = magnitude \]
where referenceFlux is the AB Magnitude reference flux from Oke & Gunn 1983 (first equation),
\[ referenceFlux = 1e23 * 10^{(48.6/-2.5)} \]
and
\[ 2.5/log(10)*sqrt((instFluxErr/instFlux)^2 + (calibrationErr/calibration)^2) = magnitudeErr \]
Note that this is independent of referenceFlux.
Definition at line 114 of file PhotoCalib.h.
|
protectedinherited |
Definition at line 108 of file Persistable.h.
|
default |
|
default |
|
overridedefault |
|
inline |
Create a empty, zeroed calibration.
Definition at line 127 of file PhotoCalib.h.
|
inlineexplicit |
Create a non-spatially-varying calibration.
[in] | calibrationMean | The spatially-constant calibration (must be non-negative). |
[in] | calibrationErr | The error on the calibration (must be non-negative). |
[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 137 of file PhotoCalib.h.
|
inline |
Create a spatially-varying calibration.
[in] | calibration | The spatially varying photometric calibration (must have non-negative mean). |
[in] | calibrationErr | The error on the calibration (must be non-negative). |
Definition at line 154 of file PhotoCalib.h.
|
inline |
Create a calibration with a pre-computed mean.
Primarily for de-persistence.
[in] | calibrationMean | The mean of the calibration() over its bounding box (must be non-negative). |
[in] | calibrationErr | The error on the calibration (must be non-negative). |
[in] | calibration | The spatially varying photometric calibration. |
[in] | isConstant | Is this PhotoCalib spatially constant? |
Definition at line 171 of file PhotoCalib.h.
afw::table::SourceCatalog lsst::afw::image::PhotoCalib::calibrateCatalog | ( | afw::table::SourceCatalog const & | catalog | ) | const |
Definition at line 399 of file PhotoCalib.cc.
afw::table::SourceCatalog lsst::afw::image::PhotoCalib::calibrateCatalog | ( | afw::table::SourceCatalog const & | catalog, |
std::vector< std::string > const & | instFluxFields ) const |
Return a flux calibrated catalog, with new _flux
, _fluxErr
, _mag
, and _magErr
fields.
If the input catalog already has _flux
, _mag
, _fluxErr
, and/or _magErr
fields matching instFluxFields
, they will be replaced with the new fields.
catalog | The source catalog to compute calibrated fluxes for. |
instFluxFields | The fields to calibrate (optional). If not provided, every field ending with _instFlux will be calibrated. |
instFluxFields
that have _instFluxErr
will be used to compute the _fluxErr
and _magErr
fields.lsst::pex::exceptions::NotFoundError | if any item in instFluxFields does not have a corresponding *_instFlux field in catalog.schema. |
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 332 of file PhotoCalib.cc.
MaskedImage< float > lsst::afw::image::PhotoCalib::calibrateImage | ( | MaskedImage< float > const & | maskedImage, |
bool | includeScaleUncertainty = true ) const |
Return a flux calibrated image, with pixel values in nJy.
Mask pixels are propagated directly from the input image.
maskedImage | The masked image to calibrate. |
includeScaleUncertainty | Include the uncertainty on the calibration in the resulting variance? |
Definition at line 288 of file PhotoCalib.cc.
|
overridevirtual |
Create a new PhotoCalib that is a copy of this one.
Reimplemented from lsst::afw::typehandling::Storable.
Definition at line 266 of file PhotoCalib.cc.
std::shared_ptr< math::BoundedField > lsst::afw::image::PhotoCalib::computeScaledCalibration | ( | ) | const |
Calculates the spatially-variable calibration, normalized by the mean in the valid domain.
This value is defined, for instFlux at (x,y), such that:
\[ instFlux*computeScaledCalibration()(x,y)*getCalibrationMean() = instFluxToNanojansky(instFlux, (x,y)) \]
Definition at line 249 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:
\[ this.instFluxToNanojansky(c, (x,y))*return(x, y) = other.instFluxToNanojansky(c, (x,y)) \]
[in] | other | The PhotoCalib to scale to. |
Definition at line 253 of file PhotoCalib.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
overridevirtualnoexcept |
Compare this object to another Storable.
*this == other
if other
is a PhotoCalib; otherwise false
. Reimplemented from lsst::afw::typehandling::Storable.
Definition at line 280 of file PhotoCalib.cc.
|
inline |
Get the mean photometric calibration error.
This value is defined such that for some instFluxErr, instFlux, and flux:
\[ sqrt((instFluxErr/instFlux)^2 + (calibrationErr/calibration(x,y))^2)*flux = fluxErr [nJy] \]
Definition at line 434 of file PhotoCalib.h.
|
inline |
Get the mean photometric calibration.
This value is defined, for instFlux at (x,y), such that:
\[ instFlux*computeScaledCalibration()(x,y)*getCalibrationMean() = instFluxToNanojansky(instFlux, (x,y)) \]
Definition at line 420 of file PhotoCalib.h.
|
inline |
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude).
This value is defined such that:
\[ instFluxToMagnitude(getInstFluxAtZeroMagnitude()) == 0 \]
Definition at line 455 of file PhotoCalib.h.
|
inline |
Get the local calibration at a point.
This value is defined such that:
\[ instFluxToNanojansky(instFlux, point) == localCalibration * inst \]
Use getCalibrationErr() to get the spatially constant error on the calibration.
[in] | point | The position that magnitude is to be converted at. |
Definition at line 473 of file PhotoCalib.h.
|
overrideprotectedvirtual |
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 559 of file PhotoCalib.cc.
|
protectedvirtualinherited |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.
Will be ignored if empty.
Reimplemented in lsst::afw::image::FilterLabel, lsst::afw::cameraGeom::Detector, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::TransformMap, lsst::afw::detection::Footprint, lsst::afw::detection::GaussianPsf, lsst::afw::geom::SkyWcs, lsst::afw::geom::SpanSet, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, lsst::afw::image::TransmissionCurve, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::Function< double >, lsst::afw::math::Function< Kernel::Pixel >, lsst::afw::math::Function< Pixel >, lsst::afw::math::Function< ReturnT >, lsst::afw::math::Kernel, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::WarpingControl, lsst::afw::typehandling::StorableHelper< Base >, lsst::meas::algorithms::CoaddBoundedField, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::WarpedPsf, lsst::meas::extensions::psfex::PsfexPsf, and lsst::meas::modelfit::Mixture.
Definition at line 36 of file Persistable.cc.
|
virtualinherited |
Return a hash of this object (optional operation).
UnsupportedOperationException | Thrown if this object is not hashable. |
__hash__
if it exists. Reimplemented in lsst::afw::geom::polygon::Polygon, lsst::afw::image::FilterLabel, lsst::afw::image::VisitInfo, and lsst::afw::typehandling::StorableHelper< Base >.
Definition at line 44 of file Storable.cc.
void lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | afw::table::SourceCatalog & | sourceCatalog, |
std::string const & | instFluxField, | ||
std::string const & | outField ) const |
Convert instFluxes in a catalog to AB magnitudes and write back into the catalog.
Convert sourceCatalog[instFluxField_instFlux]
(ADU) at locations (sourceCatalog.get("x"), sourceCatalog.get("y"))
(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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
[in] | outField | The field to write the magnitudes and magnitude errors to. Keys of the form "*_instFlux", "*_instFluxErr", *_mag", and "*_magErr" must exist in the schema. |
Definition at line 225 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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
Definition at line 217 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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
Definition at line 209 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux | ) | const |
Definition at line 190 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
double | instFluxErr ) const |
Definition at line 203 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
double | instFluxErr, | ||
lsst::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. |
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 194 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
lsst::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. |
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 186 of file PhotoCalib.cc.
void lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | 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("y"))
(pixels) to nJy 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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
[in] | outField | The field to write the nJy and magnitude errors to. Keys of the form "*_instFlux" and "*_instFluxErr" must exist in the schema. |
Definition at line 170 of file PhotoCalib.cc.
ndarray::Array< double, 2, 2 > lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | 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 nJy.
[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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
Definition at line 162 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | 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 flux and flux error (in nJy).
[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="slot_PsfFlux" will use the fields named: "slot_PsfFlux_instFlux", "slot_PsfFlux_instFluxErr" |
Definition at line 155 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux | ) | const |
Definition at line 136 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux, |
double | instFluxErr ) const |
Definition at line 149 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux, |
double | instFluxErr, | ||
lsst::geom::Point< double, 2 > const & | point ) const |
Convert instFlux and error in instFlux (ADU) to nJy and nJy 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. |
[in] | point | The point that instFlux is measured at. |
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 140 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux, |
lsst::geom::Point< double, 2 > const & | point ) const |
Convert instFlux in ADU to nJy 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. |
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.
|
inline |
Is this photoCalib spatially constant?
Definition at line 441 of file PhotoCalib.h.
|
inlineoverridevirtualnoexcept |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 519 of file PhotoCalib.h.
double lsst::afw::image::PhotoCalib::magnitudeToInstFlux | ( | double | magnitude | ) | const |
Definition at line 241 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::magnitudeToInstFlux | ( | double | magnitude, |
lsst::geom::Point< double, 2 > const & | point ) const |
Convert AB magnitude to instFlux (ADU).
If passed point, use the exact calculation at that point, otherwise, use the mean scaling factor.
Useful for inserting fake sources into an image.
[in] | magnitude | The AB magnitude to convert. |
[in] | point | The position that magnitude is to be converted at. |
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 245 of file PhotoCalib.cc.
|
inline |
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal.
Definition at line 517 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 calibrationErr are equal.
Definition at line 257 of file PhotoCalib.cc.
|
inlinestaticinherited |
Read an object from an already open FITS object.
[in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a FITS file in memory.
[in] | manager | Manager for the memory to read from. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 205 of file Persistable.h.
|
inlinestaticinherited |
Read an object from a regular FITS file.
[in] | fileName | Name of the file to read. |
[in] | hdu | HDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty. |
Definition at line 194 of file Persistable.h.
|
inlinestaticprotectedinherited |
Test if a Storable is of a particular class and equal to another object.
This method template simplifies implementations of equals that delegate to operator==
without supporting cross-class comparisons.
T | The class expected of the two objects to be compared. |
lhs,rhs | The objects to compare. Note that rhs need not be a T , while lhs must be. |
true
if rhs
is a T
and lhs == rhs
; false
otherwise.operator==
. Most implementations of operator==
do not throw.operator==
with both arguments of compile-time type T const&
. Its use is not recommended if there would be any ambiguity as to which operator==
gets picked by overload resolution.This method template is typically called from equals as:
bool MyType::equals(Storable const& other) const noexcept { return singleClassEquals(*this, other); }
Definition at line 151 of file Storable.h.
|
overridevirtual |
Create a string representation of this object.
Reimplemented from lsst::afw::typehandling::Storable.
Definition at line 270 of file PhotoCalib.cc.
MaskedImage< float > lsst::afw::image::PhotoCalib::uncalibrateImage | ( | MaskedImage< float > const & | maskedImage, |
bool | includeScaleUncertainty = true ) const |
Return a un-calibrated image, with pixel values in ADU (or whatever the original input to this photoCalib was).
Mask pixels are propagated directly from the input image.
maskedImage | The masked image with pixel units of nJy to uncalibrate. |
includeScaleUncertainty | Remove uncertainty from this calibration that was previously propagated into the variance plane. Must have the same value as the parameter of the same name when calibrateImage was called on this image. |
Definition at line 310 of file PhotoCalib.cc.
|
overrideprotectedvirtual |
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 561 of file PhotoCalib.cc.
|
inherited |
Write the object to an already-open FITS object.
[in] | fitsfile | Open FITS object to write to. |
Definition at line 18 of file Persistable.cc.
|
inherited |
Write the object to a FITS image in memory.
[in] | manager | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 29 of file Persistable.cc.
|
inherited |
Write the object to a regular FITS file.
[in] | fileName | Name of the file to write to. |
[in] | mode | If "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file. |
Definition at line 24 of file Persistable.cc.
|
related |
Output operator for Storable.
os | the desired output stream |
storable | the object to print |
os
UnsupportedOperationException | Thrown if storable does not have an implementation of Storable::toString. |
Definition at line 174 of file Storable.h.