HiRISE
 Observation

Defines | Functions | Variables

HiRISE_Data_Vet.cc File Reference

#include "Instrument.hh"
#include "Observation.hh"
#include "Data_Component.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 <cctype>
#include <exception>
#include <stdexcept>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <pwd.h>
Include dependency graph for HiRISE_Data_Vet.cc:

Defines

#define DEFAULT_CONFIGURATION_FILENAME   "Database.conf"
#define DEFAULT_DATABASE_HOST   ""
#define LISTING_WIDTH   80
#define LABEL_FIELD_WIDTH   (LISTING_WIDTH / 3)
#define EDR_FILENAME_EXTENSION   "IMG"
#define VETTED_FILENAME_SUFFIX   "-vetted"
#define _VERSION_   " "
#define PATHNAME_DELIMITER   '/'

Functions

int usage (char *program, bool list_descriptions=false)
bool database_configuration (char *configuration_filename)
bool connect_to_database ()
string Field_value (const string &field)
bool EDR_file (string filename)
void add_override_parameters (Aggregate &overrides, Aggregate &parameters)
void remove_override_parameters (Aggregate &overrides, Aggregate &parameters)
void set_effective_values (Aggregate &overrides, Channel &channel)
void apply_override_parameters (Aggregate &overrides, Aggregate &parameters)
char * username ()
char * home_directory ()
char * skip_whitespace (char *characters)
int main (int count, char **arguments)

Variables

const char * EDR_Filename_Extension = EDR_FILENAME_EXTENSION
 Filename extension for output EDR files.
const char * Vetted_Filename_Suffix = VETTED_FILENAME_SUFFIX
 Suffix appended to input filename to create output vetted filename.
const int SUCCESS = 0
 Exit status values.
const int BAD_SYNTAX = 1
const int CONFIGURATION_FAILURE = 2
const int DATABASE_ERROR = 3
const int INVALID_ARGUMENT = 11
const int LENGTH_ERROR = 12
const int UNDERFLOW_ERROR = 13
const int OUT_OF_RANGE = 14
const int LOGIC_ERROR = 19
const int NO_OBSERVATION_FILE = 20
const int NO_EDR_FILE = 21
const int NO_CHANNEL_FILE = 22
const int NO_PVL_FILE = 23
const int IO_FAILURE = 29
const int PVL_ERROR = 30
const int UNKNOWN_ERROR = -1
const char * ID = "(1.24 2010/12/10 00:46:48)"
 Application identification name with source code version and date.
const char * DATABASE_TYPE = "MySQL"
 Database access configuration parameters.
const char * TYPE_PARAMETER_NAME = "Type"
const char * SERVER_PARAMETER_NAME = "Server"
const char * HOST_PARAMETER_NAME = "Host"
const char * USER_PARAMETER_NAME = "User"
const char * PASSWORD_PARAMETER_NAME = "Password"
const char * CATALOG_PARAMETER_NAME = "Catalog"
const char * DEFAULT_CATALOG = "HiRISE_Test"
const char * PLANNED_OBSERVATIONS_TABLE = "Planned_Observations"
 Database field names.
const char * OBSERVATION_ID_FIELD = "OBSERVATION_ID"
const char * CCD_FIELD_BASENAME = "CPMM_"
const char * CCD_ENABLED_VALUE = "ON"
const char pathname_delimiter = PATHNAME_DELIMITER
 Host filesystem pathname delimiter.
const char * SOFTWARE_NAME = "SOFTWARE_NAME"
 Names of EDR PDS parameters that will have their values updated.
const char * SOURCE_FILE_NAME = "SOURCE_FILE_NAME"
const char * GAP_TABLE_LOCATION = "^GAP_TABLE"
const char * GAP_TABLE_ROWS = "GAP_TABLE/ROWS"
const char * OBSERVATION_ID = "OBSERVATION_ID"
 Names of key "effective" parameters.
