gcp

The GCP package contains tools for interacting with the telescope control system (GCP). This includes both offline tools for processing data products from the GCP (ARCFileReader) and associated container classes (ACUStatus, TrackerStatus), as well as online tools designed for coordination of data taking with the control system (the various data tees and signalling modules).

Frame Objects in spt3g.gcp

spt3g.gcp.ACUStatus

ACU Status information, as reported by the ACU

Constructors:

ACUStatus()

ACUStatus( (ACUStatus)arg2)

Members:

  • time: No Doc (Shame!)

  • az_pos: No Doc (Shame!)

  • el_pos: No Doc (Shame!)

  • az_rate: No Doc (Shame!)

  • el_rate: No Doc (Shame!)

  • px_checksum_error_count: No Doc (Shame!)

  • px_resync_count: No Doc (Shame!)

  • px_resync_timeout_count: No Doc (Shame!)

  • px_timeout_count: No Doc (Shame!)

  • restart_count: No Doc (Shame!)

  • px_resyncing: No Doc (Shame!)

  • state: No Doc (Shame!)

  • acu_status: No Doc (Shame!)

spt3g.gcp.ACUStatusVector

Array of ACUStatus objects, usually time-ordered

Constructors:

ACUStatusVector()

ACUStatusVector( (object)arg2)

Methods:

spt3g.gcp.ACUStatusVector.append

append( (ACUStatusVector)arg1, (object)arg2) -> None

spt3g.gcp.ACUStatusVector.extend

extend( (ACUStatusVector)arg1, (object)arg2) -> None

spt3g.gcp.TrackerPointing

GCP Tracker Pointing

Constructors:

TrackerPointing()

TrackerPointing( (TrackerPointing)arg2)

Members:

  • time: No Doc (Shame!)

  • scu_temp: No Doc (Shame!)

  • features: No Doc (Shame!)

  • encoder_off_x: No Doc (Shame!)

  • encoder_off_y: No Doc (Shame!)

  • horiz_mount_x: No Doc (Shame!)

  • horiz_mount_y: No Doc (Shame!)

  • horiz_off_x: No Doc (Shame!)

  • horiz_off_y: No Doc (Shame!)

  • tilts_x: No Doc (Shame!)

  • tilts_y: No Doc (Shame!)

  • linsens_avg_l1: No Doc (Shame!)

  • linsens_avg_l2: No Doc (Shame!)

  • linsens_avg_r1: No Doc (Shame!)

  • linsens_avg_r2: No Doc (Shame!)

  • telescope_temp: No Doc (Shame!)

  • telescope_pressure: No Doc (Shame!)

  • refraction: No Doc (Shame!)

spt3g.gcp.TrackerStatus

GCP Tracker Status

Constructors:

TrackerStatus()

TrackerStatus( (TrackerStatus)arg2)

Members:

  • time: No Doc (Shame!)

  • az_pos: No Doc (Shame!)

  • el_pos: No Doc (Shame!)

  • az_rate: No Doc (Shame!)

  • el_rate: No Doc (Shame!)

  • az_command: No Doc (Shame!)

  • el_command: No Doc (Shame!)

  • az_rate_command: No Doc (Shame!)

  • el_rate_command: No Doc (Shame!)

  • state: No Doc (Shame!)

  • acu_seq: No Doc (Shame!)

  • in_control: No Doc (Shame!)

  • scan_flag: No Doc (Shame!)

Modules in spt3g.gcp

spt3g.gcp.ARCExtractor.ARCExtract

Extract GCP registers into native objects

Equivalent to:

pipe.Add(spt3g.gcp.ARCExtractor.CalibrateFrame)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackACUData)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackTrackerPointingData)
pipe.Add(spt3g.gcp.ARCExtractor.UpdateLinearSensorDeltas)
pipe.Add(spt3g.gcp.ARCExtractor.DecryptFeatureBit)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackTrackerData)
pipe.Add(spt3g.gcp.ARCExtractor.AddBenchData)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackCryoData)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackPTData)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackMuxData)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackWeatherData)
Definition:

ARCExtract(pipe)

spt3g.gcp.ARCExtractor.ARCExtractMinimal

Extract bare minimum GCP registers into native objects.

Includes only GCPFeatureBits, SourceName and ObservationID keys. Use ARCExtract to calibrate and extract the complete frame.

Equivalent to:

pipe.Add(spt3g.gcp.ARCExtractor.DecryptFeatureBit)
pipe.Add(spt3g.gcp.ARCExtractor.UnpackTrackerMinimal)
Definition:

ARCExtractMinimal(pipe)

spt3g.gcp.ARCExtractor.AddBenchData

Add the optical bench positions to the frame.

Definition:

AddBenchData(f)

spt3g.gcp.ARCExtractor.CalibrateFrame

Apply gain / offset / units from G3 cal file

Constructor:

CalibrateFrame(calibration_file=None)

spt3g.gcp.ARCExtractor.DecryptFeatureBit

Unpacks the GCP feature flags

Definition:

DecryptFeatureBit(f)

spt3g.gcp.ARCExtractor.UnpackACUData

Extracts ACU status information to ACUStatus key in frame

Definition:

UnpackACUData(f)

spt3g.gcp.ARCExtractor.UnpackCryoData

Extracts cryo information into CryoStatus key

Definition:

UnpackCryoData(f)

spt3g.gcp.ARCExtractor.UnpackMuxData

Add the DFMux data to the frame.

Definition:

UnpackMuxData(f)

spt3g.gcp.ARCExtractor.UnpackPTData

Extracts pulse tube status information to PTStatus key in frame

Definition:

UnpackPTData(f)

