CoordinateConverter¶
-
class
lsst.cbp.
CoordinateConverter
(config, maskInfo, cameraGeom)¶ Bases:
object
Coordinate conversions for the collimated beam projector (CBP).
This object supports the following tasks:
- Given a desired CBP “beam arrangement” (e.g. a particular beam should fall on a particular spot on the pupil and be focused to spot on a particular position of a detector), compute the necessary telescope and CBP pointing and the information about where each beam is directed.
- Given the current telescope and CBP pointing and a desired offset to the resulting CBP beam arrangement, compute the new telescope and CBP pointing.
See how to use this object for a summary of how to use this object.
Parameters: - config :
lsst.cbp.CoordinateConverterConfig
Telescope and CBP configuration.
- maskInfo :
lsst.cbp.MaskInfo
Information about the CBP mask.
- camera :
lsst.afw.cameraGeom.Camera
Camera geometry.
Notes
How to Use This Object
Call a set method, such as
setDetectorPos
to specify a desired CBP beam arrangement, or an offset method, such asoffsetDetectorPos
, to offset the current beam arrangement.This computes new values for telescope and CBP pointing, as attributes
telAzAltObserved
,telRotObserved
andcbpAzAltObserved
. Read these attributes and move the telescope and CBP accordingly.Get information about the beams. There are two ways to do this:
- To get information for all beams, iterate on this object
to get one
lsst.cbp.BeamInfo
per beam. Also the length of this object is the number of beams. - To get information for a specific beam, use
[beamNameOrIndex]
; see__getitem__
for details. Also attributebeamNames
provides an iterable of beam names.
That is basically it. However, it may also help to know the following:
Whenever the telescope, camera rotator or CBP are moved, you must update the appropriate attribute(s) accordingly. Otherwise the beam information will be incorrect and offset commands will not work as expected. After each such update you can read the new beam information as usual.
You are free to update configuration information at any time, by setting the appropriate attribute(s). The two items you are most likely to update are:
maskInfo
: set this when you change the maskconfig.telRotOffset
: set this if you want to correct the orientation of the spot pattern on the focal plane.
After updating configuration information, read the new beam information (and possibly new telescope and/or CBP position information, though few configuration parameters directly affect those) to see the effect of the change.
Set Methods
The methods
setFocalPlanePos
,setDetectorPos
andsetFocalFieldAngle
all allow you to specify the desired arrangement for one beam:- The position of the beam on the pupil.
- The position of the spot on the focal plane, expressed in different
- ways depending on the method. In most cases you will probably
want to specify the position of the spot in pixels on a sepecified
detector, in which case call
setFocalPlanePos
.
These set methods simply update the pointing of the telescope and CBP (
telAzAltObserved
,telRotObserved
andcbpAzAltObserved
). If you then move the telescope and CBP as suggested, the beam should have the arrangement you specified, and the spot pattern of all the beams should be aligned with the detectors.Offset Methods
The methods
offsetFocalPlanePos
,offsetDetectorPos
andoffsetFocalFieldAngle
all allow you to offset the arrangement for one beam:- Offset the position of the beam on the pupil.
- Offset the position of the spot on the focal plane,
- expressed in different ways depending on the method.
In most cases you will probably want to specify
the offset of the spot in pixels on a sepecified detector,
in which case call
offsetFocalPlanePos
.
These offset methods simply update the pointing of the telescope and CBP (
telAzAltObserved
,telRotObserved
andcbpAzAltObserved
). If you then move the telescope and CBP as suggested, the beam should have the arrangement you specified, and the spot pattern of all the beams should be aligned with the detectors.Attributes Summary
beamNames
Beam names, in index order (read only). cbpAzAltInternal
Internal az/alt of the CBP (read only), as an lsst.geom.SpherePoint
.cbpAzAltObserved
Observed az/alt of the CBP (read/write), as an lsst.geom.SpherePoint`. cbpInBounds
True if CBP observed altitude is in bounds (read only). telAzAltInternal
Internal az/alt of the telescope (read only), as an lsst.geom.SpherePoint
.telAzAltObserved
Observed az/alt of the telescope (read/write), as an lsst.geom.SpherePoint
.telInBounds
True if telescope observed altitude is in bounds (read only). telRotInternal
Internal angle of the telescope camera rotator (read only), as an lsst.geom.SpherePoint
.telRotObserved
Observed angle of the telescope camera rotator (read/write), as an lsst.geom.Angle
.Methods Summary
getBeamInfo
(beam, *[, holePos])Get beam information for a beam from a specified CBP beam or hole position. offsetDetectorPos
([pupilOffset, …])Offset the detector position and/or pupil position of a beam. offsetFocalFieldAngle
([pupilOffset, …])Offset the focal plane field angle and/or pupil position of a beam. offsetFocalPlanePos
([pupilOffset, …])Offset the focal plane position and/or pupil position of a beam. setDetectorPos
(pupilPos[, detectorPos, …])Set the position of a spot on a detector. setFocalFieldAngle
(pupilPos[, …])Set the focal plane field angle of a beam. setFocalPlanePos
(pupilPos[, focalPlanePos, beam])Set the position of a spot on the focal plane. setPupilFieldAngle
(pupilPos[, …])Set the pupil field angle and pupil position of a beam. Attributes Documentation
-
beamNames
¶ Beam names, in index order (read only).
-
cbpAzAltInternal
¶ Internal az/alt of the CBP (read only), as an
lsst.geom.SpherePoint
.Primarily intended for testing.
-
cbpAzAltObserved
¶ Observed az/alt of the CBP (read/write), as an lsst.geom.SpherePoint`.
-
cbpInBounds
¶ True if CBP observed altitude is in bounds (read only).
-
telAzAltInternal
¶ Internal az/alt of the telescope (read only), as an
lsst.geom.SpherePoint
.Primarily intended for testing.
-
telAzAltObserved
¶ Observed az/alt of the telescope (read/write), as an
lsst.geom.SpherePoint
.
-
telInBounds
¶ True if telescope observed altitude is in bounds (read only).
-
telRotInternal
¶ Internal angle of the telescope camera rotator (read only), as an
lsst.geom.SpherePoint
.Primarily intended for testing.
-
telRotObserved
¶ Observed angle of the telescope camera rotator (read/write), as an
lsst.geom.Angle
.
Methods Documentation
-
getBeamInfo
(beam, *, holePos=None)¶ Get beam information for a beam from a specified CBP beam or hole position.
You may specify a hole position. This can be useful for unit tests and “what if” scenarios.
Parameters: Returns: - beamInfo :
lsst.cbp.BeamInfo
Information about the specified beam.
- beamInfo :
-
offsetDetectorPos
(pupilOffset=None, detectorOffset=None, beam=None)¶ Offset the detector position and/or pupil position of a beam.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilOffset : pair of
float
(optional) Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).
- detectorOffset : pair of
float
(optional) Offset of the position of the specified spot on the detector it is presently on (x, y pixels); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilOffset : pair of
-
offsetFocalFieldAngle
(pupilOffset=None, focalFieldAngleOffset=None, beam=None)¶ Offset the focal plane field angle and/or pupil position of a beam.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilOffset : pair of
float
(optional) Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).
- focalFieldAngleOffset : pair of
float
(optional) Offset of the focal plane field angle of the specified beam (x, y mm); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilOffset : pair of
-
offsetFocalPlanePos
(pupilOffset=None, focalPlaneOffset=None, beam=None)¶ Offset the focal plane position and/or pupil position of a beam.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilOffset : pair of
float
(optional) Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).
- focalPlaneOffset : pair of
float
(optional) Offset of the position of the specified spot on the focal plane (x, y mm); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilOffset : pair of
-
setDetectorPos
(pupilPos, detectorPos=None, detector=None, beam=None)¶ Set the position of a spot on a detector.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilPos : pair of
float
Position of the specified beam on the telescope pupil (x, y mm).
- detectorPos : pair of
float
(optional) Position of the spot formed by the specified beam on the specified detector (x, y pixels); defaults to the center of the detector.
- detector :
str
(optional Name of detector; defaults to self.config.defaultDetector.
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilPos : pair of
-
setFocalFieldAngle
(pupilPos, focalFieldAngle=None, beam=None)¶ Set the focal plane field angle of a beam.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilPos : pair of
float
Position of the specified beam on the telescope pupil (x, y mm).
- focalFieldAngle : pair of
float
(optional) Focal plane field angle of the specified beam (x, y rad); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to
self.maskInfo.defaultBeam
.
- pupilPos : pair of
-
setFocalPlanePos
(pupilPos, focalPlanePos=None, beam=None)¶ Set the position of a spot on the focal plane.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
Parameters: - pupilPos : pair of
float
Position of the specified beam on the telescope pupil (x, y mm)
- focalPlanePos : pair of
float
(optional). Focal plane position of the spot formed by the specified beam (x, y mm); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilPos : pair of
-
setPupilFieldAngle
(pupilPos, pupilFieldAngle=None, beam=None)¶ Set the pupil field angle and pupil position of a beam.
Compute new telescope, camera rotator and CBP positions and thus update beam info.
This method is primarily intended for internal use, to support the other set methods. It is public so it can be unit-tested.
Parameters: - pupilPos : pair of
float
Position of the specified beam on the telescope pupil (x, y mm).
- pupilFieldAngle : pair of
float
(optional) Pupil field angle of specified beam (x, y rad); defaults to (0, 0).
- beam :
int
orstr
(optional) Name or index of beam; defaults to self.maskInfo.defaultBeam.
- pupilPos : pair of