const char * TIME_PARAMETERS = "TIME_PARAMETERS/"
const char * ANALOG_POWER_START_COUNT = "ANALOG_POWER_START_COUNT"
const char * OBSERVATION_START_COUNT = "OBSERVATION_START_COUNT"
const char * INSTRUMENT_SETTING_PARAMETERS = "INSTRUMENT_SETTING_PARAMETERS/"
const char * SCAN_EXPOSURE_DURATION = "SCAN_EXPOSURE_DURATION"
const char * CPMM_NUMBER = "CPMM_NUMBER"
const char * CHANNEL_NUMBER = "CHANNEL_NUMBER"
const char * DELTA_LINE_TIMER_COUNT = "DELTA_LINE_TIMER_COUNT"
const char * BINNING = "BINNING"
const char * TDI = "TDI"
const char * TRIM_LINES = "TRIM_LINES"
const char * CALIBRATION_IMAGE_LINES = "CALIBRATION_IMAGE/LINES"
const char * IMAGE = "IMAGE/"
const char * LINES = "LINES"
const char * LINE_SAMPLES = "LINE_SAMPLES"
const char * SAMPLE_BITS = "SAMPLE_BITS"
const char * PRODUCT_ID = "PRODUCT_ID"
 Names of other paramters to be accessed.
const char * PRODUCT_CREATION_TIME = "PRODUCT_CREATION_TIME"
const char * LABEL_RECORDS = "LABEL_RECORDS"
const string::size_type EOS = std::string::npos
 End-of-string index.
Aggregate Config_Parameters ("Configuration")
 Configuration parameters.
string Database_Server
string Database_Host
string Database_User
string Database_Password
string Database_Catalog
const int LABEL_WIDTH = 20
 Listing format widths.
const int VALUE_WIDTH = 9
Lister PDS_label_lister
 PDS formatting of PVL.
int Verbosity = 0
 Global flags.

Define Documentation

#define DEFAULT_CONFIGURATION_FILENAME   "Database.conf"
#define DEFAULT_DATABASE_HOST   ""
#define LISTING_WIDTH   80
#define LABEL_FIELD_WIDTH   (LISTING_WIDTH / 3)

Referenced by EDR_file().

#define EDR_FILENAME_EXTENSION   "IMG"
#define VETTED_FILENAME_SUFFIX   "-vetted"

Referenced by usage().

#define _VERSION_   " "
#define PATHNAME_DELIMITER   '/'

Function Documentation

int usage ( char *  program,
bool  list_descriptions = false 
)
bool database_configuration ( char *  configuration_filename )
bool connect_to_database (  )
string Field_value ( const string &  field )
bool EDR_file ( string  filename )
void add_override_parameters ( Aggregate overrides,
Aggregate parameters 
)
void remove_override_parameters ( Aggregate overrides,
Aggregate parameters 
)
void set_effective_values ( Aggregate overrides,
Channel &  channel 
)
void apply_override_parameters ( Aggregate overrides,
Aggregate parameters 
)
char* username (  )
char * home_directory (  )
char * skip_whitespace ( char *  characters )

Referenced by main().

int main ( int  count,
char **  arguments 
)

Variable Documentation

const char* EDR_Filename_Extension = EDR_FILENAME_EXTENSION

Filename extension for output EDR files.

const char* Vetted_Filename_Suffix = VETTED_FILENAME_SUFFIX

Suffix appended to input filename to create output vetted filename.

Referenced by main().

const int SUCCESS = 0

Exit status values.

const int BAD_SYNTAX = 1
const int CONFIGURATION_FAILURE = 2
const int DATABASE_ERROR = 3

Referenced by main().

const int INVALID_ARGUMENT = 11
const int LENGTH_ERROR = 12
const int UNDERFLOW_ERROR = 13
const int OUT_OF_RANGE = 14
const int LOGIC_ERROR = 19
const int NO_OBSERVATION_FILE = 20
const int NO_EDR_FILE = 21
const int NO_CHANNEL_FILE = 22
const int NO_PVL_FILE = 23
const int IO_FAILURE = 29
const int PVL_ERROR = 30
const int UNKNOWN_ERROR = -1
const char* ID = "(1.24 2010/12/10 00:46:48)"

Application identification name with source code version and date.

