HiRISE
 Observation

Public Types | Public Member Functions | Static Public Attributes | List of all members
Engineering_Header Class Reference

An Engineering_Header contains a minimal core set of observation control parameters. More...

#include <Engineering_Header.hh>

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

Public Types

enum  Element {
  LUT_Compressed ,
  Binning_Factor ,
  Delta_Line_Time ,
  TDI_Stages ,
  Trimming ,
  Post_Binned_Lines ,
  FPGA_Code_Version ,
  DLL_Locked ,
  DLL_Reset_Count ,
  DLL_Locked_Once ,
  DLL_Frequency_Correct_Count ,
  ADC_Timing_Settings ,
  Pad ,
  Total_Elements
}
 An Element refers to a data containing constituent of a component. More...
 
enum  DLL_Clock {
  FIRST_CLOCK ,
  SECOND_CLOCK
}
 Selects DLL_Locked{_Once} clock. More...
 
enum  ADC_Timing_Field {
  ADC_RESET_TIMING ,
  ADC_IMAGE_TIMING
}
 Selects ADC_timing field. More...
 
- Public Types inherited from Data_Block
enum  Data_Order
 
enum  Array_Index_Counts
 
enum  Array_Offset_Counts
 
typedef unsigned int Index
 
typedef std::vector< IndexValue_List
 
typedef void(* Copier) (unsigned char *destination, int destination_amount, const unsigned char *source, int source_amount)
 

Public Member Functions

 Engineering_Header ()
 Constructs an empty Engineering_Header. More...
 
 Engineering_Header (std::istream &stream)
 Constructs an Engineering_Header loaded from a data stream. More...
 
 Engineering_Header (const Engineering_Header &component, bool data_duplicate=true)
 Copy constructor. More...
 
Engineering_Headeroperator= (const Engineering_Header &component)
 Assigns another Engineering_Header to this one. More...
 
std::string id () const
 Provides the class ID on a line followed by the base Data_Component::id. More...
 
const char * name () const
 Gets the NAME of this class. More...
 
u_int_32 ADC_timing (Index channel, ADC_Timing_Field field) const
 Gets an ADC timing value. More...
 
std::ostream & print (std::ostream &stream=std::cout, bool verbose=false) const
 Prints the component structure and contents. More...
 
idaeim::PVL::AggregatePVL () const
 Produces a PVL rendition of the component. More...
 
idaeim::PVL::AggregatePVL_description () const
 Produces a PVL description of the component for a PDS label. More...
 
bool is_valid () const
 Tests if the component data is valid. More...
 
- Public Member Functions inherited from Data_Component
 Data_Component (const char **names=NULL, unsigned int size=0, const Index *offsets=NULL, const Index indexed_arrays[][2]=NULL, Data_Order order=Data_Block::MSB)
 Constructs a Data_Component using component specifications. More...
 
 Data_Component (const Data_Component &component, bool data_duplicate=true)
 Copy constructor. More...
 
Data_Componentoperator= (const Data_Component &component)
 Assignment operator. More...
 
virtual ~Data_Component ()
 Destructor. More...
 
const char * name (Index element) const
 Gets the name of a component Element. More...
 
virtual u_int_32 get (Index element, Index index=0) const
 Gets a value from a data Element or array entry of the component. More...
 
virtual Data_Componentput (const u_int_32 value, Index element, Index index=0)
 Puts a value into a data Element or array entry of the component. More...
 
std::ostream & print_element (const Index element, int format=DECIMAL, std::ostream &stream=std::cout, int width=0) const
 Prints an Element description. More...
 
std::ostream & print_element (const Index element, std::ostream &stream) const
 Prints an Element description. More...
 
std::ostream & print_element_location (const Index element, std::ostream &stream=std::cout) const
 Prints the location of an Element in the component. More...
 
unsigned int element_location_print_width (Index element) const
 Gets the width of the Element location printing fields. More...
 
unsigned int name_field_width () const
 Gets the width of the Element name printing field. More...
 
Data_Componentname_field_width (unsigned int width)
 Sets the width of the Element name field for printing. More...
 
Data_Blockdata (void *const block)
 Overrides the base Data_Block::data to reset Local_Data. More...
 
Data_Blockattach (void *const block, unsigned int size)
 Attaches a new block of data to the component. More...
 
Data_Componentresize (unsigned int size)
 Resizes the block of local data storage. More...
 
unsigned char * data () const
 Gets a pointer to the current component storage. More...
 