spt3g.gcp.ARCExtractor.UnpackTrackerData

Extracts tracker status information to frame into the TrackerStatus key, along with the observation processing handled by UnpackTrackerMinimal.

If rewrite_source_from_feature_bits is True (the default), will try to rewrite source names if DecryptFeatureBit() has been run and either “elnod”, “calibrator”, or “noise” is present in the feature bit list to that value.

Definition:

UnpackTrackerData(f, rewrite_source_from_feature_bits=True)

spt3g.gcp.ARCExtractor.UnpackTrackerMinimal

Construct SourceName and ObservationId keys from frame.

If rewrite_source_from_feature_bits is True (the default), will try to rewrite source names if DecryptFeatureBit() has been run and either “elnod”, “calibrator”, or “noise” is present in the feature bit list to that value.

Definition:

UnpackTrackerMinimal(f, rewrite_source_from_feature_bits=True)

spt3g.gcp.ARCExtractor.UnpackTrackerPointingData

Extracts tracker registers relevant to online and offline pointing. Calibration values (offsets and multiplicative constants) are from gcp/control/conf/spt/cal.

Definition:

UnpackTrackerPointingData(f)

spt3g.gcp.ARCExtractor.UnpackWeatherData

Extracts weather status information to Weather key in frame

Definition:

UnpackWeatherData(f)

spt3g.gcp.ARCExtractor.UpdateLinearSensorDeltas

Definition:

UpdateLinearSensorDeltas(f)

spt3g.gcp.ARCFileReader

Read GCP archive file (or files if you pass an iterable of paths). For non-SPT ARC file formats, please set Experiment to the appropriate value. Set track_filename to True to record the filename for each frame in the ._filename attribute (fragile).

Constructors:

ARCFileReader( (str)filename [, (Experiment)experiment=spt3g.gcp.Experiment.SPT [, (bool)track_filename=False]])

ARCFileReader( (StringVector)filename [, (Experiment)experiment=spt3g.gcp.Experiment.SPT [, (bool)track_filename=False]])

spt3g.gcp.ARCHKExtractor.UnpackSPTpolHKData

Extracts SPTpol housekeeping information from ARC files

Constructor:

UnpackSPTpolHKData(self)

spt3g.gcp.CalFile.CalFileReader

For now just reads a G3 calibration file and loads the contents into a dictionary

Constructor:

CalFileReader(calibration_file=None)

spt3g.gcp.GCPDataTee.DAQWatchdog

Watchdog that issues a ping to the GCP pager when the DAQ is operational.

Constructor:

DAQWatchdog(calibrator=False, interval=600, sim=False)

Constructor:
Arguments:
calibratorbool

If True, ensure that the calibrator is also running successfully before sending a ping.

spt3g.gcp.GCPDataTee.GCPBoloDataTee

Module that serves bolometer data to GCP when asked. Once a second, will serve the data from the previous second of bolometer data.

If a boolean key appears in the timepoint frames named “DataOK”, this will be sent to GCP as a data quality indicator for paging.

Constructor:

GCPBoloDataTee(port=50020, verbose=False, bolometers=[])

Constructor:

Send data from the given list of bolometer logical IDs to the GCP.

spt3g.gcp.GCPDataTee.GCPHousekeepingTee

Module that serves housekeeping information to GCP when asked. If a key named “DataOK” exists in the housekeeping frames, will also transmit that information to GCP for paging purposes.

Constructor:

GCPHousekeepingTee(port=50010, verbose=False)

spt3g.gcp.GCPDataTee.GCPSignalledHousekeeping

Module that collects housekeeping data when connected to. If collect_on_start is True (the default), injects an HK frame unconditionally at startup.

Constructor:

GCPSignalledHousekeeping(port=50011, collect_on_start=True)

spt3g.gcp.GCPMuxDataDecoder

Extracts contents of receiver registers in SPTpol-style ARC files into a wiring map and timepoint frames. This is designed to convert SPTpol-style data in which GCP records bolometer data into the ARC files into a format equivalent to that for SPT-3G.

For old (100d SPTpol) data not containing wiring information, insert a wiring map into the pipeline ahead of this module. The board_serial should be set to a real (positive) value for all bolometer channels and -1 for the calibrator sync readout.

Constructors:

GCPMuxDataDecoder()

spt3g.gcp.InfluxDB.UpdateDB

Update InfluxDB with data in frame

Arguments:
client :

InfluxDB client

fields :

Which gcp fields to add to database. See parse_field for options. If None, add all.

Equivalent to:

Exception evaluating equivalence (UpdateDB() missing 1 required positional argument: 'client')
Definition:

UpdateDB(pipe, client, fields=None)

spt3g.gcp.InfluxDB.WriteDB

Write points to the database for each field

Arguments:
client :

InfluxDB client

fields :

Which gcp fields to add to database. See parse_field for options. If None, add all.

Definition:

WriteDB(fr, client, fields=None)

Functions in spt3g.gcp

spt3g.gcp.ARCExtractor.CalibrateValue

Apply gain / offset units from G3 cal file to register

Definition:

CalibrateValue(data, caldict_entry)

spt3g.gcp.ARCExtractor.UnitValue

Turn unit name into floating point unit value

Definition:

UnitValue(caldict_entry)

spt3g.gcp.CalFile.create_g3_cal_file

Create a G3 register calibration file. Usually reads in calibration and units from a GCP cal file then adds extra information that isn’t in the GCP one. This extra information can be handed to the routine as a dict (note format below); otherwise, the hard-coded extra info will be used. (Feel free to edit this hard-coded info.)

Definition:

create_g3_cal_file(path, read_from_gcp=True, extra_dict=None, use_extra_info=True, gcp_cal_file=None)