const char* DATABASE_TYPE = "MySQL"

Database access configuration parameters.

Referenced by Label_Patcher::configure_database().

const char * TYPE_PARAMETER_NAME = "Type"
const char * SERVER_PARAMETER_NAME = "Server"
const char * HOST_PARAMETER_NAME = "Host"
const char * USER_PARAMETER_NAME = "User"
const char * PASSWORD_PARAMETER_NAME = "Password"
const char * CATALOG_PARAMETER_NAME = "Catalog"
const char * DEFAULT_CATALOG = "HiRISE_Test"
const char* PLANNED_OBSERVATIONS_TABLE = "Planned_Observations"

Database field names.

const char * OBSERVATION_ID_FIELD = "OBSERVATION_ID"

Referenced by main().

const char * CCD_FIELD_BASENAME = "CPMM_"
const char * CCD_ENABLED_VALUE = "ON"
const char pathname_delimiter = PATHNAME_DELIMITER

Host filesystem pathname delimiter.

const char* SOFTWARE_NAME = "SOFTWARE_NAME"

Names of EDR PDS parameters that will have their values updated.

Referenced by apply_override_parameters(), and main().

const char * SOURCE_FILE_NAME = "SOURCE_FILE_NAME"
const char * GAP_TABLE_LOCATION = "^GAP_TABLE"
const char * GAP_TABLE_ROWS = "GAP_TABLE/ROWS"

Referenced by main().

const char* OBSERVATION_ID = "OBSERVATION_ID"

Names of key "effective" parameters.

Referenced by EDR_file(), and set_effective_values().

const char * TIME_PARAMETERS = "TIME_PARAMETERS/"

Referenced by set_effective_values().

const char * ANALOG_POWER_START_COUNT = "ANALOG_POWER_START_COUNT"

Referenced by set_effective_values().

const char * OBSERVATION_START_COUNT = "OBSERVATION_START_COUNT"

Referenced by set_effective_values().

const char * INSTRUMENT_SETTING_PARAMETERS = "INSTRUMENT_SETTING_PARAMETERS/"

Referenced by set_effective_values().

const char * SCAN_EXPOSURE_DURATION = "SCAN_EXPOSURE_DURATION"

Referenced by set_effective_values().

const char * CPMM_NUMBER = "CPMM_NUMBER"

Referenced by set_effective_values().

const char * CHANNEL_NUMBER = "CHANNEL_NUMBER"

Referenced by set_effective_values().

const char * DELTA_LINE_TIMER_COUNT = "DELTA_LINE_TIMER_COUNT"

Referenced by set_effective_values().

const char * BINNING = "BINNING"

Referenced by set_effective_values().

const char * TDI = "TDI"

Referenced by set_effective_values().

const char * TRIM_LINES = "TRIM_LINES"

Referenced by set_effective_values().

const char * CALIBRATION_IMAGE_LINES = "CALIBRATION_IMAGE/LINES"

Referenced by set_effective_values().

const char * IMAGE = "IMAGE/"

Referenced by set_effective_values().

const char * LINES = "LINES"

Referenced by set_effective_values().

const char * LINE_SAMPLES = "LINE_SAMPLES"

Referenced by set_effective_values().

const char * SAMPLE_BITS = "SAMPLE_BITS"

Referenced by set_effective_values().

const char* PRODUCT_ID = "PRODUCT_ID"

Names of other paramters to be accessed.

Referenced by apply_override_parameters(), EDR_file(), and main().

const char * PRODUCT_CREATION_TIME = "PRODUCT_CREATION_TIME"
const char * LABEL_RECORDS = "LABEL_RECORDS"

Referenced by EDR_file(), and main().

const string::size_type EOS = std::string::npos

End-of-string index.

Referenced by main(), and set_effective_values().

Aggregate Config_Parameters("Configuration")

Configuration parameters.

Referenced by main().

string Database_Host
string Database_User

Referenced by main().

const int LABEL_WIDTH = 20

Listing format widths.

const int VALUE_WIDTH = 9

PDS formatting of PVL.

Referenced by apply_override_parameters(), and main().

int Verbosity = 0