unsigned int local_data ()
 Gets the size of the local data storage area. More...
 
u_int_16 internet_checksum () const
 Calculates the Internet Checksum as per RFC 1071. More...
 
- Public Member Functions inherited from Data_Block
 Data_Block ()
 
 Data_Block (void *const data, const Index *offsets, Index total_elements=0, const Index *array_counts=NULL, bool native_order=true)
 
 Data_Block (void *const data, const Value_List &offsets, const Value_List &array_counts, bool native_order=true)
 
 Data_Block (void *const data, const Value_List &offsets, bool native_order=true)
 
 Data_Block (void *const data, const Index *offsets, Index total_elements, const Index *array_counts, Data_Order data_order)
 
 Data_Block (void *const data, const Value_List &offsets, const Value_List &array_counts, Data_Order data_order)
 
 Data_Block (void *const data, const Index *offsets, Index total_elements, Data_Order data_order)
 
 Data_Block (void *const data, const Index *offsets, Data_Order data_order)
 
 Data_Block (void *const data, const Value_List &offsets, Data_Order data_order)
 
 Data_Block (void *const data, const Index *offsets, const Index indexed_counts[][2], Data_Order data_order)
 
 Data_Block (const Data_Block &data_block)
 
Data_Blockoperator= (const Data_Block &data_block)
 
virtual ~Data_Block ()
 
bool native () const
 
Data_Blocknative (bool native_order)
 
Data_Order data_order () const
 
Data_Blockdata_order (Data_Order order)
 
unsigned char * data () const
 
Index size () const
 
Value_List element_offsets_list () const
 
Indexelement_offsets ()
 
bool element_offsets (const Value_List &offsets)
 
bool element_offsets (const Index *offsets, Index total_elements=NO_INDEX)
 
bool element_sizes (const Value_List &sizes)
 
bool element_sizes (const Index *sizes, Index total_elements=NO_INDEX)
 
Index offset_of (Index element) const
 
bool offset_of (Index element, Index offset)
 
bool insert_element (Index offset, Index size, Index array_count=1)
 
Data_Blockdelete_element (Index element)
 
Data_Blockshift_offsets (int amount)
 
Index elements () const
 
Index size_of (Index element) const
 
bool size_of (Index element, Index size)
 
Index value_size_of (Index element) const
 
Data_Blockvalue_size_of (Index element, Index size)
 
Index index_of (Index offset) const
 
Value_List array_counts_list () const
 
Indexarray_counts ()
 
Data_Blockarray_counts (const Value_List &counts, Index begin=0)
 
Data_Blockarray_counts (const Index *counts, Index begin=0, Index end=NO_INDEX)
 
Data_Blockarray_indexed_counts (const Index indexed_counts[][2], Index total_counts=NO_INDEX)
 
Data_Blockarray_offset_counts (const Index offset_counts[][2], Index total_counts=NO_INDEX)
 
Index count_of (Index element) const
 
Data_Blockcount_of (Index element, Index count)
 
bool reset_counts (bool unconditional=true, Index begin=0, Index end=NO_INDEX)
 
const Data_Blockget (T &value, const Index element, const Index index=0) const
 
const Data_Blockget (T &value, const Index element, const Index index=0) const
 
get (const Index element, const Index index=0) const
 
get (const Index element, const Index index=0) const
 
Data_Blockput (T &value, const Index element, const Index index=0)
 
Data_Blockput (T &value, const Index element, const Index index=0)
 
const Data_Blockget (T *array, const Index element, Index count=0) const
 
const Data_Blockget (T *array, const Index element, Index count=0) const
 
Data_Blockput (T *array, const Index element, Index count=0)
 
Data_Blockput (T *array, const Index element, Index count=0)
 
std::istream & input (std::istream &stream)
 
std::ostream & output (std::ostream &stream) const
 
std::ostream & print (std::ostream &stream=std::cout) const
 

Static Public Attributes

static const char *const ID
 Class identification name with source code version and date. More...
 
static const char *const NAME = "Engineering Header"
 The component name. More...
 
static const char * NAMES []
 The name of each Element. More...
 
static const Index COMPONENT_BYTES = ENGINEERING_HEADER_BYTES
 Total number of bytes in the Data_Block. More...
 
static const Index OFFSETS []
 Data_Block data storage address offset for each Element. More...
 
static const Index ARRAY_COUNTS [][2]
 Data_Block array element value counts each keyed to an Element Index. More...
 
