lsst.afw gf03f0b42f3+45adbcf3d0
Loading...
Searching...
No Matches
lsst::afw::cameraGeom::Camera::Builder Class Reference

A helper class for creating and modifying cameras. More...

#include <Camera.h>

Inheritance diagram for lsst::afw::cameraGeom::Camera::Builder:
lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >

Public Types

using NameMap
 
using NameMap
 
using IdMap
 
using IdMap
 
using List
 
using List
 

Public Member Functions

virtual ~Builder () noexcept
 
 Builder (std::string const &name)
 Construct a Builder for a completely new Camera with the given name.
 
 Builder (Camera const &camera)
 Construct a Builder with the state of an existing Camera.
 
std::shared_ptr< Camera const > finish () const
 Construct a new Camera from the state of the Builder.
 
std::string getName () const
 Return the name of the camera.
 
void setName (std::string const &name)
 Set the name of the camera.
 
std::string getPupilFactoryName () const
 Return the fully-qualified name of the Python class that provides this Camera's PupilFactory.
 
void setPupilFactoryName (std::string const &pupilFactoryName)
 Set the fully-qualified name of the Python class that provides this Camera's PupilFactory.
 
bool getFocalPlaneParity () const noexcept
 Return True if there is an x-axis flip from FOCAL_PLANE to FIELD_ANGLE, False otherwise.
 
void setFocalPlaneParity (bool flipX)
 Set whether an x-axis flip should be included in the FOCAL_PLANE to FIELD_ANGLE transform.
 
