LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
lsst::afw::cameraGeom Namespace Reference

Namespaces

 amplifier
 
 assembleImage
 
 camera
 
 cameraConfig
 
 cameraFactory
 
 cameraGeomEnumDicts
 
 cameraGeomLib
 
 detector
 
 detectorCollection
 
 makePixelToTanPixel
 
 pupil
 
 rotateBBoxBy90
 
 testUtils
 
 transformConfig
 
 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 PyCamera = py::class_< Camera, DetectorCollection, std::shared_ptr< Camera > >
 
using PyCameraBuilder = py::class_< Camera::Builder, DetectorCollectionBase< Detector::InCameraBuilder >, std::shared_ptr< Camera::Builder > >
 

Enumerations

enum  ReadoutCorner { ReadoutCorner::LL, ReadoutCorner::LR, ReadoutCorner::UR, ReadoutCorner::UL }
 Readout corner, in the frame of reference of the assembled image. More...
 
enum  AssemblyState { AssemblyState::RAW, AssemblyState::SCIENCE }
 Assembly state of the amplifier, used to identify bounding boxes and component existence. More...
 
enum  DetectorType { DetectorType::SCIENCE, DetectorType::FOCUS, DetectorType::GUIDER, DetectorType::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 declareCameraBuilder (PyCamera &parent)
 
void declareCamera (py::module &mod)
 
 PYBIND11_MODULE (camera, mod)
 
 PYBIND11_MODULE (cameraSys, mod)
 
 PYBIND11_MODULE (orientation, 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). More...
 
CameraSys const FIELD_ANGLE = CameraSys("FieldAngle")
 Field angle coordinates: Angle of a principal ray relative to the optical axis (x,y radians). More...
 
CameraSysPrefix const PIXELS = CameraSysPrefix("Pixels")
 Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels). More...
 
CameraSysPrefix const TAN_PIXELS = CameraSysPrefix("TanPixels")
 Tangent-plane pixels on the detector (x, y unbinned pixels) More...
 
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. More...
 
string NullLinearityType = "None"
 

Typedef Documentation

◆ PyCamera

Definition at line 36 of file camera.cc.

◆ PyCameraBuilder

Definition at line 37 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.

48  {
49  RAW,
50  SCIENCE,
51 };

◆ DetectorType

Type of imaging detector.

Enumerator
SCIENCE 
FOCUS 
GUIDER 
WAVEFRONT 

Definition at line 44 of file Detector.h.

44  {
45  SCIENCE,
46  FOCUS,
47  GUIDER,
48  WAVEFRONT,
49 };

◆ 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.

38  {
39  LL,
40  LR,
41  UR,
42  UL,
43 };

Function Documentation

◆ declareCamera()

void lsst::afw::cameraGeom::declareCamera ( py::module &  mod)

Definition at line 46 of file camera.cc.

46  {
47  PyCamera cls(mod, "Camera");
49  cls.def("rebuild", &Camera::rebuild);
50  cls.def("getName", &Camera::getName);
51  cls.def("getPupilFactoryName", &Camera::getPupilFactoryName);
52  cls.def("findDetectors", &Camera::findDetectors, "point"_a, "cameraSys"_a);
53  cls.def("findDetectorsList", &Camera::findDetectorsList, "pointList"_a, "cameraSys"_a);
54  // transform methods are wrapped with lambdas that translate exceptions for backwards compatibility
55  cls.def(
56  "getTransform",
57  [](Camera const & self, CameraSys const & fromSys, CameraSys const & toSys) {
58  try {
59  return self.getTransform(fromSys, toSys);
60  } catch (pex::exceptions::NotFoundError & err) {
61  PyErr_SetString(PyExc_KeyError, err.what());
62  throw py::error_already_set();
63  }
64  },
65  "fromSys"_a, "toSys"_a
66  );
67  cls.def("getTransformMap", &Camera::getTransformMap);
68  cls.def(
69  "transform",
70  [](
71  Camera const & self,
72  lsst::geom::Point2D const & point,
73  CameraSys const & fromSys,
74  CameraSys const & toSys
75  ) {
76  try {
77  return self.transform(point, fromSys, toSys);
78  } catch (pex::exceptions::NotFoundError & err) {
79  PyErr_SetString(PyExc_KeyError, err.what());
80  throw py::error_already_set();
81  }
82  },
83  "point"_a, "fromSys"_a, "toSys"_a
84  );
85  cls.def(
86  "transform",
87  [](
88  Camera const & self,
89  std::vector<lsst::geom::Point2D> const & points,
90  CameraSys const & fromSys,
91  CameraSys const & toSys
92  ) {
93  try {
94  return self.transform(points, fromSys, toSys);
95  } catch (pex::exceptions::NotFoundError & err) {
96  PyErr_SetString(PyExc_KeyError, err.what());
97  throw py::error_already_set();
98  }
99  },
100  "points"_a, "fromSys"_a, "toSys"_a
101  );
103 }