static const char *const FORMAT_FILENAME = ENGINEERING_HEADER_FORMAT_FILE
 The name of the external PDS format description file. More...
 
static const u_int_32 ADC_TIMING_MASKS [2] = {0x0F, 0xF0}
 ADC_Timing_Settings field value masks. More...
 
- Static Public Attributes inherited from Data_Component
static const char *const ID
 Class identification name with source code version and date. More...
 
static const int DECIMAL = 0
 Format specifier. More...
 
static const int HEX = -1
 
static const int BOOLEAN = -2
 
static const char PATHNAME_DELIMITER = FILESYSTEM_PATHNAME_DELIMITER
 Host filesystem pathname delimiter. More...
 
static const int UTC_SECONDS_PRECISION = SECONDS_PRECISION
 UTC seconds precision (digits after the decimal point). More...
 
static const char SUBSECONDS_DELIMITER = ':'
 Delimits subseconds from seconds in clock count representations. More...
 
static const char *const SPICE_METAKERNEL_VARIABLE
 The name of the environment variable for the SPICE metakernel pathname. More...
 
static const char *const DEFAULT_SPICE_METAKERNEL
 The default SPICE metakernal pathname. More...
 
static const int MRO_CLOCK_ID = MRO_CLOCK_NAIF_ID
 The ID used by NAIF for specifying the MRO clock to CSPICE routines. More...
 
static const char *const INVALID_UTC_TIME = DEFAULT_INVALID_UTC_TIME
 
- Static Public Attributes inherited from Instrument
static const char *const ID
 
static const unsigned int CCDS
 
static const unsigned int CCD_UNKNOWN
 
static const char *const CCD_NAMES []
 
static const char *const CCD_FILTER_NAMES []
 
static const unsigned int CCD_BY_CPMM []
 
static const unsigned int CPMM_BY_CCD []
 
static const char *const WAVELENGTH_UNITS
 
static const unsigned int CCD_CENTER_WAVELENGTHS []
 
static const unsigned int CCD_BANDWIDTHS []
 
static const double CCD_FOCAL_PLANE_X_OFFSETS_MM []
 
static const double CCD_FOCAL_PLANE_Y_OFFSETS_MM []
 
static const double CCD_PIXEL_SIZE_MM
 
static const unsigned int CCD_CHANNELS
 
static const unsigned int CCD_CHANNEL_UNKNOWN
 
static const unsigned int CCD_IMAGE_SENSORS
 
static const unsigned int MAX_BYTES_PER_PIXEL
 
static const unsigned int MAX_PIXEL_VALUES []
 
static const unsigned int MAX_IMAGE_LINES
 
static const unsigned int TOTAL_TDI_STAGES
 
static const unsigned int TDI_STAGES []
 
static const unsigned int TOTAL_BINNING_FACTORS
 
static const unsigned int BINNING_FACTORS []
 
static const unsigned int CCD_BINNED_PIXELS []
 
static const unsigned int STORED_LUTS
 
static const unsigned int STIMULATOR_LEDS
 
static const char *const STIMULATOR_LED_NAMES []
 
static const double EXPOSURE_SETUP_MICROS
 
static const unsigned int DELTA_LINE_TIME_MAX
 
static const double DELTA_LINE_TIME_TICK_NANOS
 
static const double LINE_TIME_PRE_OFFSET
 
static const unsigned int TRIM_ADDITION_LINES
 
static const unsigned int REVERSE_READOUT_LINES
 
static const unsigned int MASKED_LINES
 
static const unsigned int DLL_LOCKED
 
static const unsigned int DLL_NOT_LOCKED
 
static const unsigned int SPACECRAFT_EPOCH
 
static const double MRO_CLOCK_SUBTICK_MICROS
 
static const double HIRISE_CLOCK_SUBTICK_MICROS
 
static const int SPACECRAFT_NAIF_ID
 
static const unsigned int SSR_BYTE_BOUNDARY
 
static const int UNKNOWN_NUMBER
 
static const int NOT_APPLICABLE_NUMBER
 
static const char *const UNKNOWN_STRING
 
static const char *const NOT_APPLICABLE_STRING
 
- Static Public Attributes inherited from Data_Block
static const char *const ID
 
static const Index NO_INDEX
 

Additional Inherited Members

- Static Public Member Functions inherited from Instrument
static unsigned int calibration_lines_minimum (unsigned int TDI, unsigned int binning)
 
static int focal_plane_x_offset (unsigned int CPMM, unsigned int binning=1)
 
- Static Public Member Functions inherited from Data_Block
static Data_Order native_order ()
 
