HiRISE
 Observation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes

Science_Channel_Header Class Reference

A Science_Channel_Header contains the science metadata describing the observation channel data. More...

#include <Science_Channel_Header.hh>

Inheritance diagram for Science_Channel_Header:
Inheritance graph
[legend]
Collaboration diagram for Science_Channel_Header:
Collaboration graph
[legend]

List of all members.

Classes

struct  Conversion_Coefficients
 Sensor conversion coefficients. More...

Public Types

enum  Element {
  Sync,
  Post_Binned_Pixels_Per_Line,
  Post_Binned_Lines,
  Alignment,
  CPMM,
  Channel,
  Observation_ID,
  Transaction_ID,
  Powered_CPMMs_Count,
  Powered_CPMMs_Map,
  Expose_MRO_Time,
  Expose_HiRISE_Time,
  Analog_Power_On_Time,
  Analog_Power_On_Start_Time,
  Exposure_Start_Time,
  Expose_Time_Ticks,
  Total_Image_Bytes,
  Line_Time_Operation,
  Expose_Command,
  Expose_Response,
  Line_Time_Command_Received,
  Binning_Command_Received,
  TDI_Command_Received,
  Line_Count_Command_Received,
  CPMM_Power_Command_Received,
  Expose_Time_Command_Received,
  LUT_Command_Received,
  Pad_0,
  Digital_Power_Operation,
  Analog_Power_Operation,
  Trimming_Operation,
  TDI_Operation,
  Line_Count_Operation,
  Binning_Operation,
  LUT_Operation,
  Expose_Time_Milliseconds,
  Readout_Start_Time,
  Readout_Pad_Bytes,
  Pixels_Per_Line,
  Extra_Pixels,
  Pixel_Bytes,
  Pixel_Data_Bytes,
  Line_Header_Bytes,
  Channel_Readout_Bytes,
  Channel_Readout_Ticks,
  Max_Storable_Lines,
  Max_Storable_Lines_Exceeded,
  Total_Lines_Collected,
  Total_Lines_Exposed,
  Line_Time_Nanoseconds,
  Channel_Readout_Command,
  Channel_Readout_Response,
  Pad_1,
  Optical_Bench_Flexure_Temperature,
  Optical_Bench_Tertiary_Mirror_Temperature,
  Optical_Bench_Fold_Flat_Temperature,
  Optical_Bench_FPA_Temperature,
  Optical_Bench_FPE_Temperature,
  Optical_Bench_Living_Room_Temperature,
  Optical_Bench_Box_Beam_Temperature,
  Optical_Bench_Cover_Temperature,
  Field_Stop_Temperature,
  FPA_Positive_Y_Temperature,
  FPA_Negative_Y_Temperature,
  FPE_Temperature,
  Primary_Mirror_Mount_Temperature,
  Primary_Mirror_Temperature,
  Primary_Mirror_Baffle_Temperature,
  Metering_Structure_Truss_Leg_0_A_Temperature,
  Metering_Structure_Truss_Leg_0_B_Temperature,
  Metering_Structure_Truss_Leg_120_A_Temperature,
  Metering_Structure_Truss_Leg_120_B_Temperature,
  Metering_Structure_Truss_Leg_240_A_Temperature,
  Metering_Structure_Truss_Leg_240_B_Temperature,
  Barrel_Baffle_Temperature,
  Sun_Shade_Temperature,
  Spider_Leg_30_Temperature,
  Spider_Leg_150_Temperature,
  Spider_Leg_270_Temperature,
  Secondary_Mirror_Metering_Ring_Temperature,
  Secondary_Mirror_Temperature,
  Secondary_Mirror_Baffle_Temperature,
  IEA_Temperature,
  Focus_Motor_Temperature,
  CPMM_Positive_29_Voltage,
  CPMM_Positive_29_Current,
  CPMM_Positive_10_Voltage,
  CPMM_Positive_10_Current,
  CPMM_Positive_5_Voltage,
  CPMM_Positive_5_Current,
  CPMM_Positive_3_3_Voltage,
  CPMM_Positive_3_3_Current,
  CPMM_Positive_2_5_Voltage,
  CPMM_Positive_2_5_Current,
  CPMM_Positive_1_8_Voltage,
  CPMM_Positive_1_8_Current,
  CPMM_Negative_5_Voltage,
  CPMM_Negative_5_Current,
  IE_PWS_Board_Temperature,
  CPMM_PWS_Board_Temperature,
  Heater_Current,
  Mech_TLM_Board_Temperature,
  Instrument_Control_Board_Temperature,
  Instrument_Control_FPGA_Positive_2_5_Voltage,
  Mech_TLM_FPGA_Positive_2_5_Voltage,
  IEA_Positive_28_Voltage,
  IEA_Negative_15_Voltage,
  IEA_Positive_15_Voltage,
  IEA_Positive_5_Voltage,
  Exposure_Readout_Count,
  Default_TDI,
  Default_Trimming,
  Default_Line_Count,
  Default_Binning,
  Focus_Position,
  Heater_Control_Mode,
  Heater_Zones_Enabled,
  Heater_Zones_State,
  Heater_Disabled_For_Exposure,
  Heater_Zones_Pre_Exposure_State,
  FPGA_Last_Response,
  Heater_Controls,
  Last_Command_Time,
  Pad_2,
  Checksum,
  Total_Elements
}
 

An Element refers to a data containing constituent of a component.

More...
enum  Heater_Mode {
  CLOSED_LOOP,
  DUTY_CYCLES
}
 

Heater_Control_Mode values: determines the Heater_Controls value meanings.

More...
enum  Setpoint {
  LOW,
  HIGH
}
 

Heater_Controls word value type when the Heater_Mode is CLOSED_LOOP.

More...
enum  Duty_Cycle {
  ON_SECONDS,
  OFF_SECONDS
}
 

Heater_Controls word value type when the Heater_Mode is DUTY_CYCLES.

