OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ck_trng.c
Go to the documentation of this file.
1 #include <string.h>
2 #include <libgen.h>
3 #include "l1stat.h"
4 #include "l1stat_proto.h"
5 extern int32 stat_status;
6 extern char bad_stat_str[320];
7 #define N_TRNG 20
8 
9 void ck_trng(char *file)
10 /*******************************************************************
11 
12  ck_trng
13 
14  purpose: check the file name to see if it is in one of any bad
15  time ranges, fail the file and print out the reason
16 
17  Returns type: void - none
18 
19  Parameters: (in calling order)
20  Type Name I/O Description
21  ---- ---- --- -----------
22  char * file I level-1 file name
23 
24  Modification history:
25  Programmer Date Description of change
26  ---------- ---- ---------------------
27  W. Robinson 24-Jan-1998 Original development
28  W. Robinson 14-May-1998 Add new time for nav off due to
29  GPS error
30  W. Robinson 2-Jul-1998 Add new time for nav off due to
31  clock error associated with a hit
32  on the S/C
33  W. Robinson 19-Oct-1998 new time range to auto fail for
34  GPS clock problem
35  W. Robinson 17-May-1999 GPS reset caused some nav probs,
36  add another fail period
37  W. Robinson 28-Mar-2000 GPS outage affects 1 GAC orbit
38  by 36 km, so flag it
39  W. Robinson 7-Apr-2000 GPS time error added to the
40  checking
41  W. Robinson 19-Sep-2000 1 sec GPS error for new time range
42  added
43  W. Robinson 13-Nov-2000 GPS error for 1 GAC orbit was added
44  W. Robinson 17-Jan-2001 A time tag problem for part of an orbit
45  on day 2001 011 was set to be flagged
46  Add 348 and 352 at this time also
47  W. Robinson 19-Apr-2001 GPS error for part of 1 GAC orbit
48  W. Robinson 21-Jun-2001 add another mandatory fail for a
49  1 sec time slip
50  W. Robinson 6-Sep-2001 flag a GPS reset causing 1 sec time
51  error for just HRPTs after the GAC
52  W. Robinson 18-sep-2001 flag GAC and time period in day 256
53  W. Robinson 6-nov-2001 report a mnemonic and code as std
54 
55  *******************************************************************/ {
56  char filefrag[15];
57  char stime[N_TRNG][100] = {"S1997292202120", "S1997295010921",
58  "S1998133173600", "S1998181170800", "S1998289233900",
59  "S1999084031100", "S19991341625", "S20000841825",
60  "S20000850602", "S20002591908", "S20003180900", "S20003041710",
61  "S20003481922", "S20003520725", "S20010111215", "S20011090325",
62  "S20011670840", "S20011940812", "S20012481847", "S20012560303"};
63  char etime[N_TRNG][100] = {"S1997292233904", "S1997297023851",
64  "S1998133175600", "S1998182161400", "S1998289234551",
65  "S19990841407", "S19991341653", "S20000841910",
66  "S20000851815", "S20002591923", "S20003180958", "S20003041735",
67  "S20003481934", "S20003520737", "S20010111225", "S20011090345",
68  "S20011670911", "S20011940852", "S20012481902", "S20012560319"};
69  char tcomnt[N_TRNG][100] ={"Time stamp problem: large along-track nav errors",
70  "Period of large along-track nav errors",
71  "GPS problem: time error causing > 6 km along-track nav errors",
72  "Spacecraft Clock problem, causing a large along-track nav error",
73  "GPS problem: time error causing 1 sec = 6 km along-track nav errors",
74  "GPS problem causing variable pitch, roll errors",
75  "GPS problem: time error causing some nav offsets",
76  "GPS outage: possible 36 km N-S nav offset in this time range",
77  "GPS time off, causing navigation error in whole period",
78  "GPS 1 sec error, causing along track error in navigation",
79  "GPS time error, causing navigation error in whole period",
80  "HRPT requires special L1 processing for gain 2 in this period",
81  "GPS time error, causing navigation error in whole period",
82  "GPS time error, causing navigation error in whole period",
83  "GPS time error, causing navigation error in whole period",
84  "GPS time error, causing navigation error in whole period",
85  "GPS time slip for this period requiring failure of HRPT",
86  "GPS time slip for this period requiring failure of HRPT",
87  "GPS reset, causing navigation error for part of the scene",
88  "GPS reset, causing navigation error for part of the scene"};
89  int i, icode;
90  char str[12];
91 
92  /*
93  * This is very easy, if the time in the file name is between the
94  * ranges declared in stime and etime, write the comment and fail the file
95  */
96  strncpy(filefrag, basename(file), 14);
97  filefrag[14] = '\0';
98 
99  icode = 0;
100  for (i = 0; i < N_TRNG; i++) {
101  if (strncmp(stime[i], filefrag, 14) <= 0 &&
102  strncmp(etime[i], filefrag, 14) >= 0) {
103  /* update the general status to product failure */
104  stat_status = stat_status | 2;
105 
106  /* print the range and the reason for failure */
107  /* Also, note that manual inspection is necessary */
108  printf("\n\n********* ck_trng: Product is in a mandatory product failure time range\n");
109  printf(" (The product requires interactive QC)\n");
110  printf("\nFile: '%s'\nis in the mandatory failure time range: '%s' to '%s'\n\n",
111  file, stime[i], etime[i]);
112  printf("Reason is:\n '%s'\n\n", tcomnt[i]);
113  icode = 1;
114  sprintf(str, "TRNG_CHK ");
115  if (strlen(bad_stat_str) <= 300)
116  strcat(bad_stat_str, str);
117  break;
118  }
119  }
120  /*
121  * print the std mnemonic
122  */
123  printf("\n\nFor file in time range check...\n");
124  printf(" Name code\n");
125  printf("-------- ----\n");
126  printf("TRNG_CHK %4d\n\n", icode);
127 }
int32 stat_status
Definition: l1stat_chk.c:8
void ck_trng(char *file)
Definition: ck_trng.c:9
#define N_TRNG
Definition: ck_trng.c:7
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413
char bad_stat_str[320]
Definition: l1stat_chk.c:11
#define basename(s)
Definition: l0chunk_modis.c:29
const char * str
Definition: l1c_msi.cpp:35
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
int i
Definition: decode_rs.h:71