static Value_Listsizes_to_offsets (Value_List &sizes)
 
static Indexsizes_to_offsets (Index *sizes, Index total_elements=NO_INDEX)
 
static Value_Listoffsets_to_sizes (Value_List &offsets)
 
static Indexoffsets_to_sizes (Index *offsets, Index total_elements=NO_INDEX)
 
- Public Attributes inherited from Data_Block
 MSB
 
 LSB
 
 ELEMENT_INDEX
 
 INDEX_COUNT
 
 ELEMENT_OFFSET
 
 OFFSET_COUNT
 
Copier Get
 
Copier Put
 
- Protected Member Functions inherited from Data_Block
void limits_checker (const Index element, const Index index, bool getter, bool array) const
 
- Static Protected Member Functions inherited from Data_Block
static void get_forwards (unsigned char *host, int host_amount, const unsigned char *data, int data_amount)
 
static void get_backwards (unsigned char *host, int host_amount, const unsigned char *data, int data_amount)
 
static void put_forwards (unsigned char *data, int data_amount, const unsigned char *host, int host_amount)
 
static void put_backwards (unsigned char *data, int data_amount, const unsigned char *host, int host_amount)
 

Detailed Description

An Engineering_Header contains a minimal core set of observation control parameters.

This Data_Component is the last in the HiRISE observation channel data stream before the image data sequence. Its values are considered to be the most reliable if there is any disagreement with corresponding values from the Science_Channel_Header.

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     1  LUT Compressed flag
         1     1  Binning factor
         2     3  Delta line time
         5     1  TDI stages
         6     2  Trimming value
         8     3  Post-binned lines
        11     1  FPGA code version
        12     1  First 96 MHz DLL lock indicator
                    0x11 - Locked
                    0x5A - Out of lock
        13     1  Second 96 MHz DLL lock indicator
        14     1  DLL reset count
        15     1  First 96 MHz DLL locked once indicator
                    0x11 - Locked once
                    0x5A - Never locked
        16     1  Second 96 MHz DLL locked once indicator
        17     1  96 MHz DLL frequency correct count
        18     1  Channel 0 ADC timing settings
                    Bits   Description
                    -----  -----------
                    0 - 3  Reset pulse
                    4 - 7  Video pulse
        19     1  Channel 1 ADC timing settings
        20    40  (padding)

N.B.: Data_Block values are MSB ordered.

Note the awkward use of 3 byte integers (odd ;-).

Author
Bradford Castalia, UA/PIRL

1.28

See also
Data_Component

Member Enumeration Documentation

◆ Element

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
LUT_Compressed 
Binning_Factor 
Delta_Line_Time 
TDI_Stages 
Trimming 
Post_Binned_Lines 
FPGA_Code_Version 
DLL_Locked 
DLL_Reset_Count 
DLL_Locked_Once 
DLL_Frequency_Correct_Count 
ADC_Timing_Settings 
Pad 
Total_Elements 

◆ DLL_Clock

enum DLL_Clock

Selects DLL_Locked{_Once} clock.

Enumerator
FIRST_CLOCK 
SECOND_CLOCK 

◆ ADC_Timing_Field

Selects ADC_timing field.

Enumerator
ADC_RESET_TIMING 
ADC_IMAGE_TIMING 

Constructor & Destructor Documentation

◆ Engineering_Header() [1/3]

Constructs an empty Engineering_Header.

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

◆ Engineering_Header() [2/3]

Engineering_Header ( std::istream &  stream)
explicit

Constructs an Engineering_Header loaded from a data stream.

The base Data_Component is initialized with the NAMES, COMPONENT_BYTES, OFFSETS, and ARRAY_COUNTS that define an Engineering_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 Engineering_Header data.

Parameters
streamThe istream from which to read the component data.

References Data_Block::input().

◆ Engineering_Header() [3/3]

Engineering_Header ( const Engineering_Header component,
bool  data_duplicate = true 
)

Copy constructor.

Parameters
componentThe Engineering_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

◆ operator=()

Engineering_Header & operator= ( const Engineering_Header component)

Assigns another Engineering_Header to this one.

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

References Data_Component::operator=().

◆ id()

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 Data_Component::id(), and Engineering_Header::ID.

◆ name()

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 Engineering_Header::NAME.

◆ ADC_timing()

u_int_32 ADC_timing ( Index  channel,
ADC_Timing_Field  field 
) const

Gets an ADC timing value.