◆ declareCameraBuilder()

void lsst::afw::cameraGeom::declareCameraBuilder ( PyCamera parent)

Definition at line 105 of file camera.cc.

105  {
106  PyCameraBuilder cls(parent, "Builder");
107  cls.def(py::init<std::string const &>(), "name"_a);
108  cls.def(py::init<Camera const &>(), "camera"_a);
109  cls.def("finish", &Camera::Builder::finish);
110  cls.def("getName", &Camera::Builder::getName);
111  cls.def("setName", &Camera::Builder::setName);
112  cls.def("getPupilFactoryName", &Camera::Builder::getPupilFactoryName);
113  cls.def("setPupilFactoryName", &Camera::Builder::setPupilFactoryName);
114  cls.def("setPupilFactoryClass",
115  [](Camera::Builder & self, py::object pupilFactoryClass) {
116  std::string pupilFactoryName = "lsst.afw.cameraGeom.pupil.PupilFactory";
117  if (!pupilFactoryClass.is(py::none())) {
118  pupilFactoryName = py::str("{}.{}").format(
119  pupilFactoryClass.attr("__module__"),
120  pupilFactoryClass.attr("__name__")
121  );
122  }
123  self.setPupilFactoryName(pupilFactoryName);
124  });
125  cls.def("setTransformFromFocalPlaneTo", &Camera::Builder::setTransformFromFocalPlaneTo,
126  "toSys"_a, "transform"_a);
127  cls.def("discardTransformFromFocalPlaneTo",&Camera::Builder::discardTransformFromFocalPlaneTo);
128  cls.def("add", &Camera::Builder::add);
129  cls.def("__delitem__", py::overload_cast<int>(&Camera::Builder::remove));
130  cls.def("__delitem__", py::overload_cast<std::string const &>(&Camera::Builder::remove));
131 }

◆ 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 170 of file TransformMap.cc.

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

◆ PYBIND11_MODULE() [1/3]

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

Definition at line 133 of file camera.cc.

133  {
134  py::module::import("lsst.afw.cameraGeom.detectorCollection");
135  py::module::import("lsst.afw.cameraGeom.detector");
136  py::module::import("lsst.afw.cameraGeom.transformMap");
137 
138  declareCamera(mod);
139 }

◆ PYBIND11_MODULE() [2/3]

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

Definition at line 62 of file cameraSys.cc.

62  {
63  /* Module level */
64  py::class_<CameraSysPrefix> clsCameraSysPrefix(mod, "CameraSysPrefix");
65  py::class_<CameraSys> clsCameraSys(mod, "CameraSys");
66 
67  // The following must come after the associated pybind11 class is declared
68  // (e.g. FOCAL_PLANE is a CameraSys, so clsCameraSys must have been declared
69  mod.attr("FOCAL_PLANE") = py::cast(FOCAL_PLANE);
70  mod.attr("FIELD_ANGLE") = py::cast(FIELD_ANGLE);
71  mod.attr("PIXELS") = py::cast(PIXELS);
72  mod.attr("TAN_PIXELS") = py::cast(TAN_PIXELS);
73  mod.attr("ACTUAL_PIXELS") = py::cast(ACTUAL_PIXELS);
74 
75  /* Member types and enums */
76  declareCommonSysMethods<CameraSysPrefix>(clsCameraSysPrefix);
77  declareCommonSysMethods<CameraSys>(clsCameraSys);
78 
79  /* Constructors */
80  clsCameraSysPrefix.def(py::init<std::string const &>(), "sysName"_a);
81  clsCameraSys.def(py::init<std::string const &, std::string const &>(), "sysName"_a,
82  "detectorName"_a = "");
83  clsCameraSys.def(py::init<CameraSysPrefix const &, std::string const &>(), "sysPrefix"_a,
84  "detectorName"_a = "");
85 
86  /* Operators */
87 
88  /* Members */
89  clsCameraSys.def("getDetectorName", &CameraSys::getDetectorName);
90  clsCameraSys.def("hasDetectorName", &CameraSys::hasDetectorName);
91 }

