How to create a map from a single detector?

A PacsObservation gathers information about the instrument settings, which are stored in the instrument attribute. With the exception of the detector channel, the parameters in the instrument attribute can be modified after instantiation. More information can be found on what contains a PacsObservation.

The field detector.removed controls the list of detectors to be included in the timelines and the field detector.masked, the list of detectors to be masked in the timelines. The former is used to distribute the work among processors in an MPI job and the latter to flag the bad detectors. Both control which detectors will contribute to the map.

To speed up the processing and the memory consumption, let’s remove detectors instead of masking them. The number of non-removed detectors can be obtained dynamically through the method get_ndetectors.

>>> obs = PacsObservation('myobs.fits')
>>> obs.get_ndetectors()
2048
>>> obs.get_tod().shape
(2048, 360)

The following snippet removes all detectors but one:

>>> obs.instrument.detector.removed = True
>>> obs.instrument.detector.removed[7,12] = False
>>> obs.get_ndetectors()
1
>>> obs.get_tod().shape
(1, 360)

To restrict the processing to the bolometer matrix 1:

>>> d = obs.instrument.detector
>>> d.removed = d.matrix != 1
>>> obs.get_ndetectors()
256

Once the removed or masked fields are set, you can create a map as usual.