LSST Applications g044012fb7c+6976b5ec80,g04a91732dc+88a5fc122b,g07dc498a13+7e3c5f68a2,g114c6a66ad+09472d7a76,g1409bbee79+7e3c5f68a2,g1a7e361dbc+7e3c5f68a2,g1fd858c14a+3a43eabc0e,g35bb328faa+fcb1d3bbc8,g3bd4b5ce2c+2647bb081c,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g5477a8d5ce+b19c77c7ae,g58d0cdf3ff+4a2e102ff8,g60b5630c4e+09472d7a76,g623d845a50+09472d7a76,g6f0c2978f1+fcf1c0bcd6,g71fabbc107+09472d7a76,g75b6c65c88+d0b1dc44cc,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+349c7e81d4,g89139ef638+7e3c5f68a2,g9125e01d80+fcb1d3bbc8,g95236ca021+f7a31438ed,g989de1cb63+7e3c5f68a2,g9f33ca652e+f17d666fbc,gaaedd4e678+7e3c5f68a2,gabe3b4be73+1e0a283bba,gb1101e3267+f870f33517,gb58c049af0+f03b321e39,gc99c83e5f0+76d20ab76d,gcf25f946ba+349c7e81d4,gd0fa69b896+f3a65fa83c,gd6cbbdb0b4+c8606af20c,gde0f65d7ad+5bd27d919f,ge278dab8ac+932305ba37,gfba249425e+fcb1d3bbc8,w.2025.07
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst::afw::cameraGeom Namespace Reference

Namespaces

namespace  _amplifier
 
namespace  _assembleImage
 
namespace  _camera
 
namespace  _cameraFactory
 
namespace  _cameraGeomEnumDicts
 
namespace  _detector
 
namespace  _detectorCollection
 
namespace  _makePixelToTanPixel
 
namespace  _rotateBBoxBy90
 
namespace  _transformConfig
 
namespace  cameraConfig
 
namespace  pupil
 
namespace  testUtils
 
namespace  utils
 

Classes

class  Amplifier
 Geometry and electronic information about raw amplifier images. More...
 
class  Camera
 An immutable representation of a camera. More...
 
class  CameraSys
 Camera coordinate system; used as a key in in TransformMap. More...
 
class  CameraSysPrefix
 Camera coordinate system prefix. More...
 
class  Detector
 A representation of a detector in a mosaic camera. More...
 
class  DetectorBase
 An abstract base class that provides common accessors for Detector and Detector::Builder. More...
 
class  DetectorCollection
 An immutable collection of Detectors that can be accessed by name or ID. More...
 
class  DetectorCollectionBase
 An abstract base class for collections of Detectors and specific subclasses thereof. More...
 
class  Orientation
 Describe a detector's orientation in the focal plane. More...
 
class  TransformMap
 A registry of 2-dimensional coordinate transforms for a specific camera. More...
 

Typedefs

using PyAmplifier = py::class_<Amplifier, std::shared_ptr<Amplifier>>
 
using PyAmplifierBuilder = py::class_<Amplifier::Builder, Amplifier, std::shared_ptr<Amplifier::Builder>>
 
using PyCamera = py::class_<Camera, DetectorCollection, std::shared_ptr<Camera>>
 
using PyCameraBuilder
 

Enumerations

enum class  ReadoutCorner { LL , LR , UR , UL }
 Readout corner, in the frame of reference of the assembled image. More...
 
enum class  AssemblyState { RAW , SCIENCE }
 Assembly state of the amplifier, used to identify bounding boxes and component existence. More...
 
enum class  DetectorType { SCIENCE , FOCUS , GUIDER , WAVEFRONT }
 Type of imaging detector. More...
 

Functions

void swap (CameraSys &a, CameraSys &b)
 
std::ostreamoperator<< (std::ostream &os, CameraSysPrefix const &detSysPrefix)
 
std::ostreamoperator<< (std::ostream &os, CameraSys const &cameraSys)
 
std::ostreamoperator<< (std::ostream &os, TransformMap::Connection const &connection)
 
