OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
VcstCmnGeoStructs.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * NAME: VcstCmnGeoStructs.h
4  *
5  * DESCRIPTION: Defines the data structures used in VcstCmnGeo.
6  *
7  * Adapted directly from ProSdrCmnGeoStruct.h developed by Raytheon Company.
8  *
9  *****************************************************************************/
10 
11 #ifndef VcstCmnGeoStructs_h
12 #define VcstCmnGeoStructs_h
13 
14 #include <map>
15 #include <string>
16 #include <vector>
17 #include <VcstCmnConsts.h>
18 #include <VcstCalLutStructures.h>
19 
20 // Type definition for the Cmn Geo Anomaly Stage.
21 
22 typedef enum {
28 
29 // Type definition for the Cmn Geo E&A Check Error.
30 
31 typedef enum {
32  GEO_EA_CHK_NO_ERROR = 0, // No Errors
33  GEO_EA_CHK_ANG_MOMENTUM = 1, // Angular Momentum
34  GEO_EA_CHK_ANG_MOMENTUM_Z = 2, // Angular Momentum Z Component
35  GEO_EA_CHK_ORIBIT_CONSISTENCY = 4, // Orbit Consitency
36  GEO_EA_CHK_POS_ABS = 8, // Position Absolute
37  GEO_EA_CHK_POS_MAG = 16, // Position Magnitude
38  GEO_EA_CHK_VEL_ABS = 32, // Velocity Absolute
39  GEO_EA_CHK_VEL_MAG = 64, // Velocity Magnitude
40  GEO_EA_CHK_ATTITUDE = 128, // Attitude RPY
42 
43 /*****************************************************************
44  * Definitions for the VIIRS resolution types
45  ****************************************************************/
46 
47 enum BandType {
49 };
50 
51 // Contains E&A information for a specific time
52 
54  double tai;
55  long long iet;
56  double cLat;
57  double dLat;
58  double lon;
59  double alt;
60  double direc;
61  double direcR;
62  double roll;
63  double pitch;
64  double yaw;
65  double iPos[VEC_SIZE];
66  double iVel[VEC_SIZE];
67  double iAcc[VEC_SIZE];
68  double rPos[VEC_SIZE];
69  double rVel[VEC_SIZE];
70  double rAcc[VEC_SIZE];
71  double quat[QUAT_SIZE];
74  unsigned short eaError;
76 
78  InitPoint();
79  }
80  ;
81 
82  void InitPoint(void) {
83  tai = 0.0;
84  iet = 0;
85  cLat = 0.0;
86  dLat = 0.0;
87  lon = 0.0;
88  alt = 0.0;
89  direc = 0.0;
90  direcR = 0.0;
91  roll = 0.0;
92  pitch = 0.0;
93  yaw = 0.0;
94  for (int i = 0; i < VEC_SIZE; i++) {
95  iPos[i] = 0.0;
96  iVel[i] = 0.0;
97  iAcc[i] = 0.0;
98  rPos[i] = 0.0;
99  rVel[i] = 0.0;
100  rAcc[i] = 0.0;
101  matQ[i][0] = 0.0;
102  matQ[i][1] = 0.0;
103  matQ[i][2] = 0.0;
104  }
105  for (int j = 0; j < QUAT_SIZE; j++) {
106  quat[j] = 0.0;
107  }
109  eaError = 0;
110  maneuverType = "(empty)";
111  }
112  ;
113 };
114 
115 // Type definition for the list of E&A points.
116 // The key for this map is the TAI time of the point.
117 typedef std::map<double, CmnGeoEAPointType> CmnGeoEphAttPointsMap;
118 
119 // Contains E&A information for the entire granule
120 
125  long long ietCreated;
126  long long ietBgnTime;
127  long long ietEndTime;
128  double taiBgnTime;
129  double taiEndTime;
130  double deltaTAI;
131 
132 };
133 
134 // Contains subset of ADCS_HSK (APID 8) data
135 
137  double taiTime;
138  unsigned char adManDone;
139  unsigned short adFftId;
140 };
141 
142 // Contains subset of Bus Critical (APID 0) data
143 
145  double taiTime;
146  unsigned char adState;
147 };
148 
149 // Contains S/C Position/Velocity data
150 
152  double taiTime;
153  float pos[VEC_SIZE];
154  float vel[VEC_SIZE];
155 };
156 
157 // Contains S/C Quaternion data
158 
160  double taiTime;
161  float quat[QUAT_SIZE];
162 };
163 
164 // Contains S/C Ephem/Attitude byte aligned data
165 
167  std::vector<CmnGeoEphemType> ephem;
168  std::vector<CmnGeoAttType> attitude;
169  std::vector<AdcsHskTlmType> adcsHskTlm;
170  std::vector<BusCritTlmType> busCritTlm;
171  double startTime; // Start time of granule in TAI
172  double stopTime; // Stop time of granule in TAI
173 };
174 
175 /*******************************************************************
176  *
177  * orbital_elements - structure which contains the orbital elements
178  * tle_string1 & 2 - Two-Line-Element strings
179  * sat_ID - the satellite identifier string
180  * epochtime - epoch time of the element set
181  * epochTAI - epoch time in TAI
182  * epoch_rev - rev number of ascending node
183  * satrec - satellite record used by SGP4 routines.
184  *
185  * These elements have been removed from the structure since they
186  * are also in the "satrec" structure used by SGP4. The comments
187  * are left here so that the names used by SGP4 can be more easily
188  * translated and understood.
189  * firtimedermeanmot - first time derivative of mean motion
190  * sectimedermeanmot - second time derivative of mean motion
191  * sectimedermeanmotexp - exponent of sec time derivative of mean mot
192  * bstardragterm - BSTAR drag term
193  * bstardragtermexp - exponent of BSTAR drag term
194  * inclination - inclination
195  * rightascenascnode - right acension of the ascending node
196  * eccentricity - eccentricity
197  * argperigee - argument of perigee
198  * meananomaly - mean anomaly
199  * meanmotion - mean motion
200  *
201  *******************************************************************/
202 
203 // Provide a forward reference to elsetrec to avoid conflicts between
204 // SGP4's definition of PI and ones used elsewhere in PRO.
205 struct elsetrec;
206 // elsetrec is defined in sgp4unit.h
207 
209  char tle_string1[80];
210  char tle_string2[80];
211 
212  char sat_ID[32]; // NORAD names are up to 24 characters
213  double epochtime; // TLE year-days.fractionOfDay
214  double epochTAI; // TLE epoch time in TAI seconds
215  int epoch_rev; // revolution number at epoch (not stored
216  // in the SGP4 satrec)
217 
218  double TDTmUT1; // diff between Terrestrial Dynamic Time and
219  // UT1 (units of seconds)
220  double UT1mUTC; // diff between UT1 - UTC
221  double xWander; // X polar wander
222  double yWander; // Y polar wander
223 
224  double UT1SatEpoch; // TLE epoch time in UT1. Note satrec
225  // stores the epoch in UTC.
226  elsetrec *satrec; // pointer to a record of SGP4 element sets
227 
228 };
229 
230 // Variables to hold the values of the polar wander data within
231 // an algorithm run, will be reset between taskings.
232 
234  double TDTmUT1; // diff Terrestrial Dynamic - UT1, seconds
235  double UT1mUTC; // difference between UT1 and UTC, seconds
236  double prevTAI; // TAI on a previous call
237  double xWander; // x coordinate of polar wander, arc seconds
238  double yWander; // y coordinate of polar wander, arc seconds
239 
240 };
241 
242 // USNO Polar Wander / UT1-UTC data
243 
245  double txyTAI[13000];
246  double xWander[13000];
247  double yWander[13000];
248  double UT1mUTC[13000];
249  double dateIERSBullA; // TAI format date
250  double xwCon[5];
251  double ywCon[5];
252  double xyConA[2];
253  double xyConC[2];
254  double bessel[3];
255  double conUT2mUT1[4];
256  double conUT1mUTC[3];
257  int numPts;
258  // XLC's "power" alignment implicitly puts a pad in this location.
259  unsigned char pad[4];
260 };
261 
266 };
267 
277 };
278 
280  double tjdStart;
281  double tjdEnd;
282  double span;
283  double au;
284  double emrat;
286  char pad[4];
288 };
289 
290 struct SAALutType {
291  double centerLat;
292  double centerLon;
293  double maxIndex;
294  double latHeight;
295  double lonWidth;
296 };
297 
302 };
303 
307 };
308 
313 };
314 
320  unsigned char adstate[SC_DIARY_RECORDS];
326 };
327 
328 #endif
@ GEO_ANOMALY_STAGE_2
const int JPL_EPHEM_COL
float orb_pos[SC_DIARY_RECORDS_10HZ][VEC_SIZE]
double AttitudeAbsLimit[CMNGEO_MIN_MAX_DIM]
@ GEO_EA_CHK_ATTITUDE
@ BAND_TYPE_DNB
float vel[VEC_SIZE]
int j
Definition: decode_rs.h:73
double coeffs[JPL_EPHEM_ROW][JPL_EPHEM_COL]
@ GEO_EA_CHK_VEL_ABS
float quat[QUAT_SIZE]
double PositionMagLimit[CMNGEO_MIN_MAX_DIM]
std::vector< CmnGeoAttType > attitude
double VelocityMagLimit[CMNGEO_MIN_MAX_DIM]
unsigned char adState
@ BAND_TYPE_MOD_UNAGG
@ GEO_EA_CHK_VEL_MAG
unsigned char adManDone
float voltCoef[SDSM_SAMPLES][SDSM_DETECTORS][SDSM_COEF]
@ BAND_TYPE_MOD
float att_quat[SC_DIARY_RECORDS_10HZ][QUAT_SIZE]
const int SD_MATRIX_ROW
@ GEO_EA_CHK_ANG_MOMENTUM
@ GEO_ANOMALY_STAGE_0
const int JPL_EPHEM_ROW
@ string
float sdsmMatrix[SD_MATRIX_ROW][SD_MATRIX_COL]
double quat[QUAT_SIZE]
const int NUM_BANDS
const int NUM_DETECTORS
@ BAND_TYPE_IMG
double AngularMomentumLimit[CMNGEO_MIN_MAX_DIM]
const int SD_MATRIX_COL
std::string maneuverType
double iVel[VEC_SIZE]
CmnGeoEphAttPointsMap points
const int SC_DIARY_RECORDS
Definition: VcstCmnConsts.h:59
unsigned short adFftId
int voltLowerLimit[SDSM_SAMPLES][SDSM_DETECTORS]
double rVel[VEC_SIZE]
double AngularMomentumZLimit[CMNGEO_MIN_MAX_DIM]
@ GEO_ANOMALY_STAGE_3
CmnGeoAnomalyStage eaStage
std::vector< AdcsHskTlmType > adcsHskTlm
const int JPL_IPT_COL
double matQ[VEC_SIZE][VEC_SIZE]
const int VEC_SIZE
const int JPL_IPT_ROW
double PositionAbsLimit[CMNGEO_MIN_MAX_DIM]
double adcs_time[SC_DIARY_RECORDS_10HZ]
double bus_time[SC_DIARY_RECORDS]
@ GEO_ANOMALY_STAGE_1
const int SDSM_SAMPLES
float moon_offset_limits[NUM_BANDS][NUM_MOON_OFFSET_LIMITS]
int ipt[JPL_IPT_ROW][JPL_IPT_COL]
double rAcc[VEC_SIZE]
BandType
double VelocityAbsLimit[CMNGEO_MIN_MAX_DIM]
short adfftid[SC_DIARY_RECORDS_10HZ]
const int QUAT_SIZE
float sdMatrix[SD_MATRIX_ROW][SD_MATRIX_COL]
@ GEO_EA_CHK_ORIBIT_CONSISTENCY
std::vector< BusCritTlmType > busCritTlm
@ GEO_EA_CHK_POS_MAG
CmnGeoAnomalyStage
const int CMNGEO_MIN_MAX_DIM
unsigned char pad[4]
const int SDSM_COEF
@ GEO_EA_CHK_POS_ABS
unsigned char adstate[SC_DIARY_RECORDS]
const int SC_DIARY_RECORDS_10HZ
Definition: VcstCmnConsts.h:60
unsigned char Detector_Quality_Flag_Values[NUM_DETECTORS][8]
double orb_time[SC_DIARY_RECORDS_10HZ]
double rPos[VEC_SIZE]
float orb_vel[SC_DIARY_RECORDS_10HZ][VEC_SIZE]
float pos[VEC_SIZE]
double iPos[VEC_SIZE]
CmnGeoEACheckError
int voltUpperLimit[SDSM_SAMPLES][SDSM_DETECTORS]
const int NUM_MOON_OFFSET_LIMITS
double att_time[SC_DIARY_RECORDS_10HZ]
@ GEO_EA_CHK_ANG_MOMENTUM_Z
int i
Definition: decode_rs.h:71
unsigned char admandone[SC_DIARY_RECORDS_10HZ]
const int SDSM_DETECTORS
double iAcc[VEC_SIZE]
std::map< double, CmnGeoEAPointType > CmnGeoEphAttPointsMap
std::vector< CmnGeoEphemType > ephem
unsigned short eaError
@ GEO_EA_CHK_NO_ERROR