[305] | 1 | /***************************************************************************
|
---|
| 2 | rtigs_records.h - description
|
---|
| 3 | -------------------
|
---|
| 4 | begin : Wed Aug 27 2003
|
---|
| 5 | copyright : (C) 2003 by Ken MacLeod
|
---|
| 6 | email : ken.macleod@nrcan.gc.ca.
|
---|
| 7 | ***************************************************************************/
|
---|
| 8 |
|
---|
| 9 | /***************************************************************************
|
---|
| 10 | *
|
---|
| 11 | * This program is free software; you can redistribute it and/or modify
|
---|
| 12 | * it under the terms of the GNU General Public License as published by
|
---|
| 13 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | * (at your option) any later version.
|
---|
| 15 | *
|
---|
| 16 | ***************************************************************************/
|
---|
| 17 | #ifndef _RTIGS_T
|
---|
| 18 | #define _RTIGS_T
|
---|
| 19 |
|
---|
| 20 | /*****************************************************************************
|
---|
| 21 | * RT-IGS record structures
|
---|
| 22 | *
|
---|
| 23 | * General:
|
---|
| 24 | *
|
---|
| 25 | * Every record will have a defined number. We propose the following:
|
---|
| 26 | * 1) Station record number 100;
|
---|
| 27 | * 2) Observation record number 200;
|
---|
| 28 | * 3) Ephemeris record number 300;
|
---|
| 29 | * 4) Meteorological record number 400;
|
---|
| 30 | *
|
---|
| 31 | * Every station will have a unique number. We propose the following:
|
---|
| 32 | *
|
---|
| 33 | * 1-99 reserved for JPL
|
---|
| 34 | * 100-199 reserved for NRCan
|
---|
| 35 | * 200-299 reserved for NGS
|
---|
| 36 | * 300-399 reserved for ESOC
|
---|
| 37 | * 400-499 reserved for GFZ
|
---|
| 38 | * 500-599 reserved for BKG
|
---|
| 39 | * 600-699 reserved for GEOSCIENCE AUS.
|
---|
| 40 | * 700-799 others
|
---|
| 41 | * etc
|
---|
| 42 | * The number of bytes in each real time message will include the header as
|
---|
| 43 | * well as the data content, but NOT the pointer. For example :
|
---|
| 44 | *
|
---|
| 45 | * 1) A station message is output once per hour and is 20 bytes
|
---|
| 46 | *
|
---|
| 47 | * 2) An observation message is output once per second. The header is
|
---|
| 48 | * 12 bytes long and the SOC data is 21 bytes per PRN. So a typical
|
---|
| 49 | * RTIGSO_T message will be 390 bytes if 8 sats are being tracked
|
---|
| 50 | *
|
---|
| 51 | * 3) An ephemeris message is output when the ephemeris is decoded by the
|
---|
| 52 | * GPS receiver. The time in the Ephemeris header is the collected time.
|
---|
| 53 | * One ephemeris can be bundled in a RTIGSE_T.
|
---|
| 54 | * A RTIGSE_T message contains one eph. the message consists of 12 header
|
---|
| 55 | * bytes and 72 ephemeris bytes, for a total of 84 bytes.
|
---|
| 56 | *
|
---|
| 57 | * 4) The RTIGSM_T (met) message should be issues once every 15 minutes.
|
---|
| 58 | * A basic met message consists of a 12 byte header and 3 longs (temp,
|
---|
| 59 | * press and relative humidity) for a total of 24 bytes.
|
---|
| 60 | *
|
---|
| 61 | * All records will be related to a station configuration indicated by the
|
---|
| 62 | * Issue of Data Station(IODS). The IODS will enable the user to identify
|
---|
| 63 | * the equipment and software that was used to derive the observation data.
|
---|
| 64 | *
|
---|
| 65 | * Each record header will contain the GPS Time in seconds which is
|
---|
| 66 | * continuous from ((6 Jan-1980)).
|
---|
| 67 | *
|
---|
| 68 | * The data payload of each record will consist of observations. The
|
---|
| 69 | * structures shown below indicate a pointer to data but in fact the broadcast
|
---|
| 70 | * messages will not contain the pointed only the data. Users will have to
|
---|
| 71 | * manage the data and the pointer is shown to illustrate where the data is
|
---|
| 72 | * located in the message and one possible data management option.
|
---|
| 73 | *
|
---|
| 74 | *
|
---|
| 75 | * All record data in network byte order (Big Endian), ie IA32 users will
|
---|
| 76 | * have to swap bytes ;-)
|
---|
| 77 | ******************************************************************************
|
---|
| 78 | * Developed by Ken MacLeod Aug. 27/2003
|
---|
| 79 | * Updated and revised Feb. 10/2004 with comments from R. Muellershoen
|
---|
| 80 | *****************************************************************************/
|
---|
| 81 |
|
---|
| 82 | #define MAXSTA 256
|
---|
| 83 | #define MAXSOC 264 /* 12 + (12 * 21) = 264*/
|
---|
| 84 | #define MAXEPH 876 /* 12 + (12 * 72) = 876*/
|
---|
| 85 | #define MAXMETS 6
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | /*****************************************************************************
|
---|
| 89 | * Structure name : RTIGSS_T
|
---|
| 90 | *
|
---|
| 91 | * Purpose:
|
---|
| 92 | *
|
---|
| 93 | * Encapsulate the station information that is required for real-time users
|
---|
| 94 | *
|
---|
| 95 | * Users should use this record is to link data to a specific station
|
---|
| 96 | * configuration.
|
---|
| 97 | * The station message should be transmitted by station operator every
|
---|
| 98 | * hour and upon update.
|
---|
| 99 | * If the stations record Issue of Data Station(IODS) and the IODS in the
|
---|
| 100 | * observation record do not match then the data should be used without
|
---|
| 101 | * further investigation
|
---|
| 102 | *
|
---|
| 103 | *
|
---|
| 104 | *
|
---|
| 105 | * This record is not intended to replace the IGS Station log but it is
|
---|
| 106 | * seen as a subset of the IGS log and contains information that enables
|
---|
| 107 | * real-time users to monitor station changes.
|
---|
| 108 | *
|
---|
| 109 | *
|
---|
| 110 | *Version: 1.0
|
---|
| 111 | *
|
---|
| 112 | *By Ken MacLeod Aug. 27/2003
|
---|
| 113 | *Changes: Revised Feb. 10/2004 updated the message description info.
|
---|
| 114 | ****************************************************************************/
|
---|
| 115 |
|
---|
| 116 | typedef struct rtigs_station
|
---|
| 117 | {
|
---|
| 118 | unsigned short rec_id; /*100 indicates station record this message */
|
---|
| 119 | /* to be issued once per hour*/
|
---|
| 120 | unsigned short sta_id; /*unique number assigned to each station. */
|
---|
| 121 | /* Uniquely linked to an IGS Station log by */
|
---|
| 122 | /* the station record*/
|
---|
| 123 | unsigned long GPSTime; /* time of issue, GPS time is seconds from */
|
---|
| 124 | /* the beginning of GPS (6 Jan-1980)*/
|
---|
| 125 | unsigned short num_bytes; /* total number of bytes in the message, */
|
---|
| 126 | /* including the header*/
|
---|
| 127 | unsigned char IODS; /* a flag indicating the current station */
|
---|
| 128 | /* configuration this will change every time */
|
---|
| 129 | /* the station hardware changes*/
|
---|
| 130 | unsigned char sta_rec_type; /* could be various station data formats: */
|
---|
| 131 | /* 0 indicates that there is no additional */
|
---|
| 132 | /* station data*/
|
---|
| 133 | char IGS_UniqueID[8]; /* IGS ID eg NRC1 will use IGS 4 character */
|
---|
| 134 | /* standard but c requires a \0 to terminate */
|
---|
| 135 | /* the string */
|
---|
| 136 | unsigned char *data; /* default station headers Does Not */
|
---|
| 137 | /* contain data. The current message does */
|
---|
| 138 | /* not contain additional station */
|
---|
| 139 | /* information the pointer is shown only */
|
---|
| 140 | /* to illustrate options*/
|
---|
| 141 | }RTIGSS_T;
|
---|
| 142 |
|
---|
| 143 | /******************************************************************************
|
---|
| 144 | * Structure name : RTIGSO_T
|
---|
| 145 | *
|
---|
| 146 | * Purpose : GPS Observations
|
---|
| 147 | * Currently the JPL Soc format is used to compress the
|
---|
| 148 | * observation data.
|
---|
| 149 | * See JPL's website for a description of the SOC
|
---|
| 150 | * compression routine
|
---|
| 151 | *Version: 1.0
|
---|
| 152 | *
|
---|
| 153 | *By Ken MacLeod Aug. 27/2003
|
---|
| 154 | *Changes: Revised Feb. 10/2004 Remove station clock and obs time
|
---|
| 155 | * in milliseconds and add to the message description
|
---|
| 156 | *****************************************************************************/
|
---|
| 157 | typedef struct rtigs_obs
|
---|
| 158 | {
|
---|
| 159 | unsigned short rec_id; /* 200 indicates rt-igs gps observation*/
|
---|
| 160 | unsigned short sta_id; /* Unique num. assigned to each station */
|
---|
| 161 | /* Uniquely linked to an IGS Station log y */
|
---|
| 162 | /* the station record*/
|
---|
| 163 | unsigned long GPSTime; /* observation time of issue, GPS time is */
|
---|
| 164 | /* seconds from the beginning of GPS */
|
---|
| 165 | /* (6 Jan-1980)*/
|
---|
| 166 | unsigned short num_bytes; /* total number of bytes in the message, */
|
---|
| 167 | /* including the header, but not the data */
|
---|
| 168 | /* pointer*/
|
---|
| 169 | unsigned char IODS; /* a flag indicating the current station */
|
---|
| 170 | /* configuration that derived the */
|
---|
| 171 | /* observations this value will change */
|
---|
| 172 | /* every time the station configuration */
|
---|
| 173 | /* changes*/
|
---|
| 174 | unsigned char num_obs; /* number of GPS Observations in data block*/
|
---|
| 175 | unsigned char *data; /* pointer to soc observation data (4 byte pointer), this pointer */
|
---|
| 176 | /* is not in the message the data starts */
|
---|
| 177 | /* here, the pointer is used to manage the */
|
---|
| 178 | /* SOC data once the RTIGS0_T message has */
|
---|
| 179 | /* been decoded */
|
---|
| 180 | } RTIGSO_T;
|
---|
| 181 | /*****************************************************************************
|
---|
| 182 | * Structure name : RTIGSE_T
|
---|
| 183 | *
|
---|
| 184 | * Purpose : SV Ephemeris in Broadcast format parity removed
|
---|
| 185 | *
|
---|
| 186 | *Version: 1.0
|
---|
| 187 | *
|
---|
| 188 | *By Ken MacLeod Aug. 27/2003
|
---|
| 189 | *Changes: Revised Feb. 10/2004
|
---|
| 190 | *****************************************************************************/
|
---|
| 191 | typedef struct rtigs_ephemeris
|
---|
| 192 | {
|
---|
| 193 | unsigned short rec_id; /* 300 indicates rt-igs eph*/
|
---|
| 194 | unsigned short sta_id; /* unique number assigned */
|
---|
| 195 | /* to each station*/
|
---|
| 196 | unsigned long CollectedGPSTime; /* time ephemeris received at */
|
---|
| 197 | /*station, GPS time is seconds */
|
---|
| 198 | /* from the beginning of GPS */
|
---|
| 199 | /* (6 Jan-1980)*/
|
---|
| 200 | unsigned short num_bytes; /* total number of bytes in the message, */
|
---|
| 201 | /* including the header, but not the size */
|
---|
| 202 | /* of the data pointer*/
|
---|
| 203 | unsigned char IODS; /* a flag indicating the current station */
|
---|
| 204 | /* configuration that derived the */
|
---|
| 205 | /* observations this will change every */
|
---|
| 206 | /* time the sta config changes*/
|
---|
| 207 | unsigned char prn; /* PRN*/
|
---|
| 208 | unsigned char *data; /* In the RTIGSE_T message the data */
|
---|
| 209 | /* starts here, the pointer is used to */
|
---|
| 210 | /* manage the eph data once the RTIGSE_T */
|
---|
| 211 | /* message has been decoded */
|
---|
| 212 | /* The RTIGSE_T eph. format consists of */
|
---|
| 213 | /* the 3 broadcast sub frames with the */
|
---|
| 214 | /* parity bits removed so 3 */
|
---|
| 215 | /* subframes = 72 bytes */
|
---|
| 216 | } RTIGSE_T;
|
---|
| 217 |
|
---|
| 218 | /***********************************************************************
|
---|
| 219 | * Structure name : RTIGSM_T
|
---|
| 220 | *
|
---|
| 221 | * Purpose : Station Meteorological observations
|
---|
| 222 | *
|
---|
| 223 | *Version: 1.0
|
---|
| 224 | *
|
---|
| 225 | *By Ken MacLeod Aug. 27/2003
|
---|
| 226 | *Changes: Changed the met array to an long pointer
|
---|
| 227 | ***********************************************************************/
|
---|
| 228 | typedef struct rtigs_mets
|
---|
| 229 | {
|
---|
| 230 | unsigned short rec_id; /* 400 indicates rt-igs met*/
|
---|
| 231 | unsigned short sta_id; /* unique number assigned to each */
|
---|
| 232 | /* station*/
|
---|
| 233 | unsigned long GPSTime; /* time of issue, GPS time is seconds */
|
---|
| 234 | /* from the beginning of GPS (6 Jan-1980)*/
|
---|
| 235 | unsigned short num_bytes; /* total number of bytes in the message,*/
|
---|
| 236 | /* including the header but not the pointer*/
|
---|
| 237 | unsigned char IODS; /* a flag indicating the current station */
|
---|
| 238 | /* config that derived the observations */
|
---|
| 239 | /* this will change every time the station */
|
---|
| 240 | /* configuration changes*/
|
---|
| 241 | unsigned char numobs; /* if only temp, press, rel hum then : 3 */
|
---|
| 242 | long *mets; /* temp(Deg C), press (mb), */
|
---|
| 243 | /* rel humid(%), zenith Wet(metres), */
|
---|
| 244 | /* Zenith Dry(metres), Zenith Total */
|
---|
| 245 | /* (metres) and each scaled by 1000 so */
|
---|
| 246 | /* 1000.123 mb = 1000123*/
|
---|
| 247 | /*if the zenith observations are not */
|
---|
| 248 | /* present only enter 3 for the num of obs.*/
|
---|
| 249 | } RTIGSM_T;
|
---|
| 250 |
|
---|
| 251 | #endif
|
---|