Class ExposureInfo¶
Defined in File ExposureInfo.h
Class Documentation¶
-
class
ExposureInfo
A collection of all the things that make an Exposure different from a MaskedImage
The constness semantics of the things held by ExposureInfo are admittedly a bit of a mess, but they’re that way to preserve backwards compatibility for now. Eventually I’d like to make a lot of these things immutable, but in the meantime, here’s the summary:
Filter is held and returned by value.
VisitInfo is immutable and is held by a const ptr and has a setter and getter.
Metadata is held by non-const pointer, and you can get a non-const pointer via a const member function accessor (i.e. constness is not propagated).
all other types are only accessible through non-const pointers
The setter for Wcs clones its input arguments (this is a departure from the previous behavior for Wcs but it’s safer w.r.t. aliasing and it matches the old (and current) behavior of the Exposure and ExposureInfo constructors, which clone their arguments. The setter for Psf and constructors do not clone the Psf, as Psfs are immutable and hence we don’t need to ensure strict ownership. The setter for Detector does not clone its input argument, because while it technically isn’t, we can safely consider a Detector to be immutable once it’s attached to an ExposureInfo.
Public Functions
-
bool
hasWcs
() const¶ Does this exposure have a Wcs?
Set the WCS of the exposure.
-
bool
hasDetector
() const¶ Does this exposure have Detector information?
-
std::shared_ptr<cameraGeom::Detector const>
getDetector
() const¶ Return the exposure’s Detector information.
Set the exposure’s Detector information.
-
bool
hasPhotoCalib
() const¶ Does this exposure have a photometric calibration?
-
std::shared_ptr<PhotoCalib const>
getPhotoCalib
() const¶ Return the exposure’s photometric calibration.
Set the Exposure’s PhotoCalib object.
Set the flexible metadata.
-
bool
hasPsf
() const¶ Does this exposure have a Psf?
Set the exposure’s point-spread function.
-
bool
hasValidPolygon
() const¶ Does this exposure have a valid Polygon.
Set the exposure’s valid Polygon.
-
bool
hasApCorrMap
() const¶ Return true if the exposure has an aperture correction map.
-
std::shared_ptr<ApCorrMap const>
getApCorrMap
() const¶ Return the exposure’s aperture correction map (null pointer if !hasApCorrMap())
Set the exposure’s aperture correction map (null pointer if !hasApCorrMap())
-
void
initApCorrMap
()¶ Set the exposure’s aperture correction map to a new, empty map
Note that the ExposureInfo constructors do not create an empty aperture correction map, so this method provide a convenient way to initialize one before filling it.
-
bool
hasCoaddInputs
() const¶ Does this exposure have coadd provenance catalogs?
Set the exposure’s coadd provenance catalogs.
-
std::shared_ptr<CoaddInputs const>
getCoaddInputs
() const¶ Return a pair of catalogs that record the inputs, if this Exposure is a coadd (otherwise null).
-
bool
hasVisitInfo
() const¶ Does this exposure have visit info?
Set the exposure’s visit info.
-
bool
hasTransmissionCurve
() const¶ Does this exposure have a transmission curve?
-
std::shared_ptr<TransmissionCurve const>
getTransmissionCurve
() const¶ Return the exposure’s transmission curve.
Set the exposure’s transmission curve.
Add a generic component to the ExposureInfo.
If another component is already present under the key, it is overwritten. If a component of a different type is present under the same name, this method raises an exception.
- Note
if
object
is a null pointer, thenhasComponent(key)
shall returnfalse
after this method returns. This is for compatibility with old ExposureInfo idioms, which often use assignment of null to indicate no data.- Template Parameters
T
: a subclass of typehandling::Storable
- Parameters
key
: a strongly typed identifier for the componentobject
: the object to add.
- Exceptions
pex::exceptions::TypeError
: Thrown if a component of a different type is present under the requested name.pex::exceptions::RuntimeError
: Thrown if the insertion failed for implementation-dependent reasons. Provides basic exception safety (a pre-existing component may be removed).
-
template<class
T
>
boolhasComponent
(typehandling::Key<std::string, T> const &key) const¶ Test whether a generic component is defined.
Provides strong exception safety.
- Return
true
if there is a component withkey
,false
otherwise- Parameters
key
: a strongly typed identifier for the component
Retrieve a generic component from the ExposureInfo.
Provides strong exception safety.
- Return
the component identified by that key, or a null pointer if no such component exists.
- Parameters
key
: a strongly typed identifier for the component
-
template<class
T
>
boolremoveComponent
(typehandling::Key<std::string, T> const &key)¶ Clear a generic component from the ExposureInfo.
Provides strong exception safety.
- Return
true
if a component was removed,false
otherwise.- Parameters
key
: a strongly typed identifier for the component. Only components of a compatible type are removed.
Construct an ExposureInfo from its various components.
If a null PhotoCalib and/or PropertySet pointer is passed (the default), a new PhotoCalib and/or PropertyList will be created. To set these pointers to null, you must explicitly call setPhotoCalib or setMetadata after construction.
-
ExposureInfo
(ExposureInfo const &other)¶ Copy constructor; shares all components except the filter.
-
ExposureInfo
(ExposureInfo &&other)¶
-
ExposureInfo
(ExposureInfo const &other, bool copyMetadata)¶ Copy constructor; shares everything but the filter and possibly the metadata.
-
ExposureInfo &
operator=
(ExposureInfo const &other)¶ Assignment; shares all components except the filter.
-
ExposureInfo &
operator=
(ExposureInfo &&other)¶
-
~ExposureInfo
()¶
Public Static Functions
-
static int
getFitsSerializationVersion
()¶ Get the version of FITS serialization that this ExposureInfo understands.
Public Static Attributes
-
typehandling::Key<std::string, std::shared_ptr<geom::SkyWcs const>> const
KEY_WCS
¶ Standard key for looking up the Wcs.
-
typehandling::Key<std::string, std::shared_ptr<detection::Psf const>> const
KEY_PSF
¶ Standard key for looking up the point-spread function.
-
typehandling::Key<std::string, std::shared_ptr<PhotoCalib const>> const
KEY_PHOTO_CALIB
¶ Standard key for looking up the photometric calibration.
-
typehandling::Key<std::string, std::shared_ptr<cameraGeom::Detector const>> const
KEY_DETECTOR
¶ Standard key for looking up the detector information.
-
typehandling::Key<std::string, std::shared_ptr<geom::polygon::Polygon const>> const
KEY_VALID_POLYGON
¶ Standard key for looking up the valid polygon.
-
typehandling::Key<std::string, std::shared_ptr<CoaddInputs const>> const
KEY_COADD_INPUTS
¶ Standard key for looking up coadd provenance catalogs.
-
typehandling::Key<std::string, std::shared_ptr<ApCorrMap const>> const
KEY_AP_CORR_MAP
¶ Standard key for looking up the aperture correction map.
-
typehandling::Key<std::string, std::shared_ptr<TransmissionCurve const>> const
KEY_TRANSMISSION_CURVE
¶ Standard key for looking up the transmission curve.