Observation
|
#include "Data_Component.hh"
#include "Observation.hh"
#include "Channel_ID.hh"
#include "Exceptions.hh"
#include "PVL.hh"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <exception>
#include <stdexcept>
#include <sys/stat.h>
Macros | |
#define | IMAGE_DATA_TEST_PATTERN_SIZE 1052 |
Functions | |
int | usage (char *program) |
HiRISE_Observation_Check command line usage. More... | |
void | list_data (const Observation &observation, unsigned int data_selections, bool verbose) |
int | main (int count, char **arguments) |
Variables | |
const char * | ID = "HiRISE_Observation_Check (1.14 2020/02/14 01:17:17)" |
Application identification name with source code version and date. More... | |
const unsigned int | NO_DATA = 0 |
Data list selectors. More... | |
const unsigned int | MROSP = (1 << 0) |
const unsigned int | SCIENCE = (1 << 1) |
const unsigned int | LOOKUP_TABLE = (1 << 2) |
const unsigned int | ENGINEERING = (1 << 3) |
const unsigned int | PDS_LABEL = (1 << 4) |
const unsigned int | ALL_DATA = (unsigned int)-1 |
const int | SUCCESS = 0 |
Exit status values. More... | |
const int | BAD_SYNTAX = 1 |
const int | INVALID_ARGUMENT = 11 |
const int | LENGTH_ERROR = 12 |
const int | OUT_OF_RANGE = 14 |
const int | INVALID_SCIENCE_CHANNEL_HEADER = 15 |
const int | INVALID_LINE = 16 |
const int | UNEXPECTED_PIXEL_VALUE = 17 |
const int | LOGIC_ERROR = 19 |
const int | NO_OBSERVATION_FILE = 20 |
const int | IO_FAILURE = 29 |
const int | UNKNOWN_ERROR = -1 |
#define IMAGE_DATA_TEST_PATTERN_SIZE 1052 |
int usage | ( | char * | program | ) |
HiRISE_Observation_Check command line usage.
Use:
HiRISE_Observation_Check [options] <<i>filename</i>>
Description:
The HiRISE_Observation application can be used to examine the contents of a HiRISE instrument observation data set file. Without any command line options it will produce either a PASS or FAIL result consistent with a zero or non-zero exit status, respectively.
It can also produce detailed data listings of selected data components. Either single channel and multi-channel observation data sets, with or without an initial MROSP header component, are acceptable.
Options:
-Report All | MROSP | Science | Lut | Engineering | PDS[:<parameter>[...]] [,...]
Detailed reports of selected data components are written to stdout. Multiple, comma separated (no spaces) data components may be selected. Multiple, colon separated (no spaces) parameters may be selected. If the PDS label component of an EDR product file is specified but no parameter is selected the entire PDS label is listed. EDR source input and/or EDR product output parameters are listed. Component selections are cumulative for each use of this option.
-Line <first>[-<last>]
Detailed listings of selected image line data are written to stdout.
-Check_image_line_data
Check image line data for consistency. The first 1052 pixels - regardless of the number of pixels per line - of each channel's image line data is expected to contain a valid test pattern that is repeated for each subsequent sequence of 1052 pixels. The check compares the first 1052 pixel values against each subsequent sequence.
-Verbose
Verbose operation provides some additional annotations and very detailed (and long) data listings.
-Help
This usage description.
Exit status:
SUCCESS = 0,
Command line syntax. BAD_SYNTAX = 1,
Software / data problem. INVALID_ARGUMENT = 11, LENGTH_ERROR = 12, OUT_OF_RANGE = 14, INVALID_SCIENCE_CHANNEL_HEADER = 15, INVALID_LINE = 16, UNEXPECTED_PIXEL_VALUE = 17, LOGIC_ERROR = 19,
IO. NO_OBSERVATION_FILE = 20, IO_FAILURE = 29,
Unknown? UNKNOWN_ERROR = -1;
Author:
Bradford Castalia, UA/PIRL
1.14 2020/02/14 01:17:17
References BAD_SYNTAX.
Referenced by main().
void list_data | ( | const Observation & | observation, |
unsigned int | data_selections, | ||
bool | verbose | ||
) |
References ENGINEERING, Observation::Engineering, MROSP_Header::is_valid(), LOOKUP_TABLE, Observation::Lookup_Table, MROSP, Observation::MROSP, NO_DATA, Engineering_Header::print(), LUT::print(), MROSP_Header::print(), Science_Channel_Header::print(), SCIENCE, and Observation::Science.
Referenced by main().
int main | ( | int | count, |
char ** | arguments | ||
) |
References Image_Line::bad_line_description(), Observation::bytes_read(), Science_Channel_Header::Channel, Science_Channel_Header::Checksum, Observation::components(), Science_Channel_Header::CPMM, ENGINEERING, Data_Component::get(), Data_Component::HEX, ID, IMAGE_DATA_TEST_PATTERN_SIZE, Data_Component::internet_checksum(), INVALID_ARGUMENT, INVALID_LINE, INVALID_SCIENCE_CHANNEL_HEADER, IO_FAILURE, LENGTH_ERROR, Observation::line(), Observation::Line, list_data(), LOGIC_ERROR, LOOKUP_TABLE, Observation::mirror_channel_1(), MROSP, NO_DATA, NO_OBSERVATION_FILE, OUT_OF_RANGE, Data_Component::PATHNAME_DELIMITER, Image_Line::pixel(), Image_Line::pixel_count(), UA::HiRISE::plural(), Image_Line::print(), UA::HiRISE::print_value(), Data_Component::put(), SCIENCE, Observation::Science, SUCCESS, Science_Channel_Header::Sync, Science_Channel_Header::SYNC, Image_Line::total_lines(), UNEXPECTED_PIXEL_VALUE, UNKNOWN_ERROR, usage(), and Data_Block::value_size_of().
const char* ID = "HiRISE_Observation_Check (1.14 2020/02/14 01:17:17)" |
Application identification name with source code version and date.
Referenced by main().
const unsigned int NO_DATA = 0 |
Data list selectors.
Referenced by list_data(), and main().
const unsigned int MROSP = (1 << 0) |
Referenced by list_data(), and main().
const unsigned int SCIENCE = (1 << 1) |
Referenced by list_data(), and main().
const unsigned int LOOKUP_TABLE = (1 << 2) |
Referenced by list_data(), and main().
const unsigned int ENGINEERING = (1 << 3) |
Referenced by list_data(), and main().
const unsigned int PDS_LABEL = (1 << 4) |
const unsigned int ALL_DATA = (unsigned int)-1 |
const int SUCCESS = 0 |
Exit status values.
Referenced by main().
const int BAD_SYNTAX = 1 |
Referenced by usage().
const int INVALID_ARGUMENT = 11 |
Referenced by main().
const int LENGTH_ERROR = 12 |
Referenced by main().
const int OUT_OF_RANGE = 14 |
Referenced by main().
const int INVALID_SCIENCE_CHANNEL_HEADER = 15 |
Referenced by main().
const int INVALID_LINE = 16 |
Referenced by main().
const int UNEXPECTED_PIXEL_VALUE = 17 |
Referenced by main().
const int LOGIC_ERROR = 19 |
Referenced by main().
const int NO_OBSERVATION_FILE = 20 |
Referenced by main().
const int IO_FAILURE = 29 |
Referenced by main().
const int UNKNOWN_ERROR = -1 |
Referenced by main().