OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
anc_seaice.c
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2  Program: anc_seaice
3 
4  Description: convert binary file of sea ice from wgrib2 into a
5  stabndard file of sea ice
6 
7  Arguments:
8  Type Name I/O Description
9  ---- ---- --- -----------
10  int argc I count of command line args - 3
11  char *[] argv I command line arguments:
12  see check_usage for all options
13 
14  Modification history:
15 
16  W. Robinson, SAIC 9 Dec 2009 initial routine
17  W. Robinson, SAIC 14 Jan 2011 Add smoothed icemask
18 
19 ----------------------------------------------------------------------------*/
20 #include "ancil.h"
21 #include <time.h>
22 #include <limits.h>
23 #include <unistd.h>
24 #include "ancnrt_proto.h"
25 
26 /*
27  * Met data specific settings
28  */
29 
30 #define VGROUPNAME "Geophysical Data"
31 
32 #define VSIZE 0.0833
33 #define HSIZE 0.0833
34 #define MAX_NORTH 90.0
35 #define MAX_SOUTH -90.0
36 #define MAX_WEST -180.0
37 #define MAX_EAST 180.0
38 #define GRIBLATSZ 2160 /* GRIB file size in lat */
39 #define GRIBLONSZ 4320 /* GRIB file size in lon */
40 #define OUTLATSZ 2160 /* output # lines */
41 #define OUTLONSZ 4320 /* output # pixels */
42 #define GRIB_MODE_1 1 /* the GRIB modes, GRIB 1 old, GRIB 2 post jan 08 */
43 #define GRIB_MODE_2 2
44 
45 /* #define VSIZE 2.5 */
46 /* #define HSIZE 2.5 */
47 /* #define MAX_EAST 177.5 */
48 /* #define WPHLATSZ 73 */ /* latitude of GRIB files */
49 /* #define WPHLONSZ 144 */ /* long of MODIFIED GRIB files */
50 
51 /* fortran prototype */
52 void mk_smooth_ice_map_(char* char_ice, float* frac_ice_smoothed);
53 
54 int main(int argc, char *argv[]) {
55  int i, j, k, l, anctyp, int_char_min, int_char_max;
56  int rank, SDSref = 0;
57  int result = 0;
58  int array_size = 0;
59  int numannarr = 0;
60  int one = 1, rgmode = 1;
61  int year = 0, month = 0, day = 0, hour = 0,
62  julval = 0, pyear = 0;
63  int32 shape[2], shape_smooth[2];
64 
65  float32 *datarr1, dat;
66 
67  static float32 latscl[GRIBLATSZ], lonscl[GRIBLONSZ], dlat, dlon;
68  char message[MAXNAMELNG], inz_wind[MAXNAMELNG], inm_wind[MAXNAMELNG];
69  char inpress[MAXNAMELNG], inp_water[MAXNAMELNG], inrel_hum[MAXNAMELNG];
70  char in_oz[MAXNAMELNG], longname[MAXNAMELNG], *sdsname;
71  char *units, *dataattr, *longnamelabel, *longnamevalue;
72  char *unitslabel, *unitsvalue, *datafmt, outfile[MAXNAMELNG];
73  char outfilename[MAXNAMELNG], outdir[MAXNAMELNG];
74  char annotfile[MAXNAMELNG], source_name[100];
75  int n_opt_arg;
76  float latstep, lonstep; /* lat/lon incr. */
77  int latsz, lonsz, np, nl, fcst; /* lat/lon size and fcst info holders */
78  float nmostlat, smostlat, wmostlon, emostlon; /* lat/lon corners */
79  time_t t; /* processing time */
80  struct tm *localtm; /* processing time */
81  struct annotation *xannot;
82  int grib_mode, npix = 4320, nlin = 2160;
83  char grib2_t_str[300];
84 
85  /*
86  * HDF datafile variables
87  */
88 
89  int32 sdfid, fid, gridid, dimid, sdsid, sdsref;
90  int32 datatype;
91 
92  /*
93  * data type array pointers
94  */
95 
96  float32 *float_SDSz_wind, *float_SDSm_wind, *float_SDSpress;
97  float32 *float_SDSp_water, *float_SDSrel_hum;
98  int16 *float_SDS_oz, *oz_newsiz;
99  int8 *int8_SDSdataQC, *seaice8;
100 
101  /*
102  * external functions used
103  */
104 
105  int readgrib(), julian_(), wrtattr(), startHDF();
106  int addAttr(), setSDSref();
107  int32 wrtsds();
108  void deattachHDFGrid(), pexit();
109  int8 check_usage();
110  struct annotation * fillenv_annot();
111 
112  /*
113  * ------- check command line arguments and set args ------------------
114  */
115 
116  if ((check_usage(argc, argv, &anctyp, &n_opt_arg, source_name,
117  &grib_mode, grib2_t_str)) != 0)
118  exit(-1);
119  strcpy(annotfile, argv[ n_opt_arg ]);
120  strcpy(in_oz, argv[ 1 + n_opt_arg ]);
121  if (argc - n_opt_arg < 3) strcpy(outdir, "./");
122  else strcpy(outdir, argv[ 2 + n_opt_arg ]);
123 
124  if ((datarr1 = malloc(GRIBLATSZ * GRIBLONSZ * sizeof ( float)))
125  == NULL) {
126  printf("%s - %d: Unable to allocate space for datarr1 array\n", __FILE__,
127  __LINE__);
128  return 1;
129  }
130  /*
131  * read the data
132  */
133  if (grib_mode == GRIB_MODE_2) {
134  result = readgrib2(in_oz, npix, nlin, rgmode, datarr1);
135  grib2_t(grib2_t_str, &year, &julval, &hour, &np, &nl, &fcst);
136  } else {
137  result = readgrib(in_oz, npix, nlin, datarr1, &year, &month, &day, &hour);
138  julval = julian_(&day, &month, &year);
139  }
140 
141  if (result == 1) {
142  strcpy(message, "readgrib file: ");
143  strcat(message, in_oz);
144  pexit(message);
145  }
146 
147  /*
148  * Create outfile name
149  * Note that for grib 2 files, whole year is available already
150  */
151  if (grib_mode == GRIB_MODE_1) {
152  if (year < 90) year = year + 2000; /* 2 digit 19xx or 20xx yrs to 4 */
153  else year = year + 1900;
154  }
155 
156  sprintf(outfile, "%s/N%04d%03d00_SEAICE_%s_24h.hdf",
157  outdir, year, julval, source_name);
158 
159  sprintf(outfilename, "N%04d%03d00_SEAICE_%s_24h.hdf",
160  year, julval, source_name);
161  /* For SDPS' benefit! */
162  printf("%s+%04d%03d000000000+%04d%03d235959999\n", outfile, year, julval,
163  year, julval);
164 
165 
166  /*
167  * Write HDF annotations, lat and lon SDSs
168  */
169 
170  /**** check for existing HDF ***/
171 
172  /* WDR/4/21/2015 removing the stupid failure if output is there already
173  if (!access(outfile, F_OK)) pexit ("....output file exists");
174  */
175 
176  if ((numannarr = count_annot(annotfile)) == 0)
177  pexit("no annotations found");
178 
179  if ((xannot = (struct annotation *)
180  malloc(sizeof (struct annotation) * numannarr))
181  == NULL) pexit("malloc Annotation");
182 
183  xannot = fillenv_annot(annotfile);
184 
185  /*
186  * Determine processing time
187  */
188 
189  (void) time(&t);
190  localtm = localtime(&t);
191  pyear = localtm->tm_year;
192  if (pyear < 90) pyear = pyear + 2000; /* 2 digit 19xx or 20xx yrs to 4 */
193  else pyear = pyear + 1900;
194 
195  /*
196  * ------- assign metadata values to local descriptive variables ----
197  * ------- insert dates and other values to metadata array ---------
198  * ------- follow order of fillenv data file -----------------------
199  */
200 
201  for (i = 0; i < numannarr; i++) {
202 
203  /* Insert values to descr array element */
204 
205  if (!strcmp(xannot[i].label, "Product Name"))
206  sprintf(xannot[i].descr, "%s", outfilename);
207 
208  else if (!strcmp(xannot[i].label, "Processing Time"))
209  sprintf(xannot[i].descr, "%04d%03d%02d%02d%02d%03d",
210  pyear, (localtm->tm_yday + 1), localtm->tm_hour, localtm->tm_min,
211  localtm->tm_sec, 0);
212 
213  else if (!strcmp(xannot[i].label, "Input Files"))
214  sprintf(xannot[i].descr, "%s", in_oz);
215 
216  else if (!strcmp(xannot[i].label, "Processing Control"))
217  sprintf(xannot[i].descr, "%s %s %s %s",
218  argv[0], annotfile, in_oz, outdir);
219 
220  else if (!strcmp(xannot[i].label, "Start Time"))
221  sprintf(xannot[i].descr, "%04d%03d000000000", year, julval);
222 
223  else if (!strcmp(xannot[i].label, "End Time"))
224  sprintf(xannot[i].descr, "%04d%03d230000000", year, julval);
225 
226  else if (!strcmp(xannot[i].label, "Start Year"))
227  sprintf(xannot[i].descr, "%04d", year);
228 
229  else if (!strcmp(xannot[i].label, "Start Day"))
230  sprintf(xannot[i].descr, "%03d", julval);
231 
232  else if (!strcmp(xannot[i].label, "Start Millisec"))
233  sprintf(xannot[i].descr, "00000000");
234 
235  else if (!strcmp(xannot[i].label, "End Year"))
236  sprintf(xannot[i].descr, "%04d", year);
237 
238  else if (!strcmp(xannot[i].label, "End Day"))
239  sprintf(xannot[i].descr, "%03d", julval);
240 
241  else if (!strcmp(xannot[i].label, "End Millisec"))
242  sprintf(xannot[i].descr, "82800000");
243 
244  /* Extract values from descr array element for program use */
245 
246  else if (!strcmp(xannot[i].label, "Northernmost Latitude"))
247  sscanf(xannot[i].descr, "%f", &nmostlat);
248 
249  else if (!strcmp(xannot[i].label, "Southernmost Latitude"))
250  sscanf(xannot[i].descr, "%f", &smostlat);
251 
252  else if (!strcmp(xannot[i].label, "Westernmost Longitude"))
253  sscanf(xannot[i].descr, "%f", &wmostlon);
254 
255  else if (!strcmp(xannot[i].label, "Easternmost Longitude"))
256  sscanf(xannot[i].descr, "%f", &emostlon);
257 
258  else if (!strcmp(xannot[i].label, "Latitude Step"))
259  sscanf(xannot[i].descr, "%f", &latstep);
260  }
261 
262  /*
263  * Create HDF file
264  */
265 
266  if ((result = startHDF(outfile, &sdfid, &fid, DFACC_CREATE)) != 0)
267  pexit("Fatal error starting HDF file");
268 
269  /*
270  * Write attribute array to HDF file
271  */
272 
273  if ((result = wrtattr(sdfid, xannot, numannarr)) != 0) pexit("wrtattr");
274  free(xannot);
275 
276  /*
277  * -------- Allocate space for 2D data arrays -----------------------
278  */
279 
280  rank = 2;
281 
282  shape[0] = OUTLATSZ; /* lat */
283  shape[1] = OUTLONSZ; /* lon */
284  array_size = shape[0] * shape[1];
285 
286  if ((int8_SDSdataQC =
287  (int8 *) calloc(array_size, sizeof (int8))) == NULL)
288  pexit("calloc int8_SDSdataQC");
289 
290  if ((float_SDS_oz =
291  (int16 *) malloc(sizeof (int16) * GRIBLATSZ * GRIBLONSZ)) == NULL)
292  pexit("malloc float_SDS_oz");
293 
294  if ((oz_newsiz =
295  (int16 *) malloc(sizeof (int16) * array_size)) == NULL)
296  pexit("malloc oz_newsiz");
297  if ((seaice8 = (int8 *) malloc(sizeof ( int8) * array_size)) == NULL)\
298  pexit("malloc seaice8");
299 
300  /*
301  * Process ozone the same way here
302  */
303  l = 0;
304  for (j = 0; j < GRIBLATSZ; j++) {
305  for (k = (GRIBLONSZ / 2); k < GRIBLONSZ; k++) {
306  dat = *(datarr1 + j * GRIBLONSZ + k);
307  if (dat < 0 || dat > SHRT_MAX)
308  float_SDS_oz[l] = 0;
309  else
310  float_SDS_oz[l] = (int16) (100. * dat);
311  l++; /* index counter */
312  } /* for k */
313 
314  for (k = 0; k < (GRIBLONSZ / 2); k++) { /* lons */
315  dat = *(datarr1 + j * GRIBLONSZ + k);
316  if (dat < 0 || dat > SHRT_MAX)
317  float_SDS_oz[l] = 0;
318  else
319  float_SDS_oz[l] = (int16) (100. * dat);
320  l++; /* index counter */
321  } /* for k */
322  } /* for j */
323 
324  /*
325  * interpolate the array to the traditional TOVS ozone size
326  */
327  resize_oz((short *) float_SDS_oz, GRIBLONSZ, GRIBLATSZ,
328  OUTLONSZ, OUTLATSZ, (short *) oz_newsiz);
329  int_char_min = 0;
330  int_char_max = 100;
331  for (j = 0; j < array_size; j++) {
332  if (*(oz_newsiz + j) < int_char_min) {
333  *(int8_SDSdataQC + j) = 1;
334  *(seaice8 + j) = -1;
335  } else if (*(oz_newsiz + j) > int_char_max) {
336  *(int8_SDSdataQC + j) = 1;
337  *(seaice8 + j) = 101;
338  } else
339  *(seaice8 + j) = *(oz_newsiz + j);
340  }
341  /*
342  * ----------------- Create Vgroup ----------------------------
343  */
344 
345  gridid = setupGrid(fid, VGROUPNAME);
346 
347  /*
348  * ----------------- Write ozone SDS ----------------------------
349  */
350 
351  sdsname = "seaice";
352  strcpy(longname, "Sea ice concentration");
353  units = "percent coverage";
354  datafmt = "int8";
355  datatype = DFNT_INT8;
356 
357  if ((SDSinFile(sdsname, longname, units, datafmt,
358  datatype, sdfid, rank, shape,
359  seaice8, gridid)) != 0)
360  pexit("SDSinFile ozone");
361 
362 
363  // Smoothed 1/2 degree icemask for Aquarius processing
364  float frac_ice_smooth[720 * 360];
365  mk_smooth_ice_map_((char *) seaice8, frac_ice_smooth);
366 
367  sdsname = "seaice_smoothed";
368  strcpy(longname, "Sea ice concentration (smoothed)");
369  units = "percent coverage";
370  datafmt = "float32";
371  datatype = DFNT_FLOAT32;
372  shape_smooth[0] = 360; /* lat */
373  shape_smooth[1] = 720; /* lon */
374  SDSinFile(sdsname, longname, units, datafmt,
375  datatype, sdfid, rank, shape_smooth,
376  frac_ice_smooth, gridid);
377 
378  free(float_SDS_oz);
379 
380  /*
381  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
382  */
383 
384  sdsname = "seaice_QC";
385  strcpy(longname, "Sea ice Q/C flag");
386  units = "";
387  datafmt = "int8";
388  datatype = DFNT_INT8;
389 
390  if ((SDSinFile(sdsname, longname, units, datafmt,
391  datatype, sdfid, rank, shape,
392  int8_SDSdataQC, gridid)) != 0)
393  pexit("SDSinFile ozone_QC");
394 
395  /*
396  * free storage for QC array (used for all products)
397  * also free the input array
398  */
399 
400  free(int8_SDSdataQC);
401  free(datarr1);
402  free(seaice8);
403  free(oz_newsiz);
404  /*
405  * deattach HDF grid (used for all products)
406  */
407 
408  deattachHDFgrid(gridid);
409 
410  /*
411  * close HDF structures
412  */
413 
414  if ((result = closeHDFstructs(sdfid, fid)) != 0) pexit("closeHDFstructs");
415 
416  return 0;
417 } /* main */
418 
419 int8 check_usage(int argc, char *argv[], int *anctyp, int *n_opt_arg,
420  char *source_name, int *grib_mode, char *grib2_t_str)
421 /*****************************************************************
422  File: check_usage
423 
424  Purpose: check command line arguments
425 
426  Description: check command line arguements and report proper usage
427  on argument count error or no argumnts.
428 
429  Returns: success (0) or failure(-1)
430 
431  Parameters: (in calling order)
432  Type Name I/O Description
433  ---- ---- --- -----------
434  int argc I arg count
435  char *[] argv I input arg list
436  int * anctyp O type of anc data, either
437  ANC_MET or ANC_OZONE
438  int * n_opt_arg O # option args
439  char * source_name O An alternate source (as in gbl
440  attrib source) name
441  int * grib_mode O Type of grib file the binary
442  file came from: GRIB_MODE_1 for
443  a GRIB 1 file, GRIB_MODE_2 for a
444  GRIB 2 file (NCEP std as of
445  Jan 2008)
446  char * grib2_t_str O string with time of the GRIB 2
447  data - used for setting file
448  name and attributes
449 
450  Note: This routine is custom for each program that uses it since
451  the arguments are different of course.
452 
453  Author: Brian D. Schieber, GSC, 10/93
454 
455  Mods: 10/4/93 BDS, new HDF inputs handle all 3 NCEP parms
456  W. Robinson, GSC, 4 Feb 97 changes for 5th param:rel_hum
457  W. Robinson, GSC, 18 Jun 98 add flexability to either accept
458  7 or 8 inputs for met data or 3 or 4 for ozone data
459  W. Robinson, SAIC, 12 May 2005 have optional argument -s
460  for an optional source name
461  W. Robinson, SAIC, 24 Jan 2008 add a grib mode -2 for grib 2
462  format files
463  J. Gales, Futuretech, 20 Jan 2010 Add version number
464  *****************************************************************/ {
465  extern char *optarg;
466  extern int optind, optopt;
467  int c, opt_source_found, errflg;
468 
469  /*
470  * get the options first, one for the source name
471  */
472  *grib_mode = GRIB_MODE_1;
473  opt_source_found = 0;
474  errflg = 0;
475  *n_opt_arg = 0;
476  while ((c = getopt(argc, argv, ":s:2:")) != -1) {
477  switch (c) {
478  case 's':
479  strcpy(source_name, optarg);
480  opt_source_found = 1;
481  break;
482  case '2':
483  strcpy(grib2_t_str, optarg);
484  *grib_mode = GRIB_MODE_2;
485  break;
486  case ':': /* -s without operand */
487  fprintf(stderr,
488  "Option -%c requires an operand\n", optopt);
489  errflg++;
490  break;
491  case '?':
492  fprintf(stderr, "Unrecognized option: -%c\n", optopt);
493  errflg++;
494  }
495  }
496  if (!errflg) {
497  *n_opt_arg = optind;
498  /*
499  * for regular arguments
500  */
501  if (argc - optind == 3 || argc - optind == 4) {
502  if (!opt_source_found) strcpy(source_name, "NCEP");
503  } else {
504  errflg++;
505  }
506  }
507  if (errflg) {
508  printf("\nVersion 1.0 (%s %s)", __DATE__, __TIME__);
509  printf("\n\nUsage:\n");
510  printf("\t%s [-s<sname>] <metadata> <file> [outdir]\n", argv[0]);
511  printf("\nWhere:\n");
512  printf("\tmetadata: DAAC-style HDF metadata (ASCII file)\n");
513  printf("\tfile: GRIB converted binary file to process\n");
514  printf("\t(this can be either from a GRIB or a GRIB2 file\n");
515  printf("\toutdir: Optional output directory ('.' default)\n");
516  printf("\t Options:\n");
517  printf("\t-s <sname> Optional source name to output file with:\n");
518  printf("\t file name form: NYYYYDDD00_SEAICE_<sname>_24h.hdf\n");
519  printf("\t default is NCEP\n");
520  printf(
521  "\t-2 <GRIB str> Specify the -2 with the <GRIB str> to process\n");
522  printf(
523  "\t binary files derived from a GRIB 2 format file. The\n");
524  printf(
525  "\t binary files are derived using wgrib2 with the -bin \n");
526  printf(
527  "\t option. The <GRIB str> is a required date / time\n");
528  printf(
529  "\t identification string gotten using wgrib2 -t\n");
530  printf("\n");
531  exit(-1);
532  }
533  return (0);
534 }
int32_t setupGrid(int32_t fid, char *grpname)
Definition: ANCroutines.c:51
integer, parameter int16
Definition: cubeio.f90:3
data_t t[NROOTS+1]
Definition: decode_rs.h:77
int j
Definition: decode_rs.h:73
int32_t day
int32_t SDSinFile(char *sdsname, char *longname, char *units, char *datafmt, int32_t datatype, int32_t sdfid, int32_t rank, int32_t *shape, void *data, int32_t gridid)
void mk_smooth_ice_map_(char *char_ice, float *frac_ice_smoothed)
int32_t nl
Definition: atrem_corl1.h:132
int addAttr(int32_t sdsid, char *dataattr, int32_t datatype, char *dataunit)
Definition: ANCroutines.c:222
#define GRIB_MODE_1
Definition: anc_seaice.c:42
#define NULL
Definition: decode_rs.h:63
int readgrib2(char *file, int npix, int nlin, int rgmode, float *data)
Definition: readgrib.c:77
#define VGROUPNAME
Definition: anc_seaice.c:30
float tm[MODELMAX]
int nlin
Definition: get_cmp.c:28
void resize_oz(short *, int, int, int, int, short *)
Definition: resize_oz.c:1
char descr[MAXDESCLEN]
Definition: ancil.h:72
int wrtattr(int32_t dfile, struct annotation *annot, int numannarr)
Definition: ANCroutines.c:631
void julian_(double *dtin, double *d_jd)
int count_annot(char *filename)
Definition: countann.c:11
instead the metadata field ProcessingEnvinronment is filled in from the output of a call to the POSIX compliant function uname from within the L1B code A small bug in L1B_Tables an incorrect comparison of RVS coefficients for TEBs to RVS coefficients for RSBs was being made This was replaced with a comparison between TEB coefficients This error never resulted in an incorrect RVS correction but did lead to recalculating the coefficients for each detector in a thermal band even if the coefficients were the same for all detectors To reduce to overall size of the reflective LUT HDF fill values were eliminated from all LUTs previously dimensioned where and where NUM_TIMES is the number of time dependent table pieces In Preprocess a small error where the trailing dropped scan counter was incremented when the leading dropped scan counter should have been was fixed This counter is internal only and is not yet used for any chiefly to casting of were added to make it LINUX compatible Output of code run on LINUX machines displays differences of at most scaled sector incalculable values of the Emissive calibration factor and incalculable values of SV or BB averages was moved outside the loop over frames in Emissive_Cal c since none of these quantities are frame dependent Initialization of b1 and XMS values in Preprocess c routine Process_OBCENG_Emiss was moved inside the detector loops The code was altered so that if up to five scans are dropped between the leading middle or middle trailing the leading or trailing granule will still be used in emissive calibration to form a cross granule average QA bits and are set for a gap between the leading middle and middle trailing granules respectively This may in rare instances lead to a change in emissive calibration coefficients for scans at the beginning or end of a granule A small bug in the Band correction algorithm was corrected an uncertainty value was being checked against an upper bound whereas the proper quantity to be checked was the corresponding which is the product of the Band radiance times the ratio of the Band to Band scaling factors times the LUT correction value for that detector In addition a new LUT which allows for a frame offset with regard to the Band radiance was added A LUT which switches the correction off or on was also added Changes which do not affect scientific output of the the pixel is flagged with the newly created flag and the number of pixels for which this occurs is counted in the QA_common table The array of b1s in Preprocess c was being initialized to outside the loop over which meant that if b1 could not be the value of b1 from the previous band for that scan detector combination was used The initialization was moved inside the band loop Minor code changes were made to eliminate compiler warnings when the code is compiled in bit mode Temperature equations were upgraded to be MODIS AQUA or MODIS TERRA specific and temperature conversion coefficients for AQUA were MOD_PR02 will not cease execution if the value of this parameter is not but will print a message
Definition: HISTORY.txt:644
int32_t wrtsds(int32_t sdfid, int rank, int32_t *shape, int32_t datatype, char *datalabel, void *data)
struct annotation * fillenv_annot(char *filename)
Definition: fillenv.c:15
int readgrib(char *file, int npix, int nlin, float *data, int *year, int *month, int *day, int *hour)
Definition: readgrib.c:6
#define GRIBLATSZ
Definition: anc_seaice.c:38
int deattachHDFgrid(int32_t gridid)
Definition: ANCroutines.c:267
#define OUTLATSZ
Definition: anc_seaice.c:40
int main(int argc, char *argv[])
Definition: anc_seaice.c:54
int grib2_t(char *grib2_t_str, int *year, int *doy, int *hour, int *npix, int *nlin, int *h_fcst)
Definition: readgrib.c:158
#define OUTLONSZ
Definition: anc_seaice.c:41
int closeHDFstructs(int32_t sdfid, int32_t fid)
Definition: ANCroutines.c:281
void pexit(char *string)
Definition: pexit.c:10
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned resolving bug report Corrected to filter out Aqua attitude records with missing status helping resolve bug MOD_PR03 will still correctly write scan and pixel data that does not depend upon the start time
Definition: HISTORY.txt:248
Extra metadata that will be written to the HDF4 file l2prod rank
#define GRIB_MODE_2
Definition: anc_seaice.c:43
HDF4 data type of the output SDS Default is DFNT_FLOAT32 Common types used DFNT_FLOAT32
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 as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT and to use it determine the correct files to retrieve the ephemeris and attitude data from Changed to produce a LocalGranuleID starting with MYD03 if run on Aqua data Added the Scan Type file attribute to the Geolocation copied from the L1A and attitude_angels to radians rather than degrees The accumulation of Cumulated gflags was moved from GEO_validate_earth_location c to GEO_locate_one_scan c
Definition: HISTORY.txt:464
int setSDSref(int32_t sdsid, int32_t gridid)
Definition: ANCroutines.c:245
#define MAXNAMELNG
Definition: ancil.h:43
int i
Definition: decode_rs.h:71
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
int k
Definition: decode_rs.h:73
string outfilename
Definition: color_dtdb.py:220
int npix
Definition: get_cmp.c:27
int8 check_usage(int argc, char *argv[], int *anctyp, int *n_opt_arg, char *source_name, int *grib_mode, char *grib2_t_str)
Definition: anc_seaice.c:419
#define GRIBLONSZ
Definition: anc_seaice.c:39
int startHDF(char *outfile, int32_t *sdfid, int32_t *fid, int32_t mode)
Definition: ANCroutines.c:27