◆ PYBIND11_MODULE() [3/3]

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

Definition at line 36 of file orientation.cc.

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

◆ 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 }

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

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

Definition at line 37 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.

std::string
STL class.
lsst::afw::cameraGeom::DetectorType::WAVEFRONT
@ WAVEFRONT
lsst::afw::cameraGeom::AssemblyState::SCIENCE
@ SCIENCE
lsst::afw::cameraGeom::ReadoutCorner::LR
@ LR
lsst::afw::table::io::python::addPersistableMethods
void addPersistableMethods(pybind11::class_< Class, Args... > &cls)
Add table::io::Persistable and PersistableFacade methods to the pybind11 wrapper for a class.
Definition: python.h:90
std::vector
STL class.
lsst::afw::cameraGeom::TAN_PIXELS
CameraSysPrefix const TAN_PIXELS
Tangent-plane pixels on the detector (x, y unbinned pixels)
Definition: CameraSys.cc:36
lsst::afw::geom.transform.transformContinued.cls
cls
Definition: transformContinued.py:33
lsst::afw::cameraGeom::ACTUAL_PIXELS
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
lsst::afw::cameraGeom::ReadoutCorner::UR
@ UR
lsst::afw::cameraGeom::declareCamera
void declareCamera(py::module &mod)
Definition: camera.cc:46
pupilFactoryName
table::Key< std::string > pupilFactoryName
Definition: Camera.cc:124
b
table::Key< int > b
Definition: TransmissionCurve.cc:467
lsst::afw::cameraGeom::PyCameraBuilder
py::class_< Camera::Builder, DetectorCollectionBase< Detector::InCameraBuilder >, std::shared_ptr< Camera::Builder > > PyCameraBuilder
Definition: camera.cc:38
lsst::afw::cameraGeom::ReadoutCorner::UL
@ UL
lsst::afw::cameraGeom::AssemblyState::RAW
@ RAW
lsst::afw::cameraGeom::declareCameraBuilder
void declareCameraBuilder(PyCamera &parent)
Definition: camera.cc:105
os
std::ostream * os
Definition: Schema.cc:746
lsst::afw::cameraGeom::ReadoutCorner::LL
@ LL
lsst::afw::cameraGeom::FOCAL_PLANE
CameraSys const FOCAL_PLANE
Focal plane coordinates: Position on a 2-d planar approximation to the focal plane (x,...
Definition: CameraSys.cc:30
lsst::afw::cameraGeom::PyCamera
py::class_< Camera, DetectorCollection, std::shared_ptr< Camera > > PyCamera
Definition: camera.cc:36
a
table::Key< int > a
Definition: TransmissionCurve.cc:466
lsst::geom::Point< double, 2 >
lsst::geom::Angle
A class representing an angle.
Definition: Angle.h:127
lsst::afw::cameraGeom::FIELD_ANGLE
CameraSys const FIELD_ANGLE
Field angle coordinates: Angle of a principal ray relative to the optical axis (x,...
Definition: CameraSys.cc:32
lsst::afw::cameraGeom::DetectorType::GUIDER
@ GUIDER
lsst::afw::cameraGeom::DetectorType::FOCUS
@ FOCUS
lsst::afw::cameraGeom::PIXELS
CameraSysPrefix const PIXELS
Pixel coordinates: Nominal position on the entry surface of a given detector (x, y unbinned pixels).
Definition: CameraSys.cc:34