LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
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. More... | |
PhotoCalib (double calibrationMean, double calibrationErr=0, lsst::geom::Box2I const &bbox=lsst::geom::Box2I()) | |
Create a non-spatially-varying calibration. More... | |
PhotoCalib (std::shared_ptr< afw::math::BoundedField > calibration, double calibrationErr=0) | |
Create a spatially-varying calibration. More... | |
PhotoCalib (double calibrationMean, double calibrationErr, std::shared_ptr< afw::math::BoundedField > calibration, bool isConstant) | |
Create a calibration with a pre-computed mean. More... | |
double | instFluxToNanojansky (double instFlux, lsst::geom::Point< double, 2 > const &point) const |
Convert instFlux in ADU to nJy at a point in the BoundedField. More... | |
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. More... | |
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). More... | |
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. More... | |
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] . More... | |
double | instFluxToMagnitude (double instFlux, lsst::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, lsst::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 instFluxes in a catalog to AB magnitudes and write back into the catalog. More... | |
MaskedImage< float > | calibrateImage (MaskedImage< float > const &maskedImage, bool includeScaleUncertainty=true) const |
Return a flux calibrated image, with pixel values in nJy. More... | |
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. More... | |
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). More... | |
double | magnitudeToInstFlux (double magnitude) const |
double | getCalibrationMean () const |
Get the mean photometric calibration. More... | |
double | getCalibrationErr () const |
Get the mean photometric calibration error. More... | |
double | getInstFluxAtZeroMagnitude () const |
Get the magnitude zero point (the instrumental flux corresponding to 0 magnitude). More... | |
double | getLocalCalibration (lsst::geom::Point< double, 2 > const &point) const |
Get the local calibration at a point. More... | |
std::shared_ptr< afw::math::BoundedField > | computeScaledCalibration () const |
Calculates the spatially-variable calibration, 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 calibrationErr are equal. More... | |
bool | operator!= (PhotoCalib const &rhs) const |
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal. More... | |
bool | isPersistable () const noexcept override |
Return true if this particular object can be persisted using afw::table::io. More... | |
std::shared_ptr< typehandling::Storable > | cloneStorable () const override |
Create a new PhotoCalib that is a copy of this one. More... | |
std::string | toString () const override |
Create a string representation of this object. More... | |
bool | equals (typehandling::Storable const &other) const noexcept override |
Compare this object to another Storable. More... | |
virtual std::size_t | hash_value () const |
Return a hash of this object (optional operation). More... | |
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... | |
Static Public Member Functions | |
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=fits::DEFAULT_HDU) |
Read an object from a regular FITS file. More... | |
static std::shared_ptr< PhotoCalib > | readFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU) |
Read an object from a FITS file in memory. More... | |
static std::shared_ptr< PhotoCalib > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
Dynamically cast a shared_ptr. More... | |
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. More... | |
void | write (OutputArchiveHandle &handle) const override |
Write the object to one or more catalogs. More... | |
virtual std::string | getPythonModule () const |
Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More... | |
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. More... | |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, Storable const &storable) |
Output operator for Storable. More... | |
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 349 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 282 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 260 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 238 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 221 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 225 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 252 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 418 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 404 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 432 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 450 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 509 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::meas::modelfit::Mixture, lsst::meas::algorithms::WarpedPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::CoaddBoundedField, lsst::afw::typehandling::StorableHelper< Base >, lsst::afw::math::WarpingControl, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::TransformBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::Kernel, lsst::afw::math::Function< ReturnT >, lsst::afw::math::ChebyshevBoundedField, lsst::afw::image::TransmissionCurve, lsst::afw::image::CoaddInputs, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::geom::SkyWcs, lsst::afw::detection::GaussianPsf, lsst::afw::detection::Footprint, lsst::afw::cameraGeom::DetectorCollection, and lsst::afw::image::FilterLabel.
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::typehandling::StorableHelper< Base >, lsst::afw::image::VisitInfo, lsst::afw::image::FilterLabel, and lsst::afw::geom::polygon::Polygon.
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 197 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 189 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 181 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux | ) | const |
Definition at line 162 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToMagnitude | ( | double | instFlux, |
double | instFluxErr | ||
) | const |
Definition at line 175 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 166 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 158 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 142 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 134 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 127 of file PhotoCalib.cc.
double lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux | ) | const |
Definition at line 108 of file PhotoCalib.cc.
Measurement lsst::afw::image::PhotoCalib::instFluxToNanojansky | ( | double | instFlux, |
double | instFluxErr | ||
) | const |
Definition at line 121 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 112 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 104 of file PhotoCalib.cc.
|
inlineoverridevirtualnoexcept |
Return true if this particular object can be persisted using afw::table::io.
Reimplemented from lsst::afw::table::io::Persistable.
Definition at line 496 of file PhotoCalib.h.
double lsst::afw::image::PhotoCalib::magnitudeToInstFlux | ( | double | magnitude | ) | const |
Definition at line 213 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 217 of file PhotoCalib.cc.
|
inline |
Two PhotoCalibs are equal if their component bounded fields and calibrationErr are equal.
Definition at line 494 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 229 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 242 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 511 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.