File Detector.h¶
-
namespace
lsst
Class for a simple mapping implementing a generic AstrometryTransform.
Remove all non-astronomical counts from the Chunk Exposure’s pixels.
Forward declarations for lsst::utils::Cache
For details on the Cache class, see the Cache.h file.
It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.
A base class for image defects
Numeric constants used by the Integrate.h integrator routines.
Compute Image Statistics
- Note
Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.
- Note
The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.
-
namespace
afw
-
namespace
cameraGeom
Enums
-
enum
DetectorType
Type of imaging detector
Values:
-
SCIENCE
-
FOCUS
-
GUIDER
-
WAVEFRONT
-
-
class
Detector
: public lsst::afw::cameraGeom::DetectorBase, public lsst::afw::table::io::PersistableFacade<Detector>, public Storable - #include <Detector.h>
A representation of a detector in a mosaic camera.
Detector holds both simple data fields (see DetectorBase) and a set of related coordinate systems and transforms, and acts as a container of Amplifier objects.
Detector is immutable, but copies can be modified via one of its Builder classes. A Detector must be created initially as part of a Camera (see Camera::Builder::add), but can then be modified either individually (see Detector::rebuild and Detector::PartialRebuilder) or as part of modifying the full Camera (see Detector::InCameraBuilder).
The coordinate systems and transforms known to a Detector are shared with its parent Camera and all other Detectors in that Camera.
Unnamed Group
-
Fields const
_fields
¶
-
std::shared_ptr<TransformMap const>
_transformMap
¶
-
auto
begin
() const An iterator range over amplifers.
Iterators dereference to
shared_ptr<Amplifier const>
.
-
auto
end
() const
-
std::shared_ptr<Amplifier const>
operator[]
(size_t i) const Get the amplifier specified by index.
- Exceptions
std::out_of_range
: if index is out of range.
-
std::shared_ptr<Amplifier const>
operator[]
(std::string const &name) const Get the amplifier specified by name.
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: if no such amplifier.
-
std::size_t
size
() const Get the number of amplifiers. Renamed to
__len__
in Python.
-
bool
isPersistable
() const Detector is always persistable.
-
Fields const &
getFields
() const Return a reference to a Fields struct.
Must be implemented by all subclasses.
-
void
write
(OutputArchiveHandle &handle) const¶
Public Functions
-
std::shared_ptr<PartialRebuilder>
rebuild
() const Return a Builder object initialized with the state of this Detector.
This is simply a shortcut for
Detector::PartialRebuilder(*this)
.
-
std::vector<lsst::geom::Point2D>
getCorners
(CameraSys const &cameraSys) const Get the corners of the detector in the specified camera coordinate system
-
std::vector<lsst::geom::Point2D>
getCorners
(CameraSysPrefix const &cameraSysPrefix) const Get the corners of the detector in the specified camera coordinate system prefix
-
lsst::geom::Point2D
getCenter
(CameraSys const &cameraSys) const Get the center of the detector in the specified camera coordinate system
-
lsst::geom::Point2D
getCenter
(CameraSysPrefix const &cameraSysPrefix) const Get the center of the detector in the specified camera coordinate system prefix
-
bool
hasTransform
(CameraSys const &cameraSys) const Can this object convert between PIXELS and the specified camera coordinate system?
-
bool
hasTransform
(CameraSysPrefix const &cameraSysPrefix) const Can this object convert between PIXELS and the specified camera coordinate system prefix?
Get a Transform from one camera coordinate system, or camera coordinate system prefix, to another.
- Return
a Transform that converts from
fromSys
totoSys
in the forward direction. The Transform will be invertible.- Template Parameters
FromSysTToSysT
: Type offromSys
,toSys
: one ofCameraSys
orCameraSysPrefix
- Parameters
fromSystoSys
: camera coordinate systems or prefixes between which to transform
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: Thrown if eitherfromSys
ortoSys
is not supported.
-
template<typename
FromSysT
, typenameToSysT
>
lsst::geom::Point2Dtransform
(lsst::geom::Point2D const &point, FromSysT const &fromSys, ToSysT const &toSys) const Transform a point from one camera system to another
- Return
The transformed point
- Template Parameters
FromSysT
: Class of fromSys: one of CameraSys or CameraSysPrefixToSysT
: Class of toSys: one of CameraSys or CameraSysPrefix
- Parameters
- Exceptions
pex::exceptions::InvalidParameterError
: if fromSys or toSys is unknown
-
template<typename
FromSysT
, typenameToSysT
>
std::vector<lsst::geom::Point2D>transform
(std::vector<lsst::geom::Point2D> const &points, FromSysT const &fromSys, ToSysT const &toSys) const Transform a vector of points from one camera system to another
- Return
The transformed points
- Template Parameters
FromSysT
: Class of fromSys: one of CameraSys or CameraSysPrefixToSysT
: Class of toSys: one of CameraSys or CameraSysPrefix
- Parameters
- Exceptions
pex::exceptions::InvalidParameterError
: if fromSys or toSys is unknown
-
std::shared_ptr<TransformMap const>
getTransformMap
() const Get the transform registry
-
class
Builder
: public lsst::afw::cameraGeom::DetectorBase - #include <Detector.h>
A helper class for Detector that allows amplifiers and most fields to be modified.
Because Detector is immutable, creation and modification always go through Builder, or more precisely, one of its two subclasses:
InCameraBuilder (obtained from Camera::Builder) is used to construct new detectors or modify them as part of Camera.
PartialRebuilder (obtained from Detector::rebuild) is used to modify an existing detector without changing its relationship to its camera.
Detector::Builder itself provides functionality common to these:
setters for the simple data fields of Detector;
a container of Amplifier::Builders. It is not intended define an interface independent of its subclasses.
The name and ID of a detector (but not its “serial” string) are set at initial construction and are an integral part of the relationship between it and its Camera, and can never be changed, even by Builders.
The fact that Amplifier::Builder inherits from Amplifier does not mean that a container of Amplifier::Builder can inherit from a container of Amplifier, and hence Detector::Builder (which has a container of Amplifer::Builder) cannot inherit directly from Detector (which has a container of Amplifier). But in both Python and templated C++ code, the container interfaces of Detector and Detector::Builder are identical (i.e. they’re “duck type” equivalent), aside from the fact that Detector::Builder also permits addition and removal of amplifiers.
Subclassed by lsst::afw::cameraGeom::Detector::InCameraBuilder, lsst::afw::cameraGeom::Detector::PartialRebuilder
Unnamed Group
-
auto
begin
() An iterator range over amplifers.
Iterators dereference to
shared_ptr<Amplifier::Builder>
.
-
auto
end
()
Public Functions
-
Builder
(Builder const&)
-
Builder
(Builder&&)
-
~Builder
() = 0
-
void
setBBox
(lsst::geom::Box2I const &bbox) Set the bounding box
-
void
setType
(DetectorType type) Set the purpose of this detector.
-
void
setSerial
(std::string const &serial) Set the detector serial “number”.
-
void
setPhysicalType
(std::string const &physicalType) Set the detector’s physical type.
Get the detector’s physical type.
This may mean different things for different cameras; possibilities include the manufacturer (“ITL” vs “E2V”) or fundamental technology (“CCD” vs “HgCdTe”).
-
void
setCrosstalk
(CrosstalkMatrix const &crosstalk) Set the crosstalk coefficients.
The shape of the crosstalk matrix must be consistent with the set of amplifiers, but is not checked until a Detector instance is actually constructed.
Setting with a zero-size matrix is equivalent to calling
unsetCrosstalk()
.
-
void
unsetCrosstalk
() Remove the crosstalk coefficient matrix.
-
std::vector<std::shared_ptr<Amplifier::Builder>> const &
getAmplifiers
() const Return the sequence of Amplifier::Builders directly.
-
std::shared_ptr<Amplifier::Builder>
operator[]
(size_t i) const Get the amplifier builder specified by index
- Exceptions
std::out_of_range
: if index is out of range.
-
std::shared_ptr<Amplifier::Builder>
operator[]
(std::string const &name) const Get a builder for the amplifier specified by name.
- Exceptions
lsst::pex::exceptions::InvalidParameterError
: if no such amplifier.
Append a new amplifier.
-
void
clear
() Remove all amplifiers.
-
std::size_t
size
() const Return the number of amplifiers (renamed to len in Python).
Protected Functions
-
Builder
(std::string const &name, int id) Construct a Detector::Builder with no amplifiers and the given name and ID.
Construct a Detector::Builder with the given field values and amplifiers.
-
Fields const &
getFields
() const Return a reference to a Fields struct.
Must be implemented by all subclasses.
-
std::vector<std::shared_ptr<Amplifier const>>
finishAmplifiers
() const Create a vector of Amplifiers from the Amplifier::Builder sequence.
-
void
setOrientation
(Orientation const &orientation) Set the orientation of the detector in the focal plane.
This is intended for use by InCameraBuilder only; the orientation is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.
-
void
setPixelSize
(lsst::geom::Extent2D const &pixelSize) Set the pixel size (in mm).
This is intended for use by InCameraBuilder only; the pixel size is used to set the coordinate transform from FOCAL_PLANE to PIXELS, and hence cannot be modified unless the full Camera is being modified.
Protected Static Functions
-
class
InCameraBuilder
: public lsst::afw::cameraGeom::Detector::Builder - #include <Detector.h>
A helper class that allows the properties of a detector to be modified in the course of modifying a full camera.
Detector::InCameraBuilder can only be constructed via Camera::Builder, and all Detector::InCameraBuilder instances should always be owned by or shared with a Camera::Builder.
Unlike Detector::PartialRebuilder, InCameraBuilder can be used to set the orientation, pixel size, and more general coordinate systems associated with the detector.
The transformation from FOCAL_PLANE to PIXELS that relates this detector’s coordinate systems to those of the full camera and other detectors is created from the orientation and pixel size fields, and need not (and cannot) be set explicitly.
Public Functions
-
void
setOrientation
(Orientation const &orientation) Set the orientation of the detector in the focal plane.
-
void
setPixelSize
(lsst::geom::Extent2D const &pixelSize) Set the pixel size (in mm).
Set the transformation from PIXELS to the given coordinate system.
If a transform already exists from PIXELS to
toSys
, it is overwritten.- Parameters
toSys
: Coordinate system prefix this transform returns points in.transform
: Transform from PIXELS totoSys
.
Set the transformation from PIXELS to the given coordinate system.
If a transform already exists from PIXELS to
toSys
, it is overwritten.- Parameters
toSys
: Coordinate system prefix this transform returns points in. Must be associated with this detector.transform
: Transform from PIXELS totoSys
.
- Exceptions
pex::exceptions::InvalidParameterError
: iftoSys.getDetectorName() != this->getName()
.
-
bool
discardTransformFromPixelsTo
(CameraSysPrefix const &toSys) Remove any transformation from PIXELS to the given coordinate system.
- Return
true if a transform was removed; false otherwise.
- Parameters
toSys
: Coordinate system prefix this transform returns points in.
-
bool
discardTransformFromPixelsTo
(CameraSys const &toSys) Remove any transformation from PIXELS to the given coordinate system.
- Return
true if a transform was removed; false otherwise.
- Parameters
toSys
: Coordinate system prefix this transform returns points in. Must be associated with this detector.
- Exceptions
pex::exceptions::InvalidParameterError
: iftoSys.getDetectorName() != this->getName()
.
-
void
clearTransforms
() Remove all coordinate transforms.
Private Functions
Private Members
-
std::vector<TransformMap::Connection>
_connections
¶
Friends
-
friend
lsst::afw::cameraGeom::Camera
-
void
-
class
PartialRebuilder
: public lsst::afw::cameraGeom::Detector::Builder - #include <Detector.h>
A helper class that allows the properties of a single detector to be modified in isolation.
Detector::PartialRebuilder can be used without access to the Camera instance the Detector was originally a part of (such as when the Detector was obtained from an Exposure or ExposureRecord). As this always creates a new Detector, the original Camera is never updated. PartialRebuilder prohibits changes to coordinate systems and transforms (including the orientation and pixel size fields that are used to define some transforms), as these cannot be done self-consistently without access to the full Camera.
Public Functions
-
PartialRebuilder
(Detector const &detector) Construct a PartialRebuilder initialized to the state of the given Detector.
Private Members
-
std::shared_ptr<TransformMap const>
_transformMap
¶
-
-
Fields const
-
class
DetectorBase
- #include <Detector.h>
An abstract base class that provides common accessors for Detector and Detector::Builder.
Subclassed by lsst::afw::cameraGeom::Detector, lsst::afw::cameraGeom::Detector::Builder
Unnamed Group
-
DetectorBase
() DetectorBase has no state, and is hence default-constructable, copyable, and movable.
-
DetectorBase
(DetectorBase const&)
-
DetectorBase
(DetectorBase&&)
-
DetectorBase &
operator=
(DetectorBase const&)
-
DetectorBase &
operator=
(DetectorBase&&)
Public Types
-
using
CrosstalkMatrix
= ndarray::Array<float const, 2>
Public Functions
-
virtual
~DetectorBase
()
-
std::string
getName
() const Get the detector name.
-
int
getId
() const Get the detector ID.
-
DetectorType
getType
() const Return the purpose of this detector.
-
std::string
getSerial
() const Get the detector serial “number”.
-
std::string
getPhysicalType
() const Get the detector’s physical type.
This may mean different things for different cameras; possibilities include the manufacturer (“ITL” vs “E2V”) or fundamental technology (“CCD” vs “HgCdTe”).
-
lsst::geom::Box2I
getBBox
() const Get the bounding box.
-
Orientation
getOrientation
() const Get detector’s orientation in the focal plane
-
lsst::geom::Extent2D
getPixelSize
() const Get size of pixel along (mm)
-
bool
hasCrosstalk
() const Have we got crosstalk coefficients?
-
CrosstalkMatrix
getCrosstalk
() const Get the crosstalk coefficients
-
CameraSys
makeCameraSys
(CameraSys const &cameraSys) const Get a coordinate system from a coordinate system (return input unchanged and untested)
- Return
cameraSys
unchanged- Note
the CameraSysPrefix version needs the detector name, which is why this is not static.
- Parameters
[in] cameraSys
: Camera coordinate system
-
CameraSys
makeCameraSys
(CameraSysPrefix const &cameraSysPrefix) const Get a coordinate system from a detector system prefix (add detector name)
- Return
cameraSysPrefix
with the detector name added- Parameters
[in] cameraSysPrefix
: Camera coordinate system prefix
-
CameraSys
getNativeCoordSys
() const The “native” coordinate system of this detector.
Protected Functions
-
struct
Fields
Public Members
-
std::string
name
= ""
-
int
id
= 0
-
DetectorType
type
= DetectorType::SCIENCE
-
std::string
serial
= ""
-
lsst::geom::Box2I
bbox
-
Orientation
orientation
-
lsst::geom::Extent2D
pixelSize
-
CrosstalkMatrix
crosstalk
-
std::string
physicalType
-
std::string
-
-
enum
-
namespace