Observation
|
High Resolution Imaging Science Experiment. More...
Classes | |
class | CCD_ID |
class | Channel_ID |
class | Data_Component |
A Data_Component provides a common, virtual interface for all HiRISE Observation data blocks. More... | |
class | Engineering_Header |
An Engineering_Header contains a minimal core set of observation control parameters. More... | |
struct | Error |
class | Exception |
class | FELICS_Line_Cache |
A FELICS_Line_Cache extends a Line_Cache by adding management of FELICS compressed line data. More... | |
class | Gap_Map |
A Gap_Map contains a map of data gap ranges for the file with which it is associated. More... | |
class | Image_Line |
An Image_Line contains a cache of observation channel image pixel data. More... | |
class | Instrument |
struct | Invalid_Argument |
class | Label_Patcher |
class | Line_Cache |
A Line_Cache manages the data contents for an Image_Line. More... | |
class | LUT |
A LUT contains the lookup table used to map 14-bit CCD sensor values to 8-bit image pixel values. More... | |
class | MROSP_Header |
An MROSP_Header contains information used by the HiRISE instrument to identify a stored data block to the MRO spacecraft for downlink to Earth. More... | |
class | Observation |
Observation manages the components of a MRO HiRISE instrument science observation data set. More... | |
class | Observation_ID |
struct | Out_of_Range |
class | Science_Channel_Header |
A Science_Channel_Header contains the science metadata describing the observation channel data. More... | |
Typedefs | |
typedef INT_8_TYPE | int_8 |
8-bit integer type. | |
typedef U_INT_8_TYPE | u_int_8 |
8-bit unsigned integer type. | |
typedef INT_16_TYPE | int_16 |
16-bit integer type. | |
typedef U_INT_16_TYPE | u_int_16 |
16-bit unsigned integer type. | |
typedef INT_32_TYPE | int_32 |
32-bit integer type. | |
typedef U_INT_32_TYPE | u_int_32 |
32-bit unsigned integer type. | |
typedef INT_64_TYPE | int_64 |
64-bit integer type. | |
typedef U_INT_64_TYPE | u_int_64 |
64-bit unsigned integer type. | |
typedef PIRL::Data_Block::Index | Index |
Data_Block element index type. | |
typedef u_int_16 | Pixel_type |
The type of a generic pixel value. | |
Enumerations | |
enum | Parameter_Class_Selection { AGGREGATE_PARAMETER = -1 , ANY_PARAMETER = 0 , ASSIGNMENT_PARAMETER = 1 } |
Selects the class of parameter for PVL_parameter to find. More... | |
enum | Clock_Selector { HiRISE_Clock , MRO_Clock } |
Used to select a clock. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &stream, const CCD_ID &ccd_id) |
std::ostream & | operator<< (std::ostream &stream, const Channel_ID &channel_id) |
void | sync_to_day_of_year (struct tm *time_struct) |
std::string | time_text (const int time=0, const std::string &format=Observation_ID::STANDARD_TIME_TEXT_FORMAT, const int epoch=Observation_ID::EPOCH) |
std::ostream & | operator<< (std::ostream &stream, const Observation_ID &obs_id) |
std::ostream & | operator<< (std::ostream &stream, const Data_Component &component) |
Prints a Data_Component to a stream. | |
std::ostream & | print_value (u_int_32 value, int format=Data_Component::DECIMAL, std::ostream &stream=std::cout, int width=0) |
Prints a value in a consistent Data_Component format. | |
string | bits (const unsigned int value, unsigned int count=0) |
Gets the string representation of a value in binary. | |
unsigned int | max_strlen (const char **strings) |
Finds the length of the longest string in the list. | |
std::string | to_upper (const std::string &characters) |
Converts all characters of a string to uppercase. | |
Parameter * | PVL_parameter (idaeim::PVL::Aggregate &aggregate, std::string pathname, bool case_sensitive=false, int skip=0, Parameter_Class_Selection parameter_class=ANY_PARAMETER) |
Gets a named PVL Parameter in an aggregate. | |
std::vector< std::string > | PVL_values (idaeim::PVL::Aggregate &aggregate, std::string pathname, bool case_sensitive=false, int skip=0) |
Gets the values of a named PVL Parameter in an aggregate. | |
bool | PVL_value (idaeim::PVL::Aggregate &aggregate, std::string pathname, unsigned int value, bool case_sensitive=false, int skip=0) |
Sets the value of a named PVL parameter in an aggregate. | |
bool | PVL_value (idaeim::PVL::Aggregate &aggregate, std::string pathname, int value, bool case_sensitive, int skip) |
bool | PVL_value (idaeim::PVL::Aggregate &aggregate, std::string pathname, const std::string &value, bool case_sensitive=false, int skip=0) |
Sets the value of a named PVL parameter in an aggregate. | |
string | UTC_time (double seconds, unsigned int epoch=Instrument::SPACECRAFT_EPOCH) |
Converts time in seconds to UTC representation. | |
string | clock_count (double seconds, Clock_Selector clock=HiRISE_Clock) |
Converts time in seconds to clock count representation. | |
double | seconds (const std::string &clock_count, Clock_Selector clock=HiRISE_Clock) |
Converts a clock count representation to time in seconds. | |
bool | member_of (const unsigned int value, const unsigned int *array, int size) |
Tests if a value is a member of an array. | |
bool | member_of (const char *const value, const char *const array[], int size) |
Test if a value is a member of an array. | |
string | hostname () |
Gets the name of the host system. | |
bool | file_exists (const std::string &filename) |
Tests if a file exists. | |
string | pathname (const std::string &filename="") |
Gets a fully qualified pathname for a filename. | |
string | pathname (const std::string &directory, const std::string &filename, const std::string &extension) |
Assembles a pathname from directory, filename, and extension segments. | |
string | filename (const std::string &pathname) |
Gets the filename portion of a pathname. | |
string | shift (std::string lines, int amount) |
Shifts (indents) lines of text by the specified number of spaces. | |
string | plural (int count) |
Gets a pluralization string. | |
std::ostream & | operator<< (std::ostream &stream, const Gap_Map &map) |
Prints a Gap_Map to a stream. | |
Pixel_type * | pukool_table (const idaeim::PVL::Value &conversion_table, Pixel_type *maping_table, double offset_percentage=LUT::DEFAULT_PUKOOL_OFFSET) |
Generates a reverse lookup (pukool) table from a LUT PVL_PDS LOOKUP_CONVERSION_TABLE Parameter Value. | |
std::ostream & | operator<< (std::ostream &stream, const Observation &observation) |
Prints an observation to a stream. | |
High Resolution Imaging Science Experiment.
typedef INT_8_TYPE int_8 |
8-bit integer type.
typedef U_INT_8_TYPE u_int_8 |
8-bit unsigned integer type.
typedef INT_16_TYPE int_16 |
16-bit integer type.
typedef U_INT_16_TYPE u_int_16 |
16-bit unsigned integer type.
typedef INT_32_TYPE int_32 |
32-bit integer type.
typedef unsigned int u_int_32 |
32-bit unsigned integer type.
typedef INT_64_TYPE int_64 |
64-bit integer type.
typedef U_INT_64_TYPE u_int_64 |
64-bit unsigned integer type.
typedef PIRL::Data_Block::Index Index |
Data_Block element index type.
typedef u_int_16 Pixel_type |
The type of a generic pixel value.
enum Clock_Selector |
std::ostream & operator<< | ( | std::ostream & | stream, |
const Data_Component & | component ) |
Prints a Data_Component to a stream.
stream | The ostream where the Data_Component will be printed. |
component | The Data_Component to be printed. |
std::ostream & print_value | ( | u_int_32 | value, |
int | format = Data_Component::DECIMAL, | ||
std::ostream & | stream = std::cout, | ||
int | width = 0 ) |
Prints a value in a consistent Data_Component format.
The integer value will be printed using one of these formats:
@param value The value to be printed. @param format The selected format of the output. @param stream The ostream for output. @param width The width of the representation, as applicable. @return The stream that was written.
References bits(), Data_Component::BOOLEAN, Data_Component::DECIMAL, and Data_Component::HEX.
Referenced by main(), Image_Line::print(), MROSP_Header::print(), Science_Channel_Header::print(), and Data_Component::print_element().
std::string bits | ( | const unsigned int | value, |
unsigned int | count = 0 ) |
Gets the string representation of a value in binary.
The most significant bit (msb) will be the first character in the string. If a bit is set, the corresponding character will be '1', otherwise it will be '0'. As an aid in reading the string of bits, after each fourth bit (from the right; lsb) a space character will be inserted.
value | The value to be represented. |
count | The number of bits to be included in the representation. If the count is 0 then all bits of the value will be represented. |
Referenced by Science_Channel_Header::print(), and print_value().
unsigned int max_strlen | ( | const char ** | strings | ) |
Finds the length of the longest string in the list.
strings | The list (char**) of strings. The list must be NULL terminated. |
std::string to_upper | ( | const std::string & | characters | ) |
Converts all characters of a string to uppercase.
characters | The string to be uppercased. |
Referenced by Observation::PVL_PDS(), and set_effective_values().
idaeim::PVL::Parameter * PVL_parameter | ( | idaeim::PVL::Aggregate & | aggregate, |
std::string | pathname, | ||
bool | case_sensitive = false, | ||
int | skip = 0, | ||
Parameter_Class_Selection | parameter_class = ANY_PARAMETER ) |
Gets a named PVL Parameter in an aggregate.
The Parameter to be found may be specified by a simple name, a relative pathname or an absolute pathname. A simple name is the name of a Parameter itself. A relative pathname is a simple name preceeded by the pathname of an Aggregate Parameter that must contain the Parameter with the simple name. An absolute pathname is a pathname that begins with a pathname delimiter ('/'); i.e. it is a fully qualified pathname beginning at the root of the Aggregate hierarchy, compared to a relative pathname that may begin at any Aggregate in the hierarchy.
Since it is not necessary that the pathname to each Parameter be unique, the number of matching pathnames to skip before selecting a Parameter may need to be specified to get the desired Parameter. Also, a specific type of Parameter - an Aggregate of Parameters or an Assignment of Values - may be specified. When skipping parameters, only the specified type, if any, are counted.
aggregate | The PVL::Aggregate to search. |
pathname | The pathname of the parameter to find. |
case_sensitive | If true, the pathname search is case sensitive; if false the pathname is not case sensitive. |
skip | The number of parameters that match the pathname to skip before selecting a matching parameter. |
parameter_class | A Parameter_Class_Selection: If AGGREGATE_PARAMETER, only Aggregate parameters will be selected; if ASSIGNMENT_PARAMETER, only Assignment parameters will be selected; otherwise any type of parameter (ANY_PARAMETER) is acceptable. |
References Aggregate::begin_depth(), Aggregate::end_depth(), and pathname().
Referenced by Label_Patcher::configure_database(), Label_Patcher::label_parameter(), main(), PVL_value(), PVL_value(), and PVL_values().
std::vector< std::string > PVL_values | ( | idaeim::PVL::Aggregate & | aggregate, |
std::string | pathname, | ||
bool | case_sensitive = false, | ||
int | skip = 0 ) |
Gets the values of a named PVL Parameter in an aggregate.
Only Assignment Parameters, which have Values, will be selected.
Each Value of the slected Parameter is converted to a string and added to the return vector. Numeric values may be converted back to a real number using the string_to_real function. An Array Value is flattened, at the place it occurs, to its Value contents.
aggregate | The PVL::Aggregate to search. |
pathname | The pathname of the parameter to find. |
case_sensitive | If true, the pathname search is case sensitive; if false the pathname is not case sensitive. |
skip | The number of parameters that match the pathname to skip before selecting a matching parameter. |
References ASSIGNMENT_PARAMETER, Array::begin_depth(), Array::end_depth(), Value::is_Array(), pathname(), PVL_parameter(), and Parameter::value().
Referenced by Label_Patcher::configure_database().
bool PVL_value | ( | idaeim::PVL::Aggregate & | aggregate, |
std::string | pathname, | ||
unsigned int | value, | ||
bool | case_sensitive = false, | ||
int | skip = 0 ) |
Sets the value of a named PVL parameter in an aggregate.
Only Assignment Parameters with a Value that is not an Array will be modified. However, the search for a matching pathname does not make this distinction.
aggregate | The PVL::Aggregate to search. |
pathname | The pathname of the parameter to find. |
value | The int value to assign to the parameter. |
case_sensitive | If true, the pathname search is case sensitive; if false the pathname is not case sensitive. |
skip | The number of parameters that match the pathname to skip before selecting the parameter to modify. |
References ASSIGNMENT_PARAMETER, Value::is_Array(), pathname(), PVL_parameter(), and Parameter::value().
Referenced by main(), Engineering_Header::PVL_description(), Gap_Map::PVL_description(), Image_Line::PVL_description(), Science_Channel_Header::PVL_description(), and PVL_value().
bool PVL_value | ( | idaeim::PVL::Aggregate & | aggregate, |
std::string | pathname, | ||
int | value, | ||
bool | case_sensitive, | ||
int | skip ) |
References pathname(), and PVL_value().
bool PVL_value | ( | idaeim::PVL::Aggregate & | aggregate, |
std::string | pathname, | ||
const std::string & | value, | ||
bool | case_sensitive = false, | ||
int | skip = 0 ) |
Sets the value of a named PVL parameter in an aggregate.
Only Assignment Parameters with a Value that is not an Array will be modified. However, the search for a matching pathname does not make this distinction.
aggregate | The PVL::Aggregate to search. |
pathname | The pathname of the parameter to find. |
value | The string value to assign to the parameter. |
case_sensitive | If true, the pathname search is case sensitive; if false the pathname is not case sensitive. |
skip | The number of parameters that matches the pathname to skip before selecting the parameter to modify. |
References ASSIGNMENT_PARAMETER, Value::is_Array(), Parameter::name(), pathname(), PVL_parameter(), and Parameter::value().
std::string UTC_time | ( | double | seconds, |
unsigned int | epoch = Instrument::SPACECRAFT_EPOCH ) |
Converts time in seconds to UTC representation.
The UTC representation has the form:
YYYY-MM-DDTHH:mm:SS
where all values, except the year, are zero-padded to two digits.
There are two possible implementations of this method: System functions or SPICE functions. The former will be used if INCLUDE_SPICE has not been defined at compile time and will always be used for an epoch that is not the Instrument::SPACECRAFT_EPOCH.
The system functions implementation converts the seconds argument value into the number of seconds since the host system's localtime epoch (1970) which is then converted to the UTC representation.
The SPICE functions implementation is more accurate than the system functions as it adjusts for leap seconds. This requires the use of an external file containing the leap seconds information. In addition, a file providing information about the MRO spacecraft clock must be provided. These files - called SPICE kernels - are referenced in a SPICE metakernel. The pathname to this file is identified by the SPICE_METAKERNEL_VARIABLE environment variable or, if this environment variable is not present, the DEFAULT_SPICE_METAKERNEL. The name of the SPICE_METAKERNEL_VARIABLE environment variable is set at compile time by the SPICE_METAKERNEL_VARIABLE_NAME macro; if this is not provided the default value is "SPICE_METAKERNEL". The value of the DEFAULT_SPICE_METAKERNEL is set at compile time by the DEFAULT_SPICE_METAKERNEL_PATHNAME macro; if this is not provided the default value is "/HiRISE/Data/NAIF/kernel.list". The seconds argument value is first converted to Ephemeris Time (ET). This requires a clock identifier which is specified by MRO_CLOCK_ID that is set at compile time by the MRO_CLOCK_NAIF_ID macro; if this is not provided the default value is -74999. ET is then converted to the UTC representation. N.B.: If any of the required external files are not accessible, or any of the SPICE functions fail, the INVALID_UTC_TIME value is returned. For details on the SPICE time functions see the documetation available from the ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/html/individual_docs/time.html URL.
seconds | The number of seconds since the epoch. N.B.: If the seconds value is negative the INVALID_UTC_TIME value (set at compile time by the DEFAULT_INVALID_UTC_TIME macro; if this is not provided the default value is "0000-00-00T00:00:00.000") is returned. |
epoch | The epoch reference (year 1/1/XXXX at 00:00 base) for the seconds value. |
References clock_count(), Data_Component::DEFAULT_SPICE_METAKERNEL, Data_Component::INVALID_UTC_TIME, MRO_Clock, Data_Component::MRO_CLOCK_ID, seconds(), Instrument::SPACECRAFT_EPOCH, Data_Component::SPICE_METAKERNEL_VARIABLE, and Data_Component::UTC_SECONDS_PRECISION.
Referenced by Observation::PVL_PDS().
std::string clock_count | ( | double | seconds, |
Clock_Selector | clock = HiRISE_Clock ) |
Converts time in seconds to clock count representation.
The clock count representation has the form:
seconds:subseconds
where seconds is a decimal count in seconds since the Instrument::SPACECRAFT_EPOCH, and subseconds is a zero-padded five digit decimal integer measuring fraction of a second ticks. For the HiRISE instrument clock each subsecond tick is Instrument::HIRISE_CLOCK_SUBTICK_MICROS microseconds; for the MRO spacecraft clock a tick is Instrument::MRO_CLOCK_SUBTICK_MICROS microseconds.
seconds | The number of seconds since the Instrument::SPACECRAFT_EPOCH. |
clock | A Clock_Selector: either the HiRISE_Clock or the MRO_Clock. |
References HiRISE_Clock, Instrument::HIRISE_CLOCK_SUBTICK_MICROS, Instrument::MRO_CLOCK_SUBTICK_MICROS, seconds(), and Data_Component::SUBSECONDS_DELIMITER.
Referenced by Observation::PVL_PDS(), seconds(), and UTC_time().
double seconds | ( | const std::string & | clock_count, |
Clock_Selector | clock = HiRISE_Clock ) |
Converts a clock count representation to time in seconds.
The | clock count representation string. |
clock | A Clock_Selector: either the HiRISE_Clock or the MRO_Clock. |
References clock_count(), Instrument::HIRISE_CLOCK_SUBTICK_MICROS, Data_Component::ID, MRO_Clock, Instrument::MRO_CLOCK_SUBTICK_MICROS, and Data_Component::SUBSECONDS_DELIMITER.
Referenced by clock_count(), Science_Channel_Header::clock_count(), Observation::PVL_PDS(), Science_Channel_Header::time(), Science_Channel_Header::time(), and UTC_time().
bool member_of | ( | const unsigned int | value, |
const unsigned int * | array, | ||
int | size ) |
Tests if a value is a member of an array.
Each member of the array is compared for equality with the test value.
value | The integer value to test for. |
array | The integer array to search. |
size | The size of the array. |
Referenced by Engineering_Header::is_valid().
bool member_of | ( | const char *const | value, |
const char *const | array[], | ||
int | size ) |
Test if a value is a member of an array.
Each member of the array is compared for equality with the test value.
value | The C-string value to test for. |
array | The C-string array to search. |
size | The size of the array. |
std::string hostname | ( | ) |
bool file_exists | ( | const std::string & | filename | ) |
Tests if a file exists.
filename | The filename to test. This can be a full pathname. |
References filename().
Referenced by Label_Patcher::apply_patch(), Label_Patcher::configure_database(), and main().
std::string pathname | ( | const std::string & | filename = "" | ) |
Gets a fully qualified pathname for a filename.
If the specified filename is an absolute pathname - i.e. it begins with the PATHNAME_DELIMITER character - the filename is returned.
A relative filename is prepended, separated by the PATHNAME_DELIMITER character, with the current working directory pathname obtained from the host system. Then all occurances of the "PATHNAME_DELIMITER.PATHNAME_DELIMITER" sequence are replaced with a single PATHNAME_DELIMITER character.
filename | A filename or pathname string. |
References CWD(), filename(), and Data_Component::PATHNAME_DELIMITER.
Referenced by accumulate_parameters(), add_override_parameters(), filename(), Label_Patcher::label_parameter(), main(), parameter_name(), PVL_parameter(), PVL_value(), PVL_value(), PVL_value(), PVL_values(), and remove_override_parameters().
std::string pathname | ( | const std::string & | directory, |
const std::string & | filename, | ||
const std::string & | extension ) |
Assembles a pathname from directory, filename, and extension segments.
The directory string, if it is not empty, is prepended to the filename string. A PATHNAME_DELIMITER character is provided between them if the directory does not already end with one. If the extension is not empty it is then appended with a '.' character delimiter.
directory | The pathname string for the directory. |
filename | The filename string. |
extension | The extension string. |
References filename(), and Data_Component::PATHNAME_DELIMITER.
std::string filename | ( | const std::string & | pathname | ) |
Gets the filename portion of a pathname.
The substring following the last occurance of the PATHNAME_DELIMITER character in the pathname string is the filename string. If the delimiter is not present the entire pathname is the filename.
pathname | A pathname string. |
References pathname(), and Data_Component::PATHNAME_DELIMITER.
Referenced by EDR_file(), file_exists(), main(), pathname(), and pathname().
std::string shift | ( | std::string | lines, |
int | amount ) |
Shifts (indents) lines of text by the specified number of spaces.
The beginning of each line of text - where a line is terminated by a new-line ('
') character - is prepended with the specified amount of whitespace (' ' characters). If no new-line is present but the lines string is not empty it is taken to be a single line that is shifted.
lines | An arbitrary string. |
amount | The amount of whitespace to shift the lines. If this is less than or equal to zero no shifting is done. |
Referenced by Observation::gap_map_shift(), and main().
std::string plural | ( | int | count | ) |
Gets a pluralization string.
Used to provide the plural suffix for a string depending on a count related to the string. For example, give a vector, list, a description of the vector might be:
cout << "The list contains " << list.size () << " item" << plural (list.size ()) << '.' << endl;
count | Any integer value. |
Referenced by Label_Patcher::database_field_value(), and main().
std::ostream & operator<< | ( | std::ostream & | stream, |
const Gap_Map & | map ) |
Prints a Gap_Map to a stream.
Pixel_type * pukool_table | ( | const idaeim::PVL::Value & | conversion_table, |
Pixel_type * | maping_table, | ||
double | offset_percentage = LUT::DEFAULT_PUKOOL_OFFSET ) |
Generates a reverse lookup (pukool) table from a LUT PVL_PDS LOOKUP_CONVERSION_TABLE Parameter Value.
A pukool maps output pixel values back to their input CCD sensor values. The index of the pukool table corresponds to a single byte image data value. A two byte table entry value corresponds to the CCD sensor value. Thus, while a LUT maps two byte (UA::HiRISE::Pixel_type) CCD sesnor values to single byte image pixel values, a pukool maps single byte image pixel values to CCD sensor values.
However, due to the loss of precision during LUT mapping, pukool mapping is not able to identify which of of multiple CCD sensor values that mapped to the same pixel value. Since the LUT is expected to be a monotonically increasing set, a many-to-one LUT mapping is over a continuous range. The offset_percentage is used to selected a value from this range based on a percentage of the distance between the ends of the range. An offset_percentage of 0.0 will pick the low end, 1.0 will pick the high end, and 0.5 will pick the middle of the range.
Note: The last pukool entry will always map invalid (gap) pixel values to invalid (-1) CCD sensor values.
conversion_table | The Array Value containing the reverse map ranges, as produced by the LUT::PVL_PDS method. |
maping_table | The data storage arrage for the reultant pukool table. Warning: Space for 256 UA::HiRISE::Pixel_type values must be provided. |
offset_percentage | A value between 0.0 and 1.0, inclusive. |
invalid_argument | If the maping_table is NULL or the offset_percentage is not in the range 0.0 to 1.0. |
References Vectal< T >::begin(), Vectal< T >::end(), LUT::ID, Value::is_Array(), Instrument::MAX_PIXEL_VALUES, Instrument::NOT_APPLICABLE_NUMBER, and Value::type_name().
Referenced by main().
std::ostream & operator<< | ( | std::ostream & | stream, |
const Observation & | observation ) |
Prints an observation to a stream.
stream | The ostream where the Data_Component will be printed. |
observation | The Obseration to be printed. |