void wrapAmplifier (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapCamera (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapCameraSys (lsst::cpputils::python::WrapperCollection &)
 
void wrapDetector (lsst::cpputils::python::WrapperCollection &)
 
void wrapDetectorCollection (lsst::cpputils::python::WrapperCollection &)
 
void wrapOrientation (lsst::cpputils::python::WrapperCollection &)
 
void wrapTransformMap (lsst::cpputils::python::WrapperCollection &)
 
 PYBIND11_MODULE (_cameraGeom, mod)
 

Variables

CameraSys const FOCAL_PLANE = CameraSys("FocalPlane")
 Focal plane coordinates: Position on a 2-d planar approximation to the focal plane (x,y mm).
 
CameraSys const FIELD_ANGLE = CameraSys("FieldAngle")
 Field angle coordinates: Angle of a principal ray relative to the optical axis (x,y radians).
 
CameraSysPrefix const PIXELS = CameraSysPrefix("Pixels")
 Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).
 
CameraSysPrefix const TAN_PIXELS = CameraSysPrefix("TanPixels")
 Tangent-plane pixels on the detector (x, y unbinned pixels)
 
CameraSysPrefix const ACTUAL_PIXELS = CameraSysPrefix("ActualPixels")
 The actual pixels where the photon lands and electrons are generated (x,y unbinned) This takes into account manufacturing defects, "tree ring" distortions and other such effects.
 
str NullLinearityType = "None"
 

Detailed Description

Application Framework classes to handle a mosaic camera's geometry

Typedef Documentation

◆ PyAmplifier

Definition at line 40 of file _amplifier.cc.

◆ PyAmplifierBuilder

◆ PyCamera

Definition at line 39 of file _camera.cc.

◆ PyCameraBuilder

Initial value:
py::class_<Camera::Builder, DetectorCollectionBase<Detector::InCameraBuilder>,

Definition at line 40 of file _camera.cc.

Enumeration Type Documentation

◆ AssemblyState

Assembly state of the amplifier, used to identify bounding boxes and component existence.

Enumerator
RAW 
SCIENCE 

Definition at line 48 of file Amplifier.h.

◆ DetectorType

Type of imaging detector.

Enumerator
SCIENCE 
FOCUS 
GUIDER 
WAVEFRONT 

Definition at line 44 of file Detector.h.

◆ ReadoutCorner

Readout corner, in the frame of reference of the assembled image.

Enumerator
LL 
LR 
UR 
UL 

Definition at line 38 of file Amplifier.h.

Function Documentation

◆ operator<<() [1/3]

std::ostream & lsst::afw::cameraGeom::operator<< ( std::ostream & os,
CameraSys const & cameraSys )

Definition at line 52 of file CameraSys.cc.

52 {
53 os << "CameraSys(" << cameraSys.getSysName();
54 if (cameraSys.hasDetectorName()) {
55 os << ", " << cameraSys.getDetectorName();
56 }
57 os << ")";
58 return os;
59}

◆ operator<<() [2/3]

std::ostream & lsst::afw::cameraGeom::operator<< ( std::ostream & os,
CameraSysPrefix const & detSysPrefix )

Definition at line 47 of file CameraSys.cc.

47 {
48 os << "CameraSysPrefix(" << camSysPrefix.getSysName() << ")";
49 return os;
50}

◆ operator<<() [3/3]

std::ostream & lsst::afw::cameraGeom::operator<< ( std::ostream & os,
TransformMap::Connection const & connection )

Definition at line 169 of file TransformMap.cc.

169 {
170 return os << connection.fromSys << "->" << connection.toSys;
171}

◆ PYBIND11_MODULE()

lsst::afw::cameraGeom::PYBIND11_MODULE ( _cameraGeom ,
mod  )

Definition at line 38 of file _cameraGeom.cc.

38 {
39 lsst::cpputils::python::WrapperCollection wrappers(mod, "lsst.afw.cameraGeom");
40 wrapAmplifier(wrappers);
41 wrapDetectorCollection(wrappers);
42 wrapDetector(wrappers);
43 wrapCamera(wrappers);
44 wrapCameraSys(wrappers);
45 wrapOrientation(wrappers);
46 wrapTransformMap(wrappers);
47 wrappers.finish();
48}
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
void wrapCameraSys(lsst::cpputils::python::WrapperCollection &)
Definition _cameraSys.cc:63
void wrapOrientation(lsst::cpputils::python::WrapperCollection &)
void wrapTransformMap(lsst::cpputils::python::WrapperCollection &)
void wrapCamera(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _camera.cc:47
void wrapDetectorCollection(lsst::cpputils::python::WrapperCollection &)
void wrapDetector(lsst::cpputils::python::WrapperCollection &)
Definition _detector.cc:194
void wrapAmplifier(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _amplifier.cc:43

◆ swap()

void lsst::afw::cameraGeom::swap ( CameraSys & a,
CameraSys & b )
inline

Definition at line 157 of file CameraSys.h.

157 {
158 a.swap(b);
159}

◆ wrapAmplifier()

void lsst::afw::cameraGeom::wrapAmplifier ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 43 of file _amplifier.cc.

43 {
44 wrappers.addInheritanceDependency("lsst.afw.table");
45 wrappers.wrapType(py::enum_<ReadoutCorner>(wrappers.module, "ReadoutCorner"), [](auto &mod, auto &enm) {
46 enm.value("LL", ReadoutCorner::LL);
47 enm.value("LR", ReadoutCorner::LR);
48 enm.value("UR", ReadoutCorner::UR);
49 enm.value("UL", ReadoutCorner::UL);
50 });
51 wrappers.wrapType(py::enum_<AssemblyState>(wrappers.module, "AssemblyState"), [](auto &mod, auto &enm) {
52 enm.value("RAW", AssemblyState::RAW);
53 enm.value("SCIENCE", AssemblyState::SCIENCE);
54 });
55 auto amplifier = wrappers.wrapType(PyAmplifier(wrappers.module, "Amplifier"), [](auto &mod, auto &cls) {
56 cls.def_static("getRecordSchema", &Amplifier::getRecordSchema);
57 cls.def("toRecord", &Amplifier::toRecord);
58 cls.def("rebuild", &Amplifier::rebuild);
59 cls.def("getName", &Amplifier::getName);
60 cls.def("getBBox", &Amplifier::getBBox);
61 cls.def("getGain", &Amplifier::getGain);
62 cls.def("getReadNoise", &Amplifier::getReadNoise);
63 cls.def("getSaturation", &Amplifier::getSaturation);
64 cls.def("getSuspectLevel", &Amplifier::getSuspectLevel);
65 cls.def("getReadoutCorner", &Amplifier::getReadoutCorner);
66 cls.def("getLinearityCoeffs", &Amplifier::getLinearityCoeffs);
67 cls.def("getLinearityType", &Amplifier::getLinearityType);
68 cls.def("getLinearityThreshold", &Amplifier::getLinearityThreshold);
69 cls.def("getLinearityMaximum", &Amplifier::getLinearityMaximum);
70 cls.def("getLinearityUnits", &Amplifier::getLinearityUnits);
71 cls.def("getRawBBox", &Amplifier::getRawBBox);
72 cls.def("getRawDataBBox", &Amplifier::getRawDataBBox);
73 cls.def("getRawFlipX", &Amplifier::getRawFlipX);
74 cls.def("getRawFlipY", &Amplifier::getRawFlipY);
75 cls.def("getRawXYOffset", &Amplifier::getRawXYOffset);
76 cls.def("getRawHorizontalOverscanBBox", &Amplifier::getRawHorizontalOverscanBBox);
77 cls.def("getRawVerticalOverscanBBox", &Amplifier::getRawVerticalOverscanBBox);
78 cls.def("getRawPrescanBBox", &Amplifier::getRawPrescanBBox);
79 cls.def("getRawSerialOverscanBBox", &Amplifier::getRawSerialOverscanBBox);
80 cls.def("getRawParallelOverscanBBox", &Amplifier::getRawParallelOverscanBBox);
81 cls.def("getRawSerialPrescanBBox", &Amplifier::getRawSerialPrescanBBox);
82 cls.def("getRawHorizontalPrescanBBox", &Amplifier::getRawHorizontalPrescanBBox);
83 });
84 wrappers.wrapType(PyAmplifierBuilder(amplifier, "Builder"), [](auto &mod, auto &cls) {
85 cls.def_static("fromRecord", &Amplifier::Builder::fromRecord);
86 cls.def(py::init());
87 cls.def("finish", &Amplifier::Builder::finish);
88 cls.def("assign", [](Amplifier::Builder &self, Amplifier const &other) { self = other; });
89 cls.def("setName", &Amplifier::Builder::setName, "name"_a);
90 cls.def("setBBox", &Amplifier::Builder::setBBox, "bbox"_a);
91 cls.def("setGain", &Amplifier::Builder::setGain, "gain"_a);
92 cls.def("setReadNoise", &Amplifier::Builder::setReadNoise, "readNoise"_a);
93 cls.def("setSaturation", &Amplifier::Builder::setSaturation, "saturation"_a);
94 cls.def("setSuspectLevel", &Amplifier::Builder::setSuspectLevel, "suspectLevel"_a);
95 cls.def("setReadoutCorner", &Amplifier::Builder::setReadoutCorner, "corner"_a);
96 cls.def("setLinearityCoeffs", &Amplifier::Builder::setLinearityCoeffs, "coeffs"_a);
97 // Backwards compatibility: accept std::vector (list in Python) in
98 // addition to ndarray::Array (np.ndarray)
99 cls.def("setLinearityCoeffs", [](Amplifier::Builder &self, std::vector<double> const &coeffs) {
100 ndarray::Array<double, 1, 1> array = ndarray::allocate(coeffs.size());
101 std::copy(coeffs.begin(), coeffs.end(), array.begin());
102 self.setLinearityCoeffs(array);
103 });
104 cls.def("setLinearityType", &Amplifier::Builder::setLinearityType, "type"_a);
105 cls.def("setLinearityThreshold", &Amplifier::Builder::setLinearityThreshold, "threshold"_a);
106 cls.def("setLinearityMaximum", &Amplifier::Builder::setLinearityMaximum, "maximum"_a);
107 cls.def("setLinearityUnits", &Amplifier::Builder::setLinearityUnits, "units"_a);
108 cls.def("setRawBBox", &Amplifier::Builder::setRawBBox, "bbox"_a);
109 cls.def("setRawDataBBox", &Amplifier::Builder::setRawDataBBox, "bbox"_a);
110 cls.def("setRawFlipX", &Amplifier::Builder::setRawFlipX, "rawFlipX"_a);
111 cls.def("setRawFlipY", &Amplifier::Builder::setRawFlipY, "rawFlipY"_a);
112 cls.def("setRawXYOffset", &Amplifier::Builder::setRawXYOffset, "offset"_a);
113 cls.def("setRawHorizontalOverscanBBox", &Amplifier::Builder::setRawHorizontalOverscanBBox, "bbox"_a);
114 cls.def("setRawVerticalOverscanBBox", &Amplifier::Builder::setRawVerticalOverscanBBox, "bbox"_a);
115 cls.def("setRawPrescanBBox", &Amplifier::Builder::setRawPrescanBBox, "bbox"_a);
116 cls.def("setRawSerialOverscanBBox", &Amplifier::Builder::setRawSerialOverscanBBox, "bbox"_a);
117 cls.def("setRawParallelOverscanBBox", &Amplifier::Builder::setRawParallelOverscanBBox, "bbox"_a);
118 cls.def("setRawSerialPrescanBBox", &Amplifier::Builder::setRawSerialPrescanBBox, "bbox"_a);
119 cls.def("setRawHorizontalPrescanBBox", &Amplifier::Builder::setRawHorizontalPrescanBBox, "bbox"_a);
120 });
121}
T begin(T... args)
A mutable Amplifier subclass class that can be used to incrementally construct or modify Amplifiers.
Definition Amplifier.h:305
void setSaturation(double saturation)
Level in ADU above which pixels are considered saturated; use nan if no such level applies.
Definition Amplifier.h:360
void setRawParallelOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of parallel overscan pixels (equivalent to vertical overscan pixels) in the image to...
Definition Amplifier.h:421
void setBBox(lsst::geom::Box2I const &bbox)
Bounding box of amplifier pixels in the trimmed, assembled image.
Definition Amplifier.h:351
void setRawFlipY(bool rawFlipY)
Is this amplifier (and the image to which it is attached) flipped in the Y direction,...
Definition Amplifier.h:395
void setReadNoise(double readNoise)
Amplifier read noise, in e-.
Definition Amplifier.h:357
void setLinearityThreshold(double threshold)
Level in ADU above which linearity should be applied.
Definition Amplifier.h:377
void setLinearityCoeffs(ndarray::Array< double const, 1, 1 > const &coeffs)
Vector of linearity coefficients.
Definition Amplifier.h:369
void setRawSerialOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of serial overscan pixels (equivalent to horizontal overscan pixels) in the image to...
Definition Amplifier.h:416
void setRawHorizontalPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal/serial prescan pixels in the image to which it is attached,...
Definition Amplifier.h:431
static Builder fromRecord(table::BaseRecord const &record)
Construct a new Builder object from the fields in the given record.
Definition Amplifier.cc:286
void setRawHorizontalOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal overscan pixels in the image to which it is attached,...
Definition Amplifier.h:401
void setRawFlipX(bool rawFlipX)
Is this amplifier (and the image to which it is attached) flipped in the X direction,...
Definition Amplifier.h:392
void setGain(double gain)
Amplifier gain in e-/ADU.
Definition Amplifier.h:354
void setReadoutCorner(ReadoutCorner readoutCorner)
Readout corner in the trimmed, assembled image.
Definition Amplifier.h:366
void setRawDataBBox(lsst::geom::Box2I const &bbox)
Bounding box of amplifier data pixels in the image to which it is attached, which is assumed to be un...
Definition Amplifier.h:389
std::shared_ptr< Amplifier const > finish() const
Construct an immutable Amplifier with the same values as the Builder.
Definition Amplifier.cc:282
void setLinearityMaximum(double maximum)
Level in ADU above which the linearity relation is poorly defined.
Definition Amplifier.h:380
void setSuspectLevel(double suspectLevel)
Level in ADU above which pixels are considered suspicious, meaning they may be affected by unknown sy...
Definition Amplifier.h:363
void setLinearityType(std::string const &type)
Name of linearity parameterization.
Definition Amplifier.h:374
void setRawVerticalOverscanBBox(lsst::geom::Box2I const &bbox)
The bounding box of vertical overscan pixels in the image to which it is attached,...
Definition Amplifier.h:406
void setRawXYOffset(lsst::geom::Extent2I const &xy)
Offset in transformation from this amplifier (and the image to which it is attached) to trimmed,...
Definition Amplifier.h:398
void setRawPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of (horizontal) prescan pixels in the image to which it is attached,...
Definition Amplifier.h:411
void setRawSerialPrescanBBox(lsst::geom::Box2I const &bbox)
The bounding box of horizontal/serial prescan pixels in the image to which it is attached,...
Definition Amplifier.h:426
void setName(std::string const &name)
Name of the amplifier.
Definition Amplifier.h:348
void setLinearityUnits(std::string const &units)
Units for the input to the linearity relation (DN).
Definition Amplifier.h:383
void setRawBBox(lsst::geom::Box2I const &bbox)
Bounding box of the untrimmed amplifier in the image to which it is attached, which is assumed to be ...
Definition Amplifier.h:386
Geometry and electronic information about raw amplifier images.
Definition Amplifier.h:86
void addInheritanceDependency(std::string const &name)
Indicate an external module that provides a base class for a subsequent addType call.
Definition python.h:343
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
Definition python.h:391
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
Definition python.h:448
T copy(T... args)
T end(T... args)
py::class_< Amplifier, std::shared_ptr< Amplifier > > PyAmplifier
Definition _amplifier.cc:40
py::class_< Amplifier::Builder, Amplifier, std::shared_ptr< Amplifier::Builder > > PyAmplifierBuilder
Definition _amplifier.cc:41
T size(T... args)

◆ wrapCamera()

void lsst::afw::cameraGeom::wrapCamera ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 47 of file _camera.cc.

47 {
48 wrappers.addInheritanceDependency("lsst.afw.table.io");
49 wrappers.addSignatureDependency("lsst.afw.cameraGeom");
50 auto camera = wrappers.wrapType(PyCamera(wrappers.module, "Camera"), [](auto &mod, auto &cls) {
51 cls.def("rebuild", &Camera::rebuild);
52 cls.def("getName", &Camera::getName);
53 cls.def("getPupilFactoryName", &Camera::getPupilFactoryName);
54 cls.def("findDetectors", &Camera::findDetectors, "point"_a, "cameraSys"_a);
55 cls.def("findDetectorsList", &Camera::findDetectorsList, "pointList"_a, "cameraSys"_a);
56 // transform methods are wrapped with lambdas that translate exceptions for backwards compatibility
57 cls.def(
58 "getTransform",
59 [](Camera const &self, CameraSys const &fromSys, CameraSys const &toSys) {
60 try {
61 return self.getTransform(fromSys, toSys);
62 } catch (pex::exceptions::NotFoundError &err) {
63 PyErr_SetString(PyExc_KeyError, err.what());
64 throw py::error_already_set();
65 }
66 },
67 "fromSys"_a, "toSys"_a);
68 cls.def("getTransformMap", &Camera::getTransformMap);
69 cls.def(
70 "transform",
71 [](Camera const &self, lsst::geom::Point2D const &point, CameraSys const &fromSys,
72 CameraSys const &toSys) {
73 try {
74 return self.transform(point, fromSys, toSys);
75 } catch (pex::exceptions::NotFoundError &err) {
76 PyErr_SetString(PyExc_KeyError, err.what());
77 throw py::error_already_set();
78 }
79 },
80 "point"_a, "fromSys"_a, "toSys"_a);
81 cls.def(
82 "transform",
83 [](Camera const &self, std::vector<lsst::geom::Point2D> const &points,
84 CameraSys const &fromSys, CameraSys const &toSys) {
85 try {
86 return self.transform(points, fromSys, toSys);
87 } catch (pex::exceptions::NotFoundError &err) {
88 PyErr_SetString(PyExc_KeyError, err.what());
89 throw py::error_already_set();
90 }
91 },
92 "points"_a, "fromSys"_a, "toSys"_a);
94 });
95 wrappers.wrapType(PyCameraBuilder(camera, "Builder"), [](auto &mod, auto &cls) {
96 cls.def(py::init<std::string const &>(), "name"_a);
97 cls.def(py::init<Camera const &>(), "camera"_a);
98 cls.def("finish", &Camera::Builder::finish);
99 cls.def("getName", &Camera::Builder::getName);
100 cls.def("setName", &Camera::Builder::setName);
101 cls.def("getPupilFactoryName", &Camera::Builder::getPupilFactoryName);
102 cls.def("setPupilFactoryName", &Camera::Builder::setPupilFactoryName);
103 cls.def("setPupilFactoryClass", [](Camera::Builder &self, py::object pupilFactoryClass) {
104 std::string pupilFactoryName = "lsst.afw.cameraGeom.pupil.PupilFactory";
105 if (!pupilFactoryClass.is(py::none())) {
106 pupilFactoryName = py::str("{}.{}").format(pupilFactoryClass.attr("__module__"),
107 pupilFactoryClass.attr("__name__"));
108 }
109 self.setPupilFactoryName(pupilFactoryName);
110 });
111 cls.def("setTransformFromFocalPlaneTo", &Camera::Builder::setTransformFromFocalPlaneTo, "toSys"_a,
112 "transform"_a);
113 cls.def("discardTransformFromFocalPlaneTo", &Camera::Builder::discardTransformFromFocalPlaneTo);
114 cls.def("add", &Camera::Builder::add);
115 cls.def("__delitem__", py::overload_cast<int>(&Camera::Builder::remove));
116 cls.def("__delitem__", py::overload_cast<std::string const &>(&Camera::Builder::remove));
117 });
118}
A helper class for creating and modifying cameras.
Definition Camera.h:208
void setPupilFactoryName(std::string const &pupilFactoryName)
Set the fully-qualified name of the Python class that provides this Camera's PupilFactory.
Definition Camera.h:239
void setTransformFromFocalPlaneTo(CameraSys const &toSys, std::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > transform)
Set the transformation from FOCAL_PLANE to the given coordinate system.
Definition Camera.cc:311
std::string getName() const
Return the name of the camera.
Definition Camera.h:230
std::string getPupilFactoryName() const
Return the fully-qualified name of the Python class that provides this Camera's PupilFactory.
Definition Camera.h:236
std::shared_ptr< Detector::InCameraBuilder > add(std::string const &name, int id)
Add a new Detector with the given name and ID.
Definition Camera.cc:341
void remove(std::string const &name)
Remove the detector with the given name or ID.
Definition Camera.h:283
bool discardTransformFromFocalPlaneTo(CameraSys const &toSys)
Remove any transformation from FOCAL_PLANE to the given coordinate system.
Definition Camera.cc:332
void setName(std::string const &name)
Set the name of the camera.
Definition Camera.h:233
std::shared_ptr< Camera const > finish() const
Construct a new Camera from the state of the Builder.
Definition Camera.cc:246
An immutable representation of a camera.
Definition Camera.h:43
std::shared_ptr< TransformMap const > getTransformMap() const noexcept
Obtain the transform registry.
Definition Camera.h:120
lsst::geom::Point2D transform(lsst::geom::Point2D const &point, CameraSys const &fromSys, CameraSys const &toSys) const
Transform a point from one camera coordinate system to another.
Definition Camera.cc:83
Camera coordinate system; used as a key in in TransformMap.
Definition CameraSys.h:83
void addSignatureDependency(std::string const &name)
Indicate an external module that provides a type used in function/method signatures.
Definition python.h:357
virtual char const * what(void) const noexcept
Return a character string summarizing this exception.
Definition Exception.cc:99
Reports attempts to access elements using an invalid key.
Definition Runtime.h:151
py::class_< Camera, DetectorCollection, std::shared_ptr< Camera > > PyCamera
Definition _camera.cc:39
py::class_< Camera::Builder, DetectorCollectionBase< Detector::InCameraBuilder >, std::shared_ptr< Camera::Builder > > PyCameraBuilder
Definition _camera.cc:40
void addPersistableMethods(pybind11::class_< Class, Args... > &cls)
Add table::io::Persistable and PersistableFacade methods to the pybind11 wrapper for a class.
Definition python.h:56
Point< double, 2 > Point2D
Definition Point.h:324

◆ wrapCameraSys()

void lsst::afw::cameraGeom::wrapCameraSys ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 63 of file _cameraSys.cc.

63 {
64 /* Module level */
65 wrappers.wrapType(py::class_<CameraSysPrefix>(wrappers.module, "CameraSysPrefix"),
66 [](auto &mod, auto &cls) {
67 declareCommonSysMethods<CameraSysPrefix>(cls);
68 cls.def(py::init<std::string const &>(), "sysName"_a);
69 });
70 wrappers.wrapType(py::class_<CameraSys>(wrappers.module, "CameraSys"), [](auto &mod, auto &cls) {
71 declareCommonSysMethods<CameraSys>(cls);
72 /* Constructors */
73 cls.def(py::init<std::string const &>(), "sysName"_a);
74 cls.def(py::init<std::string const &, std::string const &>(), "sysName"_a, "detectorName"_a = "");
75 cls.def(py::init<CameraSysPrefix const &, std::string const &>(), "sysPrefix"_a,
76 "detectorName"_a = "");
77 /* Members */
78 cls.def("getDetectorName", &CameraSys::getDetectorName);
79 cls.def("hasDetectorName", &CameraSys::hasDetectorName);
80 });
81
82 // The following must come after the associated pybind11 class is declared
83 // (e.g. FOCAL_PLANE is a CameraSys, so clsCameraSys must have been declared
84 wrappers.wrap([](auto &mod) {
85 mod.attr("FOCAL_PLANE") = py::cast(FOCAL_PLANE);
86 mod.attr("FIELD_ANGLE") = py::cast(FIELD_ANGLE);
87 mod.attr("PIXELS") = py::cast(PIXELS);
88 mod.attr("TAN_PIXELS") = py::cast(TAN_PIXELS);
89 mod.attr("ACTUAL_PIXELS") = py::cast(ACTUAL_PIXELS);
90 });
91}
void wrap(WrapperCallback function)
Add a set of wrappers without defining a class.
Definition python.h:369
CameraSys const FIELD_ANGLE
Field angle coordinates: Angle of a principal ray relative to the optical axis (x,...
Definition CameraSys.cc:32
CameraSysPrefix const TAN_PIXELS
Tangent-plane pixels on the detector (x, y unbinned pixels)
Definition CameraSys.cc:36
CameraSys const FOCAL_PLANE
Focal plane coordinates: Position on a 2-d planar approximation to the focal plane (x,...
Definition CameraSys.cc:30
CameraSysPrefix const PIXELS
Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).
Definition CameraSys.cc:34
CameraSysPrefix const ACTUAL_PIXELS
The actual pixels where the photon lands and electrons are generated (x,y unbinned) This takes into a...
Definition CameraSys.cc:38

◆ wrapDetector()

void lsst::afw::cameraGeom::wrapDetector ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 194 of file _detector.cc.

194 {
195 wrappers.addInheritanceDependency("lsst.afw.typehandling");
196 wrappers.wrapType(py::enum_<DetectorType>(wrappers.module, "DetectorType"), [](auto &mod, auto &enm) {
197 enm.value("SCIENCE", DetectorType::SCIENCE);
198 enm.value("FOCUS", DetectorType::FOCUS);
199 enm.value("GUIDER", DetectorType::GUIDER);
200 enm.value("WAVEFRONT", DetectorType::WAVEFRONT);
201 });
202 declareDetectorBase(wrappers);
203 declareDetector(wrappers);
204}

◆ wrapDetectorCollection()

void lsst::afw::cameraGeom::wrapDetectorCollection ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 66 of file _detectorCollection.cc.

66 {
67 wrappers.addInheritanceDependency("lsst.afw.table.io");
68 wrappers.wrapType(
69 PyDetectorCollectionBase<Detector const>(wrappers.module, "DetectorCollectionDetectorBase"),
70 [](auto &mod, auto &cls) { declareDetectorCollectionBase(cls); });
71 wrappers.wrapType(PyDetectorCollection(wrappers.module, "DetectorCollection"), [](auto &mod, auto &cls) {
72 ;
73 cls.def(py::init<DetectorCollection::List>());
74 cls.def("getFpBBox", &DetectorCollection::getFpBBox);
75 table::io::python::addPersistableMethods(cls);
76 });
77
78 wrappers.wrapType(PyDetectorCollectionBase<Detector::InCameraBuilder>(wrappers.module,
79 "DetectorCollectionBuilderBase"),
80 [](auto &mod, auto &cls) { declareDetectorCollectionBase(cls); });
81}

◆ wrapOrientation()

void lsst::afw::cameraGeom::wrapOrientation ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 36 of file _orientation.cc.

36 {
37 wrappers.addSignatureDependency("lsst.geom");
38 wrappers.wrapType(py::class_<Orientation>(wrappers.module, "Orientation"), [](auto &mod, auto &cls) {
39 /* Constructors */
40 cls.def(py::init<lsst::geom::Point3D, lsst::geom::Point2D, lsst::geom::Angle, lsst::geom::Angle,
41 lsst::geom::Angle>(),
42 "fpPosition"_a = lsst::geom::Point3D(0, 0, 0), "refPoint"_a = lsst::geom::Point2D(-0.5, -0.5),
43 "yaw"_a = lsst::geom::Angle(0), "pitch"_a = lsst::geom::Angle(0),
44 "roll"_a = lsst::geom::Angle(0));
45
46 cls.def(py::init<lsst::geom::Point2D, lsst::geom::Point2D, lsst::geom::Angle, lsst::geom::Angle,
47 lsst::geom::Angle>(),
48 "fpPosition"_a, "refPoint"_a = lsst::geom::Point2D(-0.5, -0.5),
49 "yaw"_a = lsst::geom::Angle(0), "pitch"_a = lsst::geom::Angle(0),
50 "roll"_a = lsst::geom::Angle(0));
51
52 /* Operators */
53
54 /* Members */
55 cls.def("getFpPosition", &Orientation::getFpPosition);
56 cls.def("getFpPosition3", &Orientation::getFpPosition3);
57 cls.def("getReferencePoint", &Orientation::getReferencePoint);
58 cls.def("getHeight", &Orientation::getHeight);
59 cls.def("getYaw", &Orientation::getYaw);
60 cls.def("getPitch", &Orientation::getPitch);
61 cls.def("getRoll", &Orientation::getRoll);
62 cls.def("getNQuarter", &Orientation::getNQuarter);
63 cls.def("makePixelFpTransform", &Orientation::makePixelFpTransform, "pixelSizeMm"_a);
64 cls.def("makeFpPixelTransform", &Orientation::makeFpPixelTransform, "pixelSizeMm"_a);
65 });
66}

◆ wrapTransformMap()

void lsst::afw::cameraGeom::wrapTransformMap ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 93 of file _transformMap.cc.

93{ declareTransformMap(wrappers); }

Variable Documentation

◆ ACTUAL_PIXELS

CameraSysPrefix const lsst::afw::cameraGeom::ACTUAL_PIXELS = CameraSysPrefix("ActualPixels")

The actual pixels where the photon lands and electrons are generated (x,y unbinned) This takes into account manufacturing defects, "tree ring" distortions and other such effects.

This is a detector prefix; call Detector.makeCameraSys(ACTUAL_PIXELS) to make a full CameraSys.

Definition at line 38 of file CameraSys.cc.

◆ FIELD_ANGLE

CameraSys const lsst::afw::cameraGeom::FIELD_ANGLE = CameraSys("FieldAngle")

Field angle coordinates: Angle of a principal ray relative to the optical axis (x,y radians).

The orientation of the x,y axes is the same as FOCAL_PLANE.

Definition at line 32 of file CameraSys.cc.

◆ FOCAL_PLANE

CameraSys const lsst::afw::cameraGeom::FOCAL_PLANE = CameraSys("FocalPlane")

Focal plane coordinates: Position on a 2-d planar approximation to the focal plane (x,y mm).

The origin and orientation may be defined by the camera team, but we strongly recommend that the origin be on the optical axis and (if using CCD detectors) that the X axis be aligned along CCD rows.

Note
Location and orientation of detectors are defined in a 3-d version of FOCAL_PLANE coordinates (the z axis is also relevant). Rectilinear x, y (and z when talking about the location of a detector) on the camera focal plane (mm). For z=0 choose a convenient point near the focus at x, y = 0.

Definition at line 30 of file CameraSys.cc.

◆ NullLinearityType

str lsst.afw.cameraGeom.NullLinearityType = "None"

Definition at line 38 of file __init__.py.

◆ PIXELS

CameraSysPrefix const lsst::afw::cameraGeom::PIXELS = CameraSysPrefix("Pixels")

Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).

For CCD detectors the x axis must be along rows (the direction of the serial register). This is required for our interpolation algorithm to interpolate across bad columns.

This ignores manufacturing imperfections, "tree ring" distortions and all other such effects. It is a uniform grid of rectangular (usually square) pixels.

Warning
This is a detector prefix; call Detector.makeCameraSys(PIXELS) to make a full CameraSys.

Definition at line 34 of file CameraSys.cc.

◆ TAN_PIXELS

CameraSysPrefix const lsst::afw::cameraGeom::TAN_PIXELS = CameraSysPrefix("TanPixels")

Tangent-plane pixels on the detector (x, y unbinned pixels)

Converting from PIXELS to TAN_PIXELS has the effect of removing optical distortion (and the distortion due to rectangular pixels) with the point at the center of the detector being unaffected by the transformation.

In detail, PIXELS->TAN_PIXELS is PIXELS->FIELD_ANGLE plus an affine transformation, such that:

  • The x,y axes are parallel to the detector axes
  • The dimensions are nominal pixels at the center of the focal plane (where nominal pixels size is mean of x, y pixel size).
  • The point at the center of the detector has the same value in PIXELS and TAN_PIXELS

This is a detector prefix; call Detector.makeCameraSys(TAN_PIXELS) to make a full CameraSys.

Definition at line 36 of file CameraSys.cc.