Parameters
channelThe channel number (0 or 1), for which to get the timing value.
fieldAn ADC_Timing_Field selection for either the ADC_RESET_TIMING or ADC_IMAGE_TIMING.
Returns
The timing value (expect 4, 5 or 6).

References Engineering_Header::ADC_Timing_Settings, and Data_Component::get().

Referenced by Observation::PVL_PDS().

◆ print()

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

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 Engineering_Header::ADC_Timing_Settings, Engineering_Header::Binning_Factor, Data_Component::BOOLEAN, Engineering_Header::DLL_Frequency_Correct_Count, Engineering_Header::DLL_Locked, Engineering_Header::DLL_Locked_Once, Engineering_Header::DLL_Reset_Count, Engineering_Header::FPGA_Code_Version, Data_Component::HEX, Engineering_Header::ID, Engineering_Header::LUT_Compressed, Engineering_Header::NAME, Engineering_Header::Pad, and Data_Component::print_element().

Referenced by list_data(), and list_selections().

◆ PVL()

Aggregate * PVL ( ) const
virtual

◆ PVL_description()

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 Engineering_Header::FORMAT_FILENAME, Parser::get_parameters(), Engineering_Header::ID, and UA::HiRISE::PVL_value().

Referenced by Observation::PVL_PDS().

◆ is_valid()

bool is_valid ( ) const
virtual

Tests if the component data is valid.

The Binning_Factor, TDI_Stages, and FPGA_Code_Version Elements must have non-zero values. In addition, the Binning_Factor and TDI_Stages Elements must be one of the allowed Instrument constant values.

Returns
true if the component has valid data; false otherwise.

Implements Data_Component.

References Engineering_Header::Binning_Factor, Instrument::BINNING_FACTORS, Engineering_Header::FPGA_Code_Version, Data_Component::get(), UA::HiRISE::member_of(), Instrument::TDI_STAGES, Engineering_Header::TDI_Stages, Instrument::TOTAL_BINNING_FACTORS, and Instrument::TOTAL_TDI_STAGES.

Member Data Documentation

◆ ID

const char *const ID
static
Initial value:
=
"UA::HiRISE::Engineering_Header (1.36 2020/02/14 01:17:18)"

Class identification name with source code version and date.

Referenced by Engineering_Header::id(), main(), Engineering_Header::print(), and Engineering_Header::PVL_description().

◆ NAME

const char *const NAME = "Engineering Header"
static

◆ NAMES

const char * NAMES
static
Initial value:
=
{
"LUT_COMPRESSED",
"BINNING_FACTOR",
"DELTA_LINE_TIME",
"TDI_STAGES",
"TRIMMING",
"POST_BINNED_LINES",
"FPGA_CODE_VERSION",
"DLL_LOCKED",
"DLL_RESET_COUNT",
"DLL_LOCKED_ONCE",
"DLL_FREQUENCY_CORRECT_COUNT",
"ADC_TIMING_SETTINGS",
"PAD",
NULL
}

The name of each Element.

Referenced by Engineering_Header::PVL().

◆ COMPONENT_BYTES

const Index COMPONENT_BYTES = ENGINEERING_HEADER_BYTES
static

Total number of bytes in the Data_Block.

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

◆ OFFSETS

const Index OFFSETS
static
Initial value:
=
{
0,
1,
2,
5,
6,
8,
11,
12,
14,
15,
17,
18,
20,
0
}
static const Index COMPONENT_BYTES
Total number of bytes in the Data_Block.
Definition: Engineering_Header.hh:142

Data_Block data storage address offset for each Element.

◆ ARRAY_COUNTS

const Index ARRAY_COUNTS
static
Initial value:
=
{
{DLL_Locked, 2},
{Pad, 40},
{0,0}
}
@ DLL_Locked
Definition: Engineering_Header.hh:125
@ ADC_Timing_Settings
Definition: Engineering_Header.hh:129
@ Pad
Definition: Engineering_Header.hh:130
@ DLL_Locked_Once
Definition: Engineering_Header.hh:127

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    Data_Block::size_of(Index)
@see    Data_Block::count_of(Index)

◆ FORMAT_FILENAME

const char *const FORMAT_FILENAME = ENGINEERING_HEADER_FORMAT_FILE
static

The name of the external PDS format description file.

Referenced by Engineering_Header::PVL_description().

◆ ADC_TIMING_MASKS

const u_int_32 ADC_TIMING_MASKS = {0x0F, 0xF0}
static

ADC_Timing_Settings field value masks.


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