More...
enum  { TOTAL_CONVERSION_COEFFICIENTS = 7 }
 

Number of coefficients (n) in the conversion polynomial.

More...

Public Member Functions

 Science_Channel_Header ()
 Constructs an empty Science_Channel_Header.
 Science_Channel_Header (std::istream &stream)
 Constructs an Science_Channel_Header loaded from a data stream.
 Science_Channel_Header (const Science_Channel_Header &component, bool data_duplicate=true)
 Copy constructor.
Science_Channel_Headeroperator= (const Science_Channel_Header &component)
 Assigns another Science_Channel_Header to this one.
std::string id () const
 Provides the class ID on a line followed by the base Data_Component::id.
const char * name () const
 Gets the NAME of this class.
std::string clock_count (Index element, Index index=0) const
 Gets a formatted clock count string for a Time Element.
Science_Channel_Headerclock_count (const std::string &counter, Index element, Index index=0)
 Sets a Time Element from a formatted clock count string.
double time (Index element, Index index=0) const
 Gets a Time Element value as a single real seconds value.
Science_Channel_Headertime (double seconds, Index element, Index index=0)
 Sets a Time Element value based on a real seconds value.
bool FPGA_last_response_CPMM_PWS_enabled () const
 Tests if the FPGA_Last_Response Element indicates that the CPMM power supply was enabled during the observation.
Science_Channel_HeaderFPGA_last_response_CPMM_PWS_enabled (bool enabled)
 Sets the FPGA_Last_Response Element to indicate whether the CPMM power supply was enabled during the observation.
bool FPGA_last_response_telemetry_gathering () const
 Tests if the FPGA_Last_Response Element indicates that telemetry gathering was enabled at the time of the observation.
Science_Channel_HeaderFPGA_last_response_telemetry_gathering (bool enabled)
 Sets the FPGA_Last_Response Element to indicate whether telemetry gathering was enabled at the time of the observation.
bool FPGA_last_response_FM_relay_PHB_closed () const
 Tests if the FPGA_Last_Response Element indicates that the focus mechanism relay PhB was closed at the time of the observation.
Science_Channel_HeaderFPGA_last_response_FM_relay_PHB_closed (bool closed)
 Sets the FPGA_Last_Response Element to indicate whether the focus mechanism relay PhB was closed at the time of the observation.
bool FPGA_last_response_FM_relay_PHA_closed () const
 Tests if the FPGA_Last_Response Element indicates that the focus mechanism relay PhA was closed at the time of the observation.
Science_Channel_HeaderFPGA_last_response_FM_relay_PHA_closed (bool closed)
 Sets the FPGA_Last_Response Element to indicate whether the focus mechanism relay PhA was closed at the time of the observation.
bool FPGA_last_response_FM_overheated () const
 Tests if the FPGA_Last_Response Element indicates that the focus mechanism was overheated at the time of the observation.
Science_Channel_HeaderFPGA_last_response_FM_overheated (bool overheated)
 Sets the FPGA_Last_Response Element to indicate whether the focus mechanism was overheated at the time of the observation.
bool FPGA_last_response_FM_moving () const
 Tests if the FPGA_Last_Response Element indicates that the optics focus mechanism was moving during the observation.
Science_Channel_HeaderFPGA_last_response_FM_moving (bool moving)
 Sets the FPGA_Last_Response Element to indicate whether the focus mechanism was moving at the time of the observation.
u_int_32 FPGA_last_response_stim_LEDs_on () const
 Gets the bit map from the FPGA_Last_Response Element that indicate which stim lamps were on during the observation.
Science_Channel_HeaderFPGA_last_response_stim_LEDs_on (u_int_32 stim_LEDs_map)
 Sets the bit map in the FPGA_Last_Response Element that indicate which stim lamps were on during the observation.
u_int_32 FPGA_last_response_heaters_on () const
 Gets the bit map from the FPGA_Last_Response Element that indicate which CCD heater elements were on during the observation.
Science_Channel_HeaderFPGA_last_response_heaters_on (u_int_32 heaters_map)
 Sets the bit map in the FPGA_Last_Response Element that indicate which CCD heater elements were on during the observation.
const Conversion_Coefficientsconversion (Index element) const
 Gets a Conversion_Coefficients set for an Element.
double convert (Index element, Index index=0) const
 Converts an Element sensor value to its standard units.
const char * converted_units (Index element) const
 Gets the stadard units of representation for an Element.
std::ostream & print (std::ostream &stream=std::cout, bool verbose=false) const
 Prints the component structure and contents.
idaeim::PVL::AggregatePVL () const
 Produces a PVL rendition of the component.
idaeim::PVL::AggregatePVL_description () const
 Produces a PVL description of the component for a PDS label.
bool is_valid () const
 Tests if the component data is valid.

Static Public Member Functions

static bool is_sync (const void *data_at)
 Tests if some data contains a sync sequence.
static void * sync_at (void *begin, void *end)
 Searches a range of bytes for a Science Channel Header sync pattern.

Public Attributes

static const u_int_32 FPGA_RESPONSE_TELEMETRY_GATHERING_BIT_MASK = (1 << 21)
static const u_int_32 FPGA_RESPONSE_FM_RELAY_PHB_CLOSED_BIT_MASK = (1 << 20)
static const u_int_32 FPGA_RESPONSE_FM_RELAY_PHA_CLOSED_BIT_MASK = (1 << 19)
static const u_int_32 FPGA_RESPONSE_FM_OVERHEATED_BIT_MASK = (1 << 18)
static const u_int_32 FPGA_RESPONSE_FM_MOVING_BIT_MASK = (1 << 17)
static const u_int_32 FPGA_RESPONSE_STIM_LEDS_BIT_MASK
static const u_int_32 FPGA_RESPONSE_STIM_LEDS_BIT_MASK_SHIFT = 14
static const u_int_32 FPGA_RESPONSE_HEATERS_ON_BIT_MASK = 0x3FFF

Static Public Attributes