void setTransformFromFocalPlaneTo (CameraSys const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
 Set the transformation from FOCAL_PLANE to the given coordinate system.
 
bool discardTransformFromFocalPlaneTo (CameraSys const &toSys)
 Remove any transformation from FOCAL_PLANE to the given coordinate system.
 
std::shared_ptr< Detector::InCameraBuilderadd (std::string const &name, int id)
 Add a new Detector with the given name and ID.
 
void remove (std::string const &name)
 Remove the detector with the given name or ID.
 
void remove (int id)
 
NameMap const & getNameMap () const noexcept
 Get a map keyed and ordered by name.
 
NameMap const & getNameMap () const noexcept
 Get a map keyed and ordered by name.
 
IdMap const & getIdMap () const noexcept
 Get a map keyed and ordered by ID.
 
IdMap const & getIdMap () const noexcept
 Get a map keyed and ordered by ID.
 
std::size_t size () const noexcept
 Get the number of detectors.
 
std::size_t size () const noexcept
 Get the number of detectors.
 
bool empty () const noexcept
 Determine if the collection contains any detectors.
 
bool empty () const noexcept
 Determine if the collection contains any detectors.
 
std::shared_ptr< Detector::InCameraBuilderoperator[] (std::string const &name) const
 Implement the [name] operator.
 
std::shared_ptr< Detector::InCameraBuilderoperator[] (int id) const
 Implement the [id] operator.
 
std::shared_ptr< Detector::InCameraBuilderoperator[] (std::string const &name) const
 Implement the [name] operator.
 
std::shared_ptr< Detector::InCameraBuilderoperator[] (int id) const
 Implement the [id] operator.
 
std::shared_ptr< Detector::InCameraBuilderget (std::string const &name, std::shared_ptr< Detector::InCameraBuilder > def=nullptr) const
 Retrieve a detector by name, or fall back to a default.
 
std::shared_ptr< Detector::InCameraBuilderget (int id, std::shared_ptr< Detector::InCameraBuilder > def=nullptr) const
 Retrieve a detector by ID, or fall back to a default.
 
std::shared_ptr< Detector::InCameraBuilderget (std::string const &name, std::shared_ptr< Detector::InCameraBuilder > def=nullptr) const
 Retrieve a detector by name, or fall back to a default.
 
std::shared_ptr< Detector::InCameraBuilderget (int id, std::shared_ptr< Detector::InCameraBuilder > def=nullptr) const
 Retrieve a detector by ID, or fall back to a default.
 

Protected Member Functions

void add (std::shared_ptr< Detector::InCameraBuilder > detector)
 Add a detector to the collection.
 

Detailed Description

A helper class for creating and modifying cameras.

Camera and Camera::Builder have no direct inheritance relationship, but both inherit from different specializations of DetectorCollectionBase, so their container-of-detectors interfaces can generally be used the same way in both Python and templated C++.

Definition at line 210 of file Camera.h.

Member Typedef Documentation

◆ IdMap [1/2]

◆ IdMap [2/2]

◆ List [1/2]

◆ List [2/2]

◆ NameMap [1/2]

◆ NameMap [2/2]

Constructor & Destructor Documentation

◆ ~Builder()

lsst::afw::cameraGeom::Camera::Builder::~Builder ( )
virtualdefaultnoexcept

◆ Builder() [1/2]

lsst::afw::cameraGeom::Camera::Builder::Builder ( std::string const & name)
explicit

Construct a Builder for a completely new Camera with the given name.

Definition at line 194 of file Camera.cc.

◆ Builder() [2/2]

lsst::afw::cameraGeom::Camera::Builder::Builder ( Camera const & camera)
explicit

Construct a Builder with the state of an existing Camera.

Definition at line 196 of file Camera.cc.

Member Function Documentation

◆ add() [1/2]

std::shared_ptr< Detector::InCameraBuilder > lsst::afw::cameraGeom::Camera::Builder::add ( std::string const & name,
int id )

Add a new Detector with the given name and ID.

This is the only way to create a completely new detector (as opposed to a copy of an existing one), and it permanently sets that Detector's name and ID.

Exceptions
pex::exceptions::RuntimeErrorThrown if the ID and/or name conflict with those of detectors already in the collection.
Exception Safety
Strong for pex::exceptions::RuntimeError, none otherwise.

Definition at line 331 of file Camera.cc.

◆ add() [2/2]

Add a detector to the collection.

Parameters
[in]detectorNew detector to add to the collection.
Exceptions
pex::exceptions::RuntimeErrorThrown if the ID and/or name conflict with those of detectors already in the collection.
Exception Safety
Strong for pex::exceptions::RuntimeError, weak (collection is made empty) otherwise.

◆ discardTransformFromFocalPlaneTo()

bool lsst::afw::cameraGeom::Camera::Builder::discardTransformFromFocalPlaneTo ( CameraSys const & toSys)

Remove any transformation from FOCAL_PLANE to the given coordinate system.

Parameters
toSysCoordinate system this transform returns points in.
Returns
true if a transform was removed; false otherwise.

Definition at line 322 of file Camera.cc.

◆ empty() [1/2]

bool lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::empty ( ) const
inlinenoexceptinherited

Determine if the collection contains any detectors.

Definition at line 72 of file DetectorCollection.h.

◆ empty() [2/2]

bool lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::empty ( ) const
inlinenoexceptinherited

Determine if the collection contains any detectors.

Definition at line 72 of file DetectorCollection.h.

◆ finish()

std::shared_ptr< Camera const > lsst::afw::cameraGeom::Camera::Builder::finish ( ) const

Construct a new Camera from the state of the Builder.

Definition at line 236 of file Camera.cc.

◆ get() [1/4]

Retrieve a detector by ID, or fall back to a default.

Parameters
[in]iddetector id
[in]defdefault detector to return. This defaults to nullptr.
Returns
pointer to detector entry if the entry exists, else return the default value

◆ get() [2/4]

Retrieve a detector by ID, or fall back to a default.

Parameters
[in]iddetector id
[in]defdefault detector to return. This defaults to nullptr.
Returns
pointer to detector entry if the entry exists, else return the default value

Definition at line 110 of file DetectorCollection.cc.

◆ get() [3/4]

Retrieve a detector by name, or fall back to a default.

Parameters
[in]namedetector name
[in]defdefault detector to return. This defaults to nullptr.
Returns
pointer to detector entry if the entry exists, else return the default value

◆ get() [4/4]

Retrieve a detector by name, or fall back to a default.

Parameters
[in]namedetector name
[in]defdefault detector to return. This defaults to nullptr.
Returns
pointer to detector entry if the entry exists, else return the default value

Definition at line 99 of file DetectorCollection.cc.

◆ getFocalPlaneParity()

bool lsst::afw::cameraGeom::Camera::Builder::getFocalPlaneParity ( ) const
inlinenoexcept

Return True if there is an x-axis flip from FOCAL_PLANE to FIELD_ANGLE, False otherwise.

Cameras with an even number of reflective surfaces (e.g. LATISS) or a particular choice for the PIXEL coordinates (e.g. DECam) require this x-axis flip between their FOCAL_PLANE and FIELD_ANGLE coordinate systems to match our conventions.

Definition at line 244 of file Camera.h.

◆ getIdMap() [1/2]

IdMap const & lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::getIdMap ( ) const
inlinenoexceptinherited

Get a map keyed and ordered by ID.

Definition at line 62 of file DetectorCollection.h.

◆ getIdMap() [2/2]

IdMap const & lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::getIdMap ( ) const
inlinenoexceptinherited

Get a map keyed and ordered by ID.

Definition at line 62 of file DetectorCollection.h.

◆ getName()

std::string lsst::afw::cameraGeom::Camera::Builder::getName ( ) const
inline

Return the name of the camera.

Definition at line 232 of file Camera.h.

◆ getNameMap() [1/2]

NameMap const & lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::getNameMap ( ) const
inlinenoexceptinherited

Get a map keyed and ordered by name.

Definition at line 59 of file DetectorCollection.h.

◆ getNameMap() [2/2]

NameMap const & lsst::afw::cameraGeom::DetectorCollectionBase< Detector::InCameraBuilder >::getNameMap ( ) const
inlinenoexceptinherited

Get a map keyed and ordered by name.

Definition at line 59 of file DetectorCollection.h.

◆ getPupilFactoryName()

std::string lsst::afw::cameraGeom::Camera::Builder::getPupilFactoryName ( ) const
inline

Return the fully-qualified name of the Python class that provides this Camera's PupilFactory.

Definition at line 238 of file Camera.h.

◆ operator[]() [1/4]

Implement the [id] operator.

Parameters
[in]iddetector name
Returns
pointer to detector entry

◆ operator[]() [2/4]

Implement the [id] operator.

Parameters
[in]iddetector name
Returns
pointer to detector entry

Definition at line 88 of file DetectorCollection.cc.

◆ operator[]() [3/4]

Implement the [name] operator.

Parameters
[in]namedetector name
Returns
pointer to detector entry

◆ operator[]() [4/4]

Implement the [name] operator.

Parameters
[in]namedetector name
Returns
pointer to detector entry

Definition at line 80 of file DetectorCollection.cc.

◆ remove() [1/2]

void lsst::afw::cameraGeom::Camera::Builder::remove ( int id)
inline

Definition at line 305 of file Camera.h.

◆ remove() [2/2]

void lsst::afw::cameraGeom::Camera::Builder::remove ( std::string const & name)
inline

Remove the detector with the given name or ID.

Wrapped as __delitem__ in Python.

Exceptions
pex::exceptions::NotFoundErrorif no such detector exists.

Definition at line 304 of file Camera.h.

◆ setFocalPlaneParity()

void lsst::afw::cameraGeom::Camera::Builder::setFocalPlaneParity ( bool flipX)

Set whether an x-axis flip should be included in the FOCAL_PLANE to FIELD_ANGLE transform.

When a Camera is constructed from this Builder via the finish, method, the current parity of the FOCAL_PLANE to FIELD_ANGLE transform is checked. If the set focal plane parity is true but the transform has a positive determinant, or if the set focal plane parity is false but the transform has a negative determinant, the built camera's transform will compose an x-coordinate flip to the builder's transform. Note that there is no other checking that these coordinate systems have aligned axes or that any existing parity flip is along the X axis (as should be the case).

Definition at line 234 of file Camera.cc.

◆ setName()

void lsst::afw::cameraGeom::Camera::Builder::setName ( std::string const & name)
inline

Set the name of the camera.

Definition at line 235 of file Camera.h.

◆ setPupilFactoryName()

void lsst::afw::cameraGeom::Camera::Builder::setPupilFactoryName ( std::string const & pupilFactoryName)
inline

Set the fully-qualified name of the Python class that provides this Camera's PupilFactory.

Definition at line 241 of file Camera.h.

◆ setTransformFromFocalPlaneTo()

void lsst::afw::cameraGeom::Camera::Builder::setTransformFromFocalPlaneTo ( CameraSys const & toSys,
std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform )

Set the transformation from FOCAL_PLANE to the given coordinate system.

Parameters
toSysCoordinate system this transform returns points in.
transformTransform from FOCAL_PLANE to toSys.

If a transform already exists from FOCAL_PLANE to toSys, it is overwritten.

Definition at line 306 of file Camera.cc.

◆ size() [1/2]

Get the number of detectors.

Renamed to __len__ in Python.

Definition at line 67 of file DetectorCollection.h.

◆ size() [2/2]

Get the number of detectors.

Renamed to __len__ in Python.

Definition at line 67 of file DetectorCollection.h.


The documentation for this class was generated from the following files: