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:
configlsst.cbp.CoordinateConverterConfig

Telescope and CBP configuration.

maskInfolsst.cbp.MaskInfo

Information about the CBP mask.

cameralsst.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 as offsetDetectorPos, to offset the current beam arrangement.

This computes new values for telescope and CBP pointing, as attributes telAzAltObserved, telRotObserved and cbpAzAltObserved. 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 attribute beamNames 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 mask

  • config.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 and setFocalFieldAngle 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 and cbpAzAltObserved). 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 and offsetFocalFieldAngle 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 and cbpAzAltObserved). 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:
beamstr

Beam name; ignored if holePos specified.

holePospair of float (optional)

Hole position on CBP mask (x, y mm); defaults to the actual hole position of the named beam.

Returns:
beamInfolsst.cbp.BeamInfo

Information about the specified beam.

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:
pupilOffsetpair of float (optional)

Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).

detectorOffsetpair 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).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilOffsetpair of float (optional)

Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).

focalFieldAngleOffsetpair of float (optional)

Offset of the focal plane field angle of the specified beam (x, y mm); defaults to (0, 0).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilOffsetpair of float (optional)

Offset of the position of the specified beam on the telescope pupil (x, y mm); defaults to (0, 0).

focalPlaneOffsetpair of float (optional)

Offset of the position of the specified spot on the focal plane (x, y mm); defaults to (0, 0).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilPospair of float

Position of the specified beam on the telescope pupil (x, y mm).

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

detectorstr (optional

Name of detector; defaults to self.config.defaultDetector.

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilPospair of float

Position of the specified beam on the telescope pupil (x, y mm).

focalFieldAnglepair of float (optional)

Focal plane field angle of the specified beam (x, y rad); defaults to (0, 0).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilPospair of float

Position of the specified beam on the telescope pupil (x, y mm)

focalPlanePospair of float (optional).

Focal plane position of the spot formed by the specified beam (x, y mm); defaults to (0, 0).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.

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:
pupilPospair of float

Position of the specified beam on the telescope pupil (x, y mm).

pupilFieldAnglepair of float (optional)

Pupil field angle of specified beam (x, y rad); defaults to (0, 0).

beamint or str (optional)

Name or index of beam; defaults to self.maskInfo.defaultBeam.