static const char *const ID = "UA::HiRISE::Science_Channel_Header (1.52 2010/11/25 02:51:13)"
 Class identification name with source code version and date.
static const char *const NAME = "Science Channel Header"
 The component name.
static const char * NAMES []
 The name of each Element.
static const Index COMPONENT_BYTES = SCIENCE_CHANNEL_HEADER_BYTES
 Total number of bytes in the Data_Block.
static const Index OFFSETS []
 Data_Block data storage address offset for each Element.
static const Index ARRAY_COUNTS [][2]
 Data_Block array element value counts each keyed to an Element Index.
static const u_int_32 SYNC = 0xFFFF0000
 Expected Sync Element values.
static const int SYNC_BYTES = 2 * sizeof (SYNC)
 The number of bytes in the sync pattern.
static const u_int_32 FPGA_RESPONSE_CPMM_PWS_ENABLED_BIT_MASK = (1 << 22)
 FPGA_Last_Response Element bit fields.
static const
Conversion_Coefficients 
CONVERSION_COEFFICIENTS []
 The array of all Conversion_Coefficients.
static const double CELCIUS_TO_KELVINS_OFFSET
 Offset to be added to Celcius degrees to obtain Kelvins.
static const char *const FORMAT_FILENAME = SCIENCE_CHANNEL_HEADER_FORMAT_FILE
 The name of the external PDS format description file.

Detailed Description

A Science_Channel_Header contains the science metadata describing the observation channel data.

This Data_Component is the first in the observation channel data stream. It includes all parameters that were used in controlling the instrument during the collection of observation data. Thus it is the definative record of the instrument observation operation. Many of the Elements should have identical values for all data channels of an observation. This redundancy is used to help reconcile corrupted data due to gaps in the spacecraft downlink transmission. Some Elements are sets of values that require detailed engineering knowlege of the instrument to correctly interpret.

