FocalPlane

FocalPlane objects can be constructed by hand, by passing in the positions and polarization angles of the detectors.

Factory function

The moby2.scripting.products module provides a function for getting best FocalPlane in many cases:

moby2.scripting.products.get_focal_plane(params, tod_info=None, det_uid=None, tod=None)[source]

Decode “params” dictionary and return a FocalPlane object. Optionally add polarization angle information and pointing offsets.

params is a dict with blocks describing different actions:

params = {
  'detector_offsets': {...},
  'polarization_angles': {...},
  'pointing_shifts': {...},
}

Parameters in detector_offsets are passed to get_detector_offsets; parameters in pol_source (if not None) are passed to get_polarization angles. Parameters in shift_generator are passed to get_pointing_offset.

E.g.:

params = {
  'detector_offsets': {
     'format': 'fp_file',
     'filename': 'template_ar1_130821s.txt' },
}

Depending on params, tod_info and stuff may be inspected.

Typical use cases are:

  1. You have a TOD and want the system default template:

params = {'source': 'template'}
fplane = moby2.scripting.products.get_focal_plane(params, tod_info=tod.info)
  1. You want to load an FPFitFile as a FocalPlane:

params = {'source': 'fp_file', 'filename': 'my_fp_fit.txt'}
fplane = moby2.scripting.products.get_focal_plane(params)

Documented methods

class moby2.pointing.FocalPlane(x=None, y=None, phi=None, mask=None, det_uid=None)[source]

The focal plane coordinate system is defined relative to a nominal boresight aligned with z^. x^ corresponds roughly to +azimuth, and y^ corresponds to +altitude. Yes, it’s sort of left-handed.

The angle “phi” describes the polarization angle and is defined, roughly, as the angle between the polarization axis and x^, increasing towards y^.

The “mask” is a boolean array indicating which channels have valid offsets. “det_uid” gives the detector id associated with each offset.

copy()[source]

Returns a FocalPlane that is a copy of self.

classmethod from_ACT_po_file(filename)[source]

Load pointing offsets from ACT-style pointingOffset file.

classmethod from_super_po_file(filename)[source]

Load pointing offsets from ACT-style multiOffset file.

get_coords(ctime, az, alt, fields=None, final_q=None, weather=None)[source]

Compute high-precision detector coordinates at specified ctime and boresight az and alt. All arguments are passed directly to pointing.get_coords.

split_mean()[source]

Returns a pair of FocalPlane objects, the first of which gives the approximate position of the center of the array, and the second of which gives the positions of the detectors relative to that center.

subset(idx=None, det_uid=None, superset_ok=True)[source]

Get a FocalPlane object that is a subset of this one.

By default, all the valid pointings are selected. Otherwise, indices are taken from idx, or matched to det_uid.