Excerpts from gpstrg.c to define quantities of interest to users: RJW, 3/22/99 ** H.G.Berns, K2K/SuperK group @ UW Seattle, USA, 16 Mar. 1999 ** see http://www.phys.washington.edu/~berns/K2K/LINUX ** for further documentation. /* log and data file defines */ #define DATAFILE "/home/online/log/data/gpstrg.data" #define TTETDATA "/home/online/log/data/ttet.data" #define DATA100FILE "/home/online/gpsdata/gpslast100.data" #define DATA100TEMP "/home/online/gpsdata/gpslast100.data.temp" #define DATA100LOCK "/home/online/gpsdata/gpslast100.data.lock" #define LTCHIST "/home/online/log/histograms/ltchist" #define MOTHIST "/home/online/log/histograms/mothist" #define RS232HIST "/home/online/log/histograms/rs232hist" #define FREQFILE "/home/online/log/misc/ltcfreq" #define LTCERROR "/home/online/log/errors/ltcerror" #define FIFOERROR "/home/online/log/errors/fifoerror" #define TIMEERROR "/home/online/log/errors/timeerror" #define MOTSTATUS "/home/online/log/motorola/motorola.status" #define TTSTATUS "/home/online/log/truetime/truetime.status" #define LTCLOGFILE "/home/online/log/performance/ltcperf" #define SUMMARY_FILE "/home/online/log/summary.current" #define FINAL_SUMMARY "/home/online/log/summaries.gpstrg" #define LOGFILE "/home/online/log/gpstrg.log" #define GPSTRGNEWLOG "/home/online/log/gpstrg.newlog" /* flag files for run control and online data transfer */ #define INITFLAG "/home/online/flags/init.flag" #define WAITFLAG "/home/online/flags/wait.flag" #define STOPFLAG "/home/online/flags/stop.flag" #define DEBUGFLAG "/home/online/flags/debug.flag" #define LOGFLAG "/home/online/flags/log.flag" #define SENDDATA "/home/online/flags/gpstrg.data" #define SENDSTATUS "/home/online/flags/gpstrg.status" #define SENDERROR "/home/online/flags/gpstrg.error" #define MOTERRORFLAG "/home/online/flags/motorola.error" #define TTERRORFLAG "/home/online/flags/truetime.error" #define SETDATALOCK "touch /home/online/flags/gpstrg.data.lock &" #define REMOVEDATALOCK "rm -r /home/online/flags/gpstrg.data.lock &" /* ----------------------- structure definitions ---------------------- */ struct gps_1pps_header /* GPS data buffer structure */ { int run_number; /* number of current run (not yet available)*/ u_int av_freq; /* average LTC clock frequency */ u_int event_number; /* event number modulo (16 bits) */ u_int gpstime1; /* TrueTime 1PPS GPS time (DDDhhmmss) */ u_int gpstime2_hi; /* Motorola 1PPS GPS time (YYYYMMDD) */ u_int gpstime2_lo; /* Motorola 1PPS GPS time (hhmmss) */ u_int ltcgps1; /* LTC time for 1PPS of TrueTime GPS */ u_int ltcgps2; /* LTC time for 1PPS of Motorola GPS */ u_int ltctrg; /* LTC clock time at TRG */ u_int cputime; /* nubl01.kek.jp CPU time (UNIX format) */ u_int trgtime_hi; /* VMETRG 48-bit clock time (upper 16 bits) */ u_int trgtime_lo; /* VMETRG 48-bit clock time (lower 32 bits) */ u_int status; /* status and error flags */ u_int unix_sec0; /* TrueTime EventTime Unix time (seconds) */ u_int unix_nsec0; /* TrueTime EventTime Unix time (nanosec) */ u_int unix_sec1; /* TrueTime TRG-1PPS Unix time (seconds) */ u_int unix_nsec1; /* TrueTime TRG-1PPS Unix time (nanosec) */ u_int unix_sec2; /* Motorola TRG-1PPS Unix time (seconds) */ u_int unix_nsec2; /* Motorola TRG-1PPS Unix time (nanosec) */ u_int vmetrg_status; /* VMETRG status word */ u_int vmetrg_mask; /* VMETRG trigger mask */ u_int trigger_id; /* VMETRG trigger ID */ u_int spare[GPSSPARES]; /* spare words for later use */ }; struct Summary /* Data summary structure */ { int av_freq_err[2]; /* errors with average LTC freq. count (!=~50MHz) */ int bad_1us[3]; /* mismatch between the 3 unix event times > 1usec */ int bits_stuck[2]; /* number of 1PPS updates with stuck bit 6...8 */ int cpugps_diff[2]; /* seconds with CPU time and GPS out of sync */ int events; /* successful events processed */ int fifo_evnum_skip; /* internal event number skip in V533 fifo module */ int fifo_status[4]; /* status histogram of the V533 fifo module */ int gpspps_skip[2]; /* number of skipped GPS 1PPS readings detected */ int gpsskip_fix[2]; /* number of corrected GPS 1PPS skips */ int good_200ns[3]; /* match between the 3 unix event times < 200 nsec */ int irigb_error[2]; /* IRIG-B reception error latched at FI-VME module */ int ltcpps_skip[2]; /* number of skipped LTC 1PPS reads detected */ int ltctrg_corrected; /* number of corrected LTCTRG time transitions */ int ltctrg_ok; /* number of acceptable LTCTRG time transitions */ int ltc_status[4][2]; /* debug statistics for LTC 1PPS status distribut. */ int mot_error; /* Motorola status errors */ int mot_time; /* Motorola 1-second data sequences received */ int pps_good[2]; /* 1PPS LTC times with errors <100 nsec from avg. */ int pps_read[2]; /* number of 1PPS triggers read from LTC */ int pps_error[2]; /* 1PPS LTC times with errors >500 nsec from avg. */ int ok_1us[3]; /* mismatch between the 3 unix event times < 1usec */ int outer_loops; /* # of times V533 mods were polled */ int repeat_evts; /* repeated V533 events */ int run_time; /* run time of activated process (RUN && !PAUSE) */ int rs232_skip[2][2]; /* RS232 signal reception statistics */ int start_time; /* starting time (unix seconds) of this process */ int start_time2; /* starting time (unix sec.) of current RUN */ int trg_trans; /* transition problems in latching ltctrg */ int tt_error; /* TrueTime status errors (in IRIG-B code) */ int tt_time; /* TrueTime IRIG-B time codes received */ int ttet_events; /* TrueTime EventTime events processed */ int v533_busy; /* V533 fifo busy (full) flag set */ int v533_events; /* V533 fifo events processed (with RUN & !PAUSE) */ int v533_events_all; /* all V533 fifo events processed so far */ int vmetrg_events; /* VMETRG events processed */ }; struct motdata /* structure of Motorola binary RS232 time stamp (@@Ea) */ { char month; /* byte 0 */ char day; /* byte 1 */ char year[2]; /* bytes 2+3 */ char hour; /* byte 4 */ char mins; /* byte 5 */ char secs; /* byte 6 */ char nanosec[4]; /* bytes 7-10 */ char latitude[4]; /* bytes 11-14 */ char longitude[4]; /* bytes 15-18 */ char alt_gps[4]; /* bytes 19-22 */ char alt_msl[4]; /* bytes 23-26 */ char n_a_0[4]; /* bytes 27-30 */ char dopval[2]; /* bytes 31+32 */ char pdop; /* byte 33 */ char visible; /* byte 34 */ char tracked; /* byte 35 */ char motchan[8][4]; /* bytes 36-67 */ char rstatus; /* byte 68 */ char parity; /* byte 69 */ char cr_lf[2]; /* bytes 70-71 */ }; struct mottime /* buffer for conversion of binary Motorola data */ { unsigned int date; unsigned int time; int nsec; int lat; int lng; int alt; short sats; short visible; short stat; unsigned int unix_time; int n_data; }; struct ttetdata /* buffer structure for TrueTime data */ { int year; int yday; int hour; int min; int sec; int nsec; int aux; int status; int ysec; unsigned int unix_time; int n_data; };