For details consult the "HiRISE Command and Telemetry Handbook" (http://hirise.lpl.arizona.edu/team_site/instrument/Command_and_Telemetry_Handbook/).

Header data block layout:

	Offset  Size  Description
	------  ----  -----------
	     0     8  Sync pattern (0xFFFF0000 FFFF0000)
	Image identification and geometry:
	     8     2  Post-binned pixels per line
	    10     4  Post-binned lines
	    14     2  (alignment bytes)
	    16     2  CPMM (0-13)
	    18     2  Channel (0, 1)
	    20     4  Observation ID (a.k.a. Image ID)
	    24     4  Transaction ID
	    28     4  Number of powered on CPMMs (0-13)
	    32     4  Powered on CPMMs map
	Times:
	    36     8  MRO Expose time (seconds and subsecond counts)
	    44     8  HiRISE Expose time (seconds and subsecond counts)
	    52     8  Analog power on time (seconds and subsecond counts)
	    60     8  Analog power on start time (seconds and subsecond counts)
	    68     8  Exposure start time (seconds and subsecond counts)
	    76     4  Expose time (10 msec ticks)
	    80     4  Total image bytes
	Commands:
	    84    20  Line time operation (Operation)
	   104     4  Expose command
	   108     4  Expose response
	   112     4  Line time command received
	   116     4  Binning command received
	   120     4  TDI command received
	   124     4  Line count command received
	   128     4  CPMM power command received
	   132     4  Expose time command received
	   136     4  LUT command received
	   140     8  (padding)
	   148    20  Digital power operation (Operation)
	   168    20  Analog power operation (Operation)
	   188    20  Trimming operation (Operation)
	   208    20  TDI operation (Operation)
	   228    20  Line count operation (Operation)
	   248    20  Binning operation (Operation)
	   268    80  LUT operation (LUT_Operation)
	Image data specifications:
	   348     4  Expose time
	   352    16  Readout start times (Time_Value for each channel)
	   368     4  Readout pad bytes
	   372     4  Pixels per line
	   376     4  Extra pixels
	   380     4  Pixel bytes (bytes per pixel)
	   384     4  Pixel data bytes (toal pixel bytes per channel)
	   388     4  Line header bytes
	   392     4  Channel readout bytes (incl. pixels, LUT, Eng. and pad)
	   396     4  Channel readout ticks (10 msec ticks)
	   400     4  Maximum storable lines
	   404     4  Maximum storable lines exceeded
	   408     4  Total lines collected
	   412     4  Total lines exposed
	   416     4  Line time (nanoseconds)
	   420     8  Readout command for each channel
	   428     8  Readout response for each channel
	   436    12  (padding)
	Engineering Data (temperatures, voltages, currents):
	   448     2  Optical bench near +X MRO flexure temperature
	   450     2  Optical bench near tertiary mirror temperature
	   452     2  Optical bench near fold flat #2 temperature
	   454     2  Optical bench near FPA temperature
	   456     2  Optical bench near FPE temperature
	   458     2  Optical bench in sunken living room temperature
	   460     2  Optical bench box beam (+Y face) temperature
	   462     2  Optical bench cover (external) temperature
	   464     2  Field stop temperature
	   466     2  FPA +Y side temperature
	   468     2  FPA -Y side temperature
	   470     2  FPE temperature
	   472     2  Primary mirror at mount (+Y) temperature
	   474     2  Primary mirror at maximum thickness temperature
	   476     2  Primary mirror baffle near base (external) temperature
	   478     2  Metering structure truss leg 0 - A leg temperature
	   480     2  Metering structure truss leg 0 - B leg temperature
	   482     2  Metering structure truss leg 120 - A leg temperature
	   484     2  Metering structure truss leg 120 - B leg temperature
	   486     2  Metering structure truss leg 240 - A leg temperature
	   488     2  Metering structure truss leg 240 - B leg temperature
	   490     2  Barrel baffle temperature
	   492     2  Sun shade under MLI temperature
	   494     2  Spider leg 30 temperature
	   496     2  Spider leg 150 temperature
	   498     2  Spider leg 270 temperature
	   500     2  Secondary mirror metering ring temperature
	   502     2  Secondary mirror temperature
	   504     2  Secondary mirror baffle near base (external) temperature
	   506     2  IEA temperature
	   508     2  Focus motor temperature
	   510     2  +29V CPMM Voltage
	   512     2  +29V CPMM Current
	   514     2  +10V CPMM Voltage
	   516     2  +10V CPMM Current
	   518     2  +5V CPMM Voltage
	   520     2  +5V CPMM Current
	   522     2  +3.3V CPMM Voltage
	   524     2  +3.3V CPMM Current
	   526     2  +2.5V CPMM Voltage
	   528     2  +2.5V CPMM Current
	   530     2  +1.8V CPMM Voltage
	   532     2  +1.8V CPMM Current
	   534     2  -5V CPMM Voltage
	   536     2  -5V CPMM Current
	   538     2  IE PWS board temperature
	   540     2  CPMM PWS board temperature
	   542     2  Total heater current
	   544     2  Mech/TLM board temperature
	   546     2  Inst/Cont board temperature
	   548     2  Inst/Cont 2.5V FPGA voltage monitor
	   550     2  Mech/TLM 2.5 FPGA voltage monitor
	   552     2  +28V IEA voltage
	   554     2  -15V IEA voltage
	   556     2  +15V IEA voltage
	   558     2  +5V IEA voltage
	   560     4  Exposure readout count
	Defaults:
	   564     4  Default TDI
	   568     4  Default trimming
	   572     4  Default line count
	   576     4  Default binning
	   580     4  Focus position
	Heaters:
	   584     4  Heater control mode (0 = setpoint, 1 = duty cycle)
	   588     4  Heater enable (zones bitmask)
	   592     4  Heater state (zones bitmask)
	   596     4  Heater disabled for exposure
	   600     4  Heater pre-exposure state (zones bitmask)
	   604     4  FPGA last response
	                Bits   Description
	                -----  -----------
                    0 -13  Heaters on bit map
                             0 - off
                             1 - on
                    14-16  Stim LEDs on bit map
                             0 - off
                             1 - on
                       17  Focus Mechanism moving (flag)
                       18  Focus Mechanism overheated (flag)
                       19  Focus Mechanism relay PhA closed (flag)
                       20  Focus Mechanism relay PhB closed (flag)
                       21  Telemetry gathering (flag)
                       22  CPMM PWS enabled (flag)
	   608    56  Heater controls (14 16-bit word pairs)
	   664     8  Last command time (seconds and subsecond counts)
	   672   126  (padding)
	   798     2  Checksum

N.B.: Data_Block values are MSB ordered.

Author:
Bradford Castalia, UA/PIRL

1.40

See also:
Data_Component

Member Enumeration Documentation

enum Element

An Element refers to a data containing constituent of a component.

Each named Element is an Index into various data sets that define the attributes of a component; including their NAMES, data storage address OFFSETS, and array element value ARRAY_COUNTS. It is the key Index argument of the data access methods.

See also:
Data_Block
Enumerator:
Sync 
Post_Binned_Pixels_Per_Line 
Post_Binned_Lines 
Alignment 
CPMM 
Channel 
Observation_ID 
Transaction_ID 
Powered_CPMMs_Count 
Powered_CPMMs_Map 
Expose_MRO_Time 
Expose_HiRISE_Time 
Analog_Power_On_Time 
Analog_Power_On_Start_Time 
Exposure_Start_Time 
Expose_Time_Ticks 
Total_Image_Bytes 
Line_Time_Operation 
Expose_Command 
Expose_Response 
Line_Time_Command_Received 
Binning_Command_Received 
TDI_Command_Received 
Line_Count_Command_Received 
CPMM_Power_Command_Received 
Expose_Time_Command_Received 
LUT_Command_Received 
Pad_0 
Digital_Power_Operation 
Analog_Power_Operation 
Trimming_Operation 
TDI_Operation 
Line_Count_Operation 
Binning_Operation 
LUT_Operation 
Expose_Time_Milliseconds 
Readout_Start_Time 
Readout_Pad_Bytes 
Pixels_Per_Line 
Extra_Pixels 
Pixel_Bytes 
Pixel_Data_Bytes 
Line_Header_Bytes 
Channel_Readout_Bytes 
Channel_Readout_Ticks 
Max_Storable_Lines 
Max_Storable_Lines_Exceeded 
Total_Lines_Collected 
Total_Lines_Exposed 
Line_Time_Nanoseconds 
Channel_Readout_Command 
Channel_Readout_Response 
Pad_1 
Optical_Bench_Flexure_Temperature 
Optical_Bench_Tertiary_Mirror_Temperature 
Optical_Bench_Fold_Flat_Temperature 
Optical_Bench_FPA_Temperature 
Optical_Bench_FPE_Temperature 
Optical_Bench_Living_Room_Temperature 
Optical_Bench_Box_Beam_Temperature 
Optical_Bench_Cover_Temperature 
Field_Stop_Temperature 
FPA_Positive_Y_Temperature 
FPA_Negative_Y_Temperature 
FPE_Temperature 
Primary_Mirror_Mount_Temperature 
Primary_Mirror_Temperature 
Primary_Mirror_Baffle_Temperature 
Metering_Structure_Truss_Leg_0_A_Temperature 
Metering_Structure_Truss_Leg_0_B_Temperature 
Metering_Structure_Truss_Leg_120_A_Temperature 
Metering_Structure_Truss_Leg_120_B_Temperature 
Metering_Structure_Truss_Leg_240_A_Temperature 
Metering_Structure_Truss_Leg_240_B_Temperature 
Barrel_Baffle_Temperature 
Sun_Shade_Temperature 
Spider_Leg_30_Temperature 
Spider_Leg_150_Temperature 
Spider_Leg_270_Temperature 
Secondary_Mirror_Metering_Ring_Temperature 
Secondary_Mirror_Temperature 
Secondary_Mirror_Baffle_Temperature 
IEA_Temperature 
Focus_Motor_Temperature 
CPMM_Positive_29_Voltage 
CPMM_Positive_29_Current 
CPMM_Positive_10_Voltage 
CPMM_Positive_10_Current 
CPMM_Positive_5_Voltage 
CPMM_Positive_5_Current 
CPMM_Positive_3_3_Voltage 
CPMM_Positive_3_3_Current 
CPMM_Positive_2_5_Voltage 
CPMM_Positive_2_5_Current 
CPMM_Positive_1_8_Voltage 
CPMM_Positive_1_8_Current 
CPMM_Negative_5_Voltage 
CPMM_Negative_5_Current 
IE_PWS_Board_Temperature 
CPMM_PWS_Board_Temperature 
Heater_Current 
Mech_TLM_Board_Temperature 
Instrument_Control_Board_Temperature 
Instrument_Control_FPGA_Positive_2_5_Voltage 
Mech_TLM_FPGA_Positive_2_5_Voltage 
IEA_Positive_28_Voltage 
IEA_Negative_15_Voltage 
IEA_Positive_15_Voltage 
IEA_Positive_5_Voltage 
Exposure_Readout_Count 
Default_TDI 
Default_Trimming 
Default_Line_Count 
Default_Binning 
Focus_Position 
Heater_Control_Mode 
Heater_Zones_Enabled 
Heater_Zones_State 
Heater_Disabled_For_Exposure 
Heater_Zones_Pre_Exposure_State 
FPGA_Last_Response 
Heater_Controls 
Last_Command_Time 
Pad_2 
Checksum 
Total_Elements 

Heater_Control_Mode values: determines the Heater_Controls value meanings.

Enumerator:
CLOSED_LOOP 
DUTY_CYCLES 
enum Setpoint

Heater_Controls word value type when the Heater_Mode is CLOSED_LOOP.

Enumerator:
LOW 
HIGH 
enum Duty_Cycle

Heater_Controls word value type when the Heater_Mode is DUTY_CYCLES.

Enumerator:
ON_SECONDS 
OFF_SECONDS 
anonymous enum

Number of coefficients (n) in the conversion polynomial.

Enumerator:
TOTAL_CONVERSION_COEFFICIENTS 

Constructor & Destructor Documentation

Constructs an empty Science_Channel_Header.

The base Data_Component is initialized with the NAMES, COMPONENT_BYTES, OFFSETS, and ARRAY_COUNTS that define an Science_Channel_Header component structure.

Science_Channel_Header ( std::istream &  stream ) [explicit]

Constructs an Science_Channel_Header loaded from a data stream.

The base Data_Component is initialized with the NAMES, COMPONENT_BYTES, OFFSETS, and ARRAY_COUNTS that define an Science_Channel_Header component structure. The stream is then read for COMPONENT_BYTES to fill the data block. Therefore, the stream must be positioned at the beginning of the Science_Channel_Header data.

Parameters:
streamThe istream from which to read the component data.
Science_Channel_Header ( const Science_Channel_Header component,
bool  data_duplicate = true 
)

Copy constructor.

Parameters:
componentThe Science_Channel_Header to be copied.
data_duplicatetrue if the data content of the copied component is to be duplicated in the copy; false if the data content is to be shared.
See also:
Data_Component(const Data_Component&, bool)

Member Function Documentation

Science_Channel_Header & operator= ( const Science_Channel_Header component )

Assigns another Science_Channel_Header to this one.

Parameters:
componentThe Science_Channel_Header to be assigned.
See also:
Data_Component::operator=(const Data_Component&)

References Data_Component::operator=().

string id (  ) const [virtual]

Provides the class ID on a line followed by the base Data_Component::id.

Returns:
The multi-line identification string.
See also:
Data_Component::id()

Reimplemented from Data_Component.

References Science_Channel_Header::ID.

const char * name (  ) const [virtual]

Gets the NAME of this class.

Returns:
A pointer to the constant class name C-string.
See also:
Data_Component::name()

Implements Data_Component.

References Science_Channel_Header::NAME.

std::string clock_count ( Index  element,
Index  index = 0 
) const

Gets a formatted clock count string for a Time Element.

All XXX_Time Elements are an array of two values: a clock seconds count and a "subseconds" count; where the first value is the count of seconds since the Instrument::SPACECRAFT_EPOCH, and the second value is the count of fraction of a second ticks having a tick interval that is clock dependent. A specific text representation format is used for these clock counts so they can be recognized and interpreted correctly. This method produces that representation:

seconds:subseconds

Parameters:
elementAn Element Index. Warning: This value is not checked to verify that it actually refers to a Time Element.
indexFor the Readout_Start_Time, the Index of the clock count value set to use. N.B.: Since clock counts are always a pair of values, this Index is NOT the Element array entry; it is internally doubled to select the correct array entries.
Returns:
The string representing seconds and subseconds clock count.
See also:
UA::HiRISE::clock_count(double, Clock_Selector);
Science_Channel_Header& clock_count ( const std::string &  counter,
Index  element,
Index  index = 0 
)

Sets a Time Element from a formatted clock count string.

A clock count with the representation:

seconds:subseconds

is used to set the seconds and subseconds values of a Time Element.

Parameters:
counterThe string containing the formatted clock count.
elementAn Element Index. Warning: This value is not checked to verify that it actually refers to a Time Element.
indexFor the Readout_Start_Time, the Index of the clock count value set to use. N.B.: Since clock counts are always a pair of values, this Index is NOT the Element array entry; it is internally doubled to select the correct array entries.
Returns:
This Science_Channel_Header.
See also:
UA::HiRISE::clock_count(Index, Index) const;
double time ( Index  element,
Index  index = 0 
) const

Gets a Time Element value as a single real seconds value.

The "subseconds" portion of the clock count is converted to a real fraction second value and added to the seconds count portion. For the Expose_MRO_Time Element the Instrument::MRO_CLOCK_SUBTICK_MICROS is used to convert the subseconds count to microseconds; all other Elements use the Instrument::HIRISE_CLOCK_SUBTICK_MICROS conversion factor.

Parameters:
elementAn Element Index. Warning: This value is not checked to verify that it actually refers to a Time Element.
indexFor the Readout_Start_Time, the Index of the clock count value set to use. N.B.: Since clock counts are always a pair of values, this Index is NOT the Element array entry; it is internally doubled to select the correct array entries.
Returns:
Seconds since the Instrument::SPACECRAFT_EPOCH to the microsecond accuracy of the clock. N.B.: If the seconds portion of the clock count has all bits set the value returned will be -1.0; this helps identify the case where the clock count has been obscured by a data gap.
See also:
clock_count(Index, Index)

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header& time ( double  seconds,
Index  element,
Index  index = 0 
)

Sets a Time Element value based on a real seconds value.

The real seconds value is converted to separate seconds and "subseconds" values which are put in the data block. For the Expose_MRO_Time Element the Instrument::MRO_CLOCK_SUBTICK_MICROS is used to convert the fractional seconds to subseconds count; all other Elements use the Instrument::HIRISE_CLOCK_SUBTICK_MICROS conversion factor.

Parameters:
secondsSeconds since the Instrument::SPACECRAFT_EPOCH to microsecond accuracy.
elementAn Element Index. Warning: This value is not checked to verify that it actually refers to a Time Element.
indexFor the Readout_Start_Time, the Index of the clock count value set to use. N.B.: Since clock counts are always a pair of values, this Index is NOT the Element array entry; it is internally doubled to select the correct array entries.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_CPMM_PWS_enabled (  ) const

Tests if the FPGA_Last_Response Element indicates that the CPMM power supply was enabled during the observation.

Bit 22 of the Element value is tested.

Returns:
true if the enabled bit is set; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_CPMM_PWS_ENABLED_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_CPMM_PWS_enabled ( bool  enabled )

Sets the FPGA_Last_Response Element to indicate whether the CPMM power supply was enabled during the observation.

Bit 22 of the Element value is set or cleared.

Parameters:
enabledtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_telemetry_gathering (  ) const

Tests if the FPGA_Last_Response Element indicates that telemetry gathering was enabled at the time of the observation.

Bit 21 of the Element value is tested.

Returns:
true if telemetry gathering was enabled; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_TELEMETRY_GATHERING_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_telemetry_gathering ( bool  enabled )

Sets the FPGA_Last_Response Element to indicate whether telemetry gathering was enabled at the time of the observation.

Bit 21 of the Element value is set or cleared.

Parameters:
enabledtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_FM_relay_PHB_closed (  ) const

Tests if the FPGA_Last_Response Element indicates that the focus mechanism relay PhB was closed at the time of the observation.

Bit 20 of the Element value is tested.

Returns:
true if the focus mechanism relay PhB was closed; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_FM_RELAY_PHB_CLOSED_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_FM_relay_PHB_closed ( bool  closed )

Sets the FPGA_Last_Response Element to indicate whether the focus mechanism relay PhB was closed at the time of the observation.

Bit 20 of the Element value is set or cleared.

Parameters:
closedtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_FM_relay_PHA_closed (  ) const

Tests if the FPGA_Last_Response Element indicates that the focus mechanism relay PhA was closed at the time of the observation.

Bit 19 of the Element value is tested.

Returns:
true if the focus mechanism relay PhA was closed; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_FM_RELAY_PHA_CLOSED_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_FM_relay_PHA_closed ( bool  closed )

Sets the FPGA_Last_Response Element to indicate whether the focus mechanism relay PhA was closed at the time of the observation.

Bit 19 of the Element value is set or cleared.

Parameters:
closedtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_FM_overheated (  ) const

Tests if the FPGA_Last_Response Element indicates that the focus mechanism was overheated at the time of the observation.

Bit 18 of the Element value is tested.

Returns:
true if the focus mechanism was overheated; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_FM_OVERHEATED_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_FM_overheated ( bool  overheated )

Sets the FPGA_Last_Response Element to indicate whether the focus mechanism was overheated at the time of the observation.

Bit 18 of the Element value is set or cleared.

Parameters:
overheatedtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
bool FPGA_last_response_FM_moving (  ) const

Tests if the FPGA_Last_Response Element indicates that the optics focus mechanism was moving during the observation.

Bit 17 of the Element value is tested.

Returns:
true if the focus mechanism was moving; false otherwise.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_FM_MOVING_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_FM_moving ( bool  moving )

Sets the FPGA_Last_Response Element to indicate whether the focus mechanism was moving at the time of the observation.

Bit 17 of the Element value is set or cleared.

Parameters:
movingtrue to set the bit; false to clear it.
Returns:
This Science_Channel_Header.
u_int_32 FPGA_last_response_stim_LEDs_on (  ) const

Gets the bit map from the FPGA_Last_Response Element that indicate which stim lamps were on during the observation.

Bits 14-16 contain the bit map.

Returns:
A 32-bit integer in which the least significant STIMULATOR_LEDS contain the stim lamp map in which a set bit indicates the lamp was on.

References Science_Channel_Header::FPGA_Last_Response, Science_Channel_Header::FPGA_RESPONSE_STIM_LEDS_BIT_MASK, and Science_Channel_Header::FPGA_RESPONSE_STIM_LEDS_BIT_MASK_SHIFT.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_stim_LEDs_on ( u_int_32  stim_LEDs_map )

Sets the bit map in the FPGA_Last_Response Element that indicate which stim lamps were on during the observation.

Bits 14-16 contain the bit map.

Parameters:
stim_LEDs_mapA 32-bit integer in which the least significant STIMULATOR_LEDS contain the stim lamp map in which a set bit indicates the lamp was on.
Returns:
This Science_Channel_Header.
u_int_32 FPGA_last_response_heaters_on (  ) const

Gets the bit map from the FPGA_Last_Response Element that indicate which CCD heater elements were on during the observation.

Bits 0-13 contain the bit map.

Returns:
A 32-bit integer in which the least significant CCDS contain the heater element map in which a set bit indicates the heater was on.

References Science_Channel_Header::FPGA_Last_Response, and Science_Channel_Header::FPGA_RESPONSE_HEATERS_ON_BIT_MASK.

Referenced by Science_Channel_Header::PVL().

Science_Channel_Header & FPGA_last_response_heaters_on ( u_int_32  heaters_map )

Sets the bit map in the FPGA_Last_Response Element that indicate which CCD heater elements were on during the observation.

Bits 0-13 contain the bit map.

Parameters:
heaters_mapA 32-bit integer in which the least significant CCDS contain the heater element map in which a set bit indicates the heater was on.
Returns:
This Science_Channel_Header.
const Conversion_Coefficients* conversion ( Index  element ) const

Gets a Conversion_Coefficients set for an Element.

A Conversion_Coefficients set contains the polynomial coefficients for converting an Element sensor value to standard units, specifies what those units are.

Parameters:
elementAn Element Index.
Returns:
A Conversion_Coefficients pointer. This will be NULL if the Element has no Conversion_Coefficients.
double convert ( Index  element,
Index  index = 0 
) const

Converts an Element sensor value to its standard units.

Parameters:
elementAn Element Index.
indexAn array entry index for an Element with more than one value.
Returns:
The selected value converted to its standard units. If the Element has no Conversion_Coefficients set the original value will be returned as a double type.
See also:
conversion(Index) const
converted_units(Index) const

Referenced by Science_Channel_Header::PVL().

const char* converted_units ( Index  element ) const

Gets the stadard units of representation for an Element.

Parameters:
elementAn Element Index.
Returns:
The C-string specifying the Element's standard units. This will be NULL if the Element has no Conversion_Coefficients set.
See also:
conversion(Index) const
convert(Index, Index) const

Referenced by Science_Channel_Header::PVL().

ostream & print ( std::ostream &  stream = std::cout,
bool  verbose = false 
) const [virtual]

Prints the component structure and contents.

Verbose printing includes the class ID and the Pad and Alignment Elements.

Parameters:
streamThe ostream where the listing will be written.
verbosetrue if the listing is to be verbose, otherwise some structural details will be omitted for easier human consumption.
Returns:
The stream that was written.
See also:
Data_Component::print(std::ostream&, bool) const

Implements Data_Component.

References ID, Data_Component::internet_checksum(), Data_Component::put(), and Observation_ID::text().

Referenced by list_data(), and list_selections().

Aggregate * PVL (  ) const [virtual]

Produces a PVL rendition of the component.

Elements are organized into logical groupings. The Pad, Alignment and Checksum Elements are not included.

Returns:
A pointer to a PVL::Aggregate.
See also:
Data_Component::PVL() const

Implements Data_Component.

References Array::add(), Aggregate::add(), Science_Channel_Header::Analog_Power_On_Start_Time, Science_Channel_Header::Analog_Power_On_Time, Science_Channel_Header::Analog_Power_Operation, Science_Channel_Header::Binning_Command_Received, Science_Channel_Header::Binning_Operation, Instrument::CCD_NAMES, Instrument::CCDS, Science_Channel_Header::Channel, Science_Channel_Header::Channel_Readout_Bytes, Science_Channel_Header::Channel_Readout_Command, Science_Channel_Header::Channel_Readout_Response, Science_Channel_Header::Channel_Readout_Ticks, Vectal< T >::clear(), Science_Channel_Header::CLOSED_LOOP, Science_Channel_Header::convert(), Science_Channel_Header::converted_units(), Data_Block::count_of(), Science_Channel_Header::CPMM, Science_Channel_Header::CPMM_Negative_5_Current, Science_Channel_Header::CPMM_Positive_29_Voltage, Science_Channel_Header::CPMM_Power_Command_Received, Science_Channel_Header::CPMM_PWS_Board_Temperature, Science_Channel_Header::Default_Binning, Science_Channel_Header::Default_TDI, Science_Channel_Header::Digital_Power_Operation, Science_Channel_Header::DUTY_CYCLES, Science_Channel_Header::Expose_Command, Science_Channel_Header::Expose_HiRISE_Time, Science_Channel_Header::Expose_MRO_Time, Science_Channel_Header::Expose_Response, Science_Channel_Header::Expose_Time_Milliseconds, Science_Channel_Header::Expose_Time_Ticks, Science_Channel_Header::Exposure_Readout_Count, Science_Channel_Header::Exposure_Start_Time, Science_Channel_Header::Extra_Pixels, Science_Channel_Header::Focus_Motor_Temperature, Science_Channel_Header::Focus_Position, Science_Channel_Header::FPGA_last_response_CPMM_PWS_enabled(), Science_Channel_Header::FPGA_last_response_FM_moving(), Science_Channel_Header::FPGA_last_response_FM_overheated(), Science_Channel_Header::FPGA_last_response_FM_relay_PHA_closed(), Science_Channel_Header::FPGA_last_response_FM_relay_PHB_closed(), Science_Channel_Header::FPGA_last_response_heaters_on(), Science_Channel_Header::FPGA_last_response_stim_LEDs_on(), Science_Channel_Header::FPGA_last_response_telemetry_gathering(), Science_Channel_Header::Heater_Control_Mode, Science_Channel_Header::Heater_Controls, Science_Channel_Header::Heater_Current, Science_Channel_Header::Heater_Disabled_For_Exposure, Science_Channel_Header::Heater_Zones_Enabled, Science_Channel_Header::Heater_Zones_Pre_Exposure_State, Science_Channel_Header::Heater_Zones_State, Science_Channel_Header::IE_PWS_Board_Temperature, Science_Channel_Header::IEA_Positive_5_Voltage, Science_Channel_Header::Instrument_Control_Board_Temperature, Science_Channel_Header::Instrument_Control_FPGA_Positive_2_5_Voltage, Science_Channel_Header::Last_Command_Time, Science_Channel_Header::Line_Count_Command_Received, Science_Channel_Header::Line_Count_Operation, Science_Channel_Header::Line_Header_Bytes, Science_Channel_Header::Line_Time_Command_Received, Science_Channel_Header::Line_Time_Nanoseconds, Science_Channel_Header::Line_Time_Operation, Science_Channel_Header::LUT_Operation, Science_Channel_Header::Max_Storable_Lines, Science_Channel_Header::Max_Storable_Lines_Exceeded, Science_Channel_Header::Mech_TLM_Board_Temperature, Science_Channel_Header::NAME, Science_Channel_Header::NAMES, Science_Channel_Header::Optical_Bench_Flexure_Temperature, Science_Channel_Header::Pixel_Bytes, Science_Channel_Header::Pixel_Data_Bytes, Science_Channel_Header::Pixels_Per_Line, Science_Channel_Header::Post_Binned_Lines, Science_Channel_Header::Post_Binned_Pixels_Per_Line, Science_Channel_Header::Powered_CPMMs_Count, Science_Channel_Header::Powered_CPMMs_Map, Science_Channel_Header::Readout_Pad_Bytes, Science_Channel_Header::Readout_Start_Time, Instrument::STIMULATOR_LEDS, Science_Channel_Header::TDI_Command_Received, Science_Channel_Header::TDI_Operation, Science_Channel_Header::time(), Science_Channel_Header::Total_Image_Bytes, Science_Channel_Header::Total_Lines_Collected, Science_Channel_Header::Total_Lines_Exposed, Science_Channel_Header::Transaction_ID, Science_Channel_Header::Trimming_Operation, Value::units(), and Data_Block::value_size_of().

Referenced by list_selections().

Aggregate * PVL_description (  ) const

Produces a PVL description of the component for a PDS label.

The description is an OBJECT that contains the basic PDS parameters required to describe a data product binary data object. The detailed description is referenced as being in an external file named with the value of FORMAT_FILENAME.

Returns:
A pointer to a PVL::Aggregate. The object pointed to is a copy of an internal static object.

References Science_Channel_Header::FORMAT_FILENAME, Parser::get_parameters(), and Science_Channel_Header::ID.

bool is_valid (  ) const [virtual]

Tests if the component data is valid.

The Sync Element values must equal the expected SYNC constants and the internet_checksum should produce a zero value.

Returns:
true if the component has valid data; false otherwise.
See also:
Data_Component::internet_checksum() const

Implements Data_Component.

References Data_Component::internet_checksum(), Science_Channel_Header::SYNC, and Science_Channel_Header::Sync.

bool is_sync ( const void *  data_at ) [static]

Tests if some data contains a sync sequence.

The data must contain at least two 32-bit, MSB ordered, values each of which is a Science_Channel_Header::SYNC value for the test to be true.

Parameters:
data_atA pointer to the data to be tested.
Returns:
true if the data contains two sequential SYNC values; false otherwise.
void * sync_at ( void *  begin,
void *  end 
) [static]

Searches a range of bytes for a Science Channel Header sync pattern.

N.B.: If the search range does not have at least at least enough bytes to contain the sync pattern (i.e. SYNC_BYTES) then no search can be done. The last byte sequence that will be checked starts at end - SYNC_BYTES. The bytes following this location may contain the beginning of a sync pattern, but this will not produce a match.

Parameters:
beginA pointer to the beginning of the search range.
endA pointer to the end of the search range; i.e. the location immediately following the last byte in the search range.
Returns:
A pointer to the sync pattern. This will be NULL if no sync pattern was found.
See also:
is_sync()

Member Data Documentation

const char *const ID = "UA::HiRISE::Science_Channel_Header (1.52 2010/11/25 02:51:13)" [static]

Class identification name with source code version and date.

Reimplemented from Data_Component.

Referenced by Science_Channel_Header::id(), main(), and Science_Channel_Header::PVL_description().

const char *const NAME = "Science Channel Header" [static]

The component name.

Referenced by Science_Channel_Header::name(), and Science_Channel_Header::PVL().

const char * NAMES [static]

The name of each Element.

Referenced by Science_Channel_Header::PVL(), and Observation::PVL_PDS().

const Index COMPONENT_BYTES = SCIENCE_CHANNEL_HEADER_BYTES [static]

Total number of bytes in the Data_Block.

Referenced by Observation::components(), Observation::line(), and Observation::PVL_PDS().

const Index OFFSETS [static]

Data_Block data storage address offset for each Element.

const Index ARRAY_COUNTS [static]
Initial value:

Data_Block array element value counts each keyed to an Element Index.

All values of an array element are the same size (the total size of the Element divided by the count of array entries). Any Element not listed here has only one value.

ARRAY_COUNTS[*][0]
An Element Index.
ARRAY_COUNTS[*][1]
The number of array values for the indexed Element.

This list must be zero-terminated.

See also:
Data_Block::size_of(Index)
Data_Block::count_of(Index)
const u_int_32 SYNC = 0xFFFF0000 [static]

Expected Sync Element values.

Referenced by Science_Channel_Header::is_valid(), and main().

const int SYNC_BYTES = 2 * sizeof (SYNC) [static]

The number of bytes in the sync pattern.

FPGA_Last_Response Element bit fields.

Referenced by Science_Channel_Header::FPGA_last_response_CPMM_PWS_enabled().

Initial value:
 ((1 << 16) |
                                                                           (1 << 15) |
                                                                           (1 << 14))

Referenced by Science_Channel_Header::FPGA_last_response_stim_LEDs_on().

The array of all Conversion_Coefficients.

const double CELCIUS_TO_KELVINS_OFFSET [static]

Offset to be added to Celcius degrees to obtain Kelvins.

const char *const FORMAT_FILENAME = SCIENCE_CHANNEL_HEADER_FORMAT_FILE [static]

The name of the external PDS format description file.

Referenced by Science_Channel_Header::PVL_description().


The documentation for this class was generated from the following files: