Observation
|
An Engineering_Header contains a minimal core set of observation control parameters. More...
#include <Engineering_Header.hh>
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< Index > | Value_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_Header & | operator= (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::Aggregate * | PVL () const |
Produces a PVL rendition of the component. More... | |
idaeim::PVL::Aggregate * | PVL_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_Component & | operator= (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_Component & | put (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_Component & | name_field_width (unsigned int width) |
Sets the width of the Element name field for printing. More... | |
Data_Block & | data (void *const block) |
Overrides the base Data_Block::data to reset Local_Data. More... | |
Data_Block & | attach (void *const block, unsigned int size) |
Attaches a new block of data to the component. More... | |
Data_Component & | resize (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_Block & | operator= (const Data_Block &data_block) |
virtual | ~Data_Block () |
bool | native () const |
Data_Block & | native (bool native_order) |
Data_Order | data_order () const |
Data_Block & | data_order (Data_Order order) |
unsigned char * | data () const |
Index | size () const |
Value_List | element_offsets_list () const |
Index * | element_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_Block & | delete_element (Index element) |
Data_Block & | shift_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_Block & | value_size_of (Index element, Index size) |
Index | index_of (Index offset) const |
Value_List | array_counts_list () const |
Index * | array_counts () |
Data_Block & | array_counts (const Value_List &counts, Index begin=0) |
Data_Block & | array_counts (const Index *counts, Index begin=0, Index end=NO_INDEX) |
Data_Block & | array_indexed_counts (const Index indexed_counts[][2], Index total_counts=NO_INDEX) |
Data_Block & | array_offset_counts (const Index offset_counts[][2], Index total_counts=NO_INDEX) |
Index | count_of (Index element) const |
Data_Block & | count_of (Index element, Index count) |
bool | reset_counts (bool unconditional=true, Index begin=0, Index end=NO_INDEX) |
const Data_Block & | get (T &value, const Index element, const Index index=0) const |
const Data_Block & | get (T &value, const Index element, const Index index=0) const |
T | get (const Index element, const Index index=0) const |
T | get (const Index element, const Index index=0) const |
Data_Block & | put (T &value, const Index element, const Index index=0) |
Data_Block & | put (T &value, const Index element, const Index index=0) |
const Data_Block & | get (T *array, const Index element, Index count=0) const |
const Data_Block & | get (T *array, const Index element, Index count=0) const |
Data_Block & | put (T *array, const Index element, Index count=0) |
Data_Block & | put (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_List & | sizes_to_offsets (Value_List &sizes) |
static Index * | sizes_to_offsets (Index *sizes, Index total_elements=NO_INDEX) |
static Value_List & | offsets_to_sizes (Value_List &offsets) |
static Index * | offsets_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) |
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 ;-).
1.28
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.
enum DLL_Clock |
enum ADC_Timing_Field |
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.
|
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.
stream | The istream from which to read the component data. |
References Data_Block::input().
Engineering_Header | ( | const Engineering_Header & | component, |
bool | data_duplicate = true |
||
) |
Copy constructor.
component | The Engineering_Header to be copied. |
data_duplicate | true if the data content of the copied component is to be duplicated in the copy; false if the data content is to be shared. |
Engineering_Header & operator= | ( | const Engineering_Header & | component | ) |
Assigns another Engineering_Header to this one.
component | The Engineering_Header to be assigned. |
References Data_Component::operator=().
|
virtual |
Provides the class ID on a line followed by the base Data_Component::id.
Reimplemented from Data_Component.
References Data_Component::id(), and Engineering_Header::ID.
|
virtual |
Gets the NAME of this class.
Implements Data_Component.
References Engineering_Header::NAME.
u_int_32 ADC_timing | ( | Index | channel, |
ADC_Timing_Field | field | ||
) | const |
Gets an ADC timing value.
channel | The channel number (0 or 1), for which to get the timing value. |
field | An ADC_Timing_Field selection for either the ADC_RESET_TIMING or ADC_IMAGE_TIMING. |
References Engineering_Header::ADC_Timing_Settings, and Data_Component::get().
Referenced by Observation::PVL_PDS().
|
virtual |
Prints the component structure and contents.
Verbose printing includes the class ID and the Pad Element.
stream | The ostream where the listing will be written. |
verbose | true if the listing is to be verbose, otherwise some structural details will be omitted for easier human consumption. |
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().
|
virtual |
Produces a PVL rendition of the component.
The Pad Element is not included.
Implements Data_Component.
References Engineering_Header::ADC_Timing_Settings, Aggregate::add(), Array::add(), Engineering_Header::Binning_Factor, Vectal< T >::clear(), 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::get(), Engineering_Header::LUT_Compressed, Engineering_Header::NAME, and Engineering_Header::NAMES.
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.
References Engineering_Header::FORMAT_FILENAME, Parser::get_parameters(), Engineering_Header::ID, and UA::HiRISE::PVL_value().
Referenced by Observation::PVL_PDS().
|
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.
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.
|
static |
Class identification name with source code version and date.
Referenced by Engineering_Header::id(), main(), Engineering_Header::print(), and Engineering_Header::PVL_description().
|
static |
The component name.
Referenced by Engineering_Header::name(), Engineering_Header::print(), and Engineering_Header::PVL().
|
static |
The name of each Element.
Referenced by Engineering_Header::PVL().
|
static |
Total number of bytes in the Data_Block.
Referenced by Observation::components(), Observation::line(), and Observation::PVL_PDS().
|
static |
Data_Block data storage address offset for each Element.
|
static |
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.
This list must be zero-terminated. @see Data_Block::size_of(Index) @see Data_Block::count_of(Index)
|
static |
The name of the external PDS format description file.
Referenced by Engineering_Header::PVL_description().
|
static |
ADC_Timing_Settings field value masks.