decode_dayfile
[Level Zero]

Decodes housekeeping packet data from dayfiles and writes decoded keywords and values to DRMS series. More...

Collaboration diagram for decode_dayfile:

Data Structures

struct  jsvn_map_data

Enumerations

enum  project { pjnHMI, pjnAIA, pjnSDO }

Functions

int check_for_sdo_apid (int apid)
int check_hk_record_exists (char *ds_name, HK_Keyword_t *kw, int apid)
int check_hk_record_within_time_range (HK_Keyword_t *kw)
int DoIt (void)
char * find_file_version_number (GTCIDS_Version_Number *top, char f_version_number[MAX_CHAR_VERSION_NUMBER], int apid)
char * find_fvn_from_shcids (SHCIDS_Version_Number *top, char pkt_date[MAX_SIZE_PKT_DATE], int apid)
char * get_data_packet_name (int apid)
char * get_lookup_filename (int apid)
double get_packet_time (unsigned short *word_ptr)
int nice_intro (void)
void sprint_time (char *at, TIME t, char *zone, int precision)
 Converts an internal representation of time into a string representation of time.

Variables

ModuleArgs_tggModArgs
SHCIDS_Version_Number * global_shcids_vn
int INVALtime
struct jsvn_map_data * jmap [1]
struct jsvn_map_data jsvn_list [1]
ModuleArgs_t module_args []
 Global DRMS-module structure representing the default command-line arguments for a DRMS module.
char * module_name
 Global DRMS-module string providing the name of the module.

Detailed Description

Decodes housekeeping packet data from dayfiles and writes decoded keywords and values to DRMS series.

Synopsis:
   decode_dayfile -h
   decode_dayfile [-p] src=<moc|hsb|rtmon|egsefm> in=<day filename> [ out=<data series name> ] 
Decode dayfile decodes hk packet by sending packet to functions in decode_hk.c file. Keywords are decoded using the the same functions that decodes hk keywords on high speed bus. This decode_dayfiles loops through all hk packets and sends data to be decoded to decode_hk.c's functions which returns a structure containing keyword names, keyword values, keyword and keyword variable types. Decode dayfile code then writes keywords names and values to a DRMS data series. DRMS data series is based on apid(i.e.,0445,0529), project name(i.e.,hmi,aia, sdo,etc.), data type name(i.e., lev0), and jsoc version number(0001, 0002, etc.). Decode dayfile will not load records that already exist in data series. Decode dayfile checks the packet time per packet is within a time range of less than current date and time plus 12 hours. Decode dayfile will not load data for packets that do not have HK configuration files.

The src parameter is a mandatory argument which should be either moc, hsb, rtmon, or egsefm. This value is required to be set to correspond to the -in- parameter file's format. If set src=moc the code expects file formats <apid>_<year>_<day of year>_<version>.hkt (i.e., 0129_2008_191_01.hkt). If set src=rtmon, the code expects file format <year>_<month>_<day of month>.0x<hex apid="" value>=""> (i.e., 2008_02_01.0x081). If set src=hsb, the code expects file format hsb_<decimal apid value>_<year>_<month>_<day in month>_<version>.hkt (i.e., hsb_0445_2008_02_30_01.hkt). If set src=egsefm, the code expects file format <year>_<month>_<day in month>.0x<hex apid="" value>=""> (i.e., 2008_02_30.0x081). Any other src setting will throw an error. The src value needs to match the -in- file format. LMSAL (src=rtmon and src=egsefm), Nasa(src=moc) and Stanford(src=hsb) each produce different file formats for day files. The src is also used to set source value in the HK_SOURCE keyword in Level 0 by apid data series.

The in parameter is a mandatory argument which should contain the directory and filename of the input dayfile. Currently only one dayfile is allowed for the in parameter.

The out parameter is optional. When run without out parameter, this code creates the data series name to put keyword names and values in. When run with the out parameter, this code will write keywords and values to the data series name defined by the out parameter value. For either case there needs to be a data series already created. This code does not create a data series but determines and then creates if necessary the data series name to write data to.

When use the -p flag, a report on each packet is send to standard output. By using -p flag, the report output can be redirected to a file (i.e., > Report_ISP_DAYFILE_OCTOBER_29_2008).

Flags:
-h: Shows usage message. -p: Prints report on each packets keyword name and value to standout out
Parameters:
src The source of dayfiles(required field).
in The full directoy path and file name to the input dayfile(required field).
out The data series name to write keyword names and values to(optional). Normally do not run with this option. If not present, the code will automatically create data series name using the apid and packet version number(for hmi and aia packets) in packets or packet time for sdo packets in day files. Also required to set environment variables for project names and data identifer name: HK_DDF_HKBYAPID_PROJECT_NAME_xxx & HK_DDF_HKBYAPID_DATA_ID_NAME. These variables are in the the SOURCE_ENV_FOR_HK_DAYFILE_DECODE file which is read in based on the setting of define ENVFILE . The data series needs to be already created for this to program to load keywords in data series. This code only creates the name of the data series to write to, it does not create data series.
Example of running without out parameter using as in parameter an ISP dayfile from MOC Product Server:
   decode_dayfile src=moc in=/tmp21/production/lev0/hk_moc_dayfile/0029_2008_275_01.hkt 
Example of running with -p flag, without out parameter using as in parameter an ISP dayfile from MOC Product Server:
   decode_dayfile -p src=moc in=/tmp21/production/lev0/hk_moc_dayfile/0029_2008_275_01.hkt  > Report_ISP_0029_2008_275_01.hkt 
Example of running with out parameter using as in parameter an ISP dayfile from MOC Product Server:
   decode_dayfile src=moc in=/tmp21/production/lev0/hk_moc_dayfile/0029_2008_275_01.hkt out=hmi.lev0_0029_0008
Example of running with out parameter using as in parameter an ISP dayfile file from MOC Product Server and sending error logsto file:
   decode_dayfile src=moc in=/tmp21/production/lev0/hk_moc_dayfile/0029_2008_275_01.hkt out=hmi.lev0_0029_0008 > ERROR_LOG
Example of running with -p print flag with out parameter using as in parameter an ISP dayfile from MOC Product Server:
   decode_dayfile -p src=moc  in=/tmp21/production/lev0/hk_moc_dayfile/0029_2008_275_01.hkt out=hmi.lev0_0029_0008 >  Report_ISP_0029_2008_275_01.hkt
Example of running help:
   decode_dayfile -h

Generated on Mon Mar 26 07:00:54 2018 for JSOC_Documentation by  doxygen 1.5.7.1