OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ancnrt_2p5.c
Go to the documentation of this file.
1 /*****************************************************************
2  * File: ancnrt_2p5.c
3  *
4  * Purpose: create HDF ancillary real time datafile from
5  * NCEP (formerly NMC) (unpacked GRIB format) W, P, PW, H input
6  * or a TOVS ozone unpacked GRIB file from NMC.
7  * For temporary use, a 2.5 degree grid version for MET only
8  *
9  * Description: this program will create a HDF with the components:
10  *
11  * Met data:
12  * HDF DAAC compliant Annotation object
13  * 1-D Latitude SDS
14  * 1-D Longitude SDS
15  * 2-D data parameter SDS (z_wind)
16  * 2-D Q/C flag (z_wind_QC)
17  * 2-D data parameter SDS (m_wind)
18  * 2-D Q/C flag (m_wind_QC)
19  * 2-D data parameter SDS (press)
20  * 2-D Q/C flag (press_QC)
21  * 2-D data parameter SDS (rel_hum)
22  * 2-D Q/C flag (rel_hum_QC)
23  * 2-D data parameter SDS (p_water)
24  * 2-D Q/C flag (p_water_QC)
25  *
26  * Ozone data:
27  * 2-D data parameter SDS (ozone)
28  * 2-D Q/C flag (ozone_QC)
29  *
30  * Input parms:
31  * char *annotfile - input of DAAC compliant annotations ("fillenv.met")
32  * char *inz_wind - input to process ("z_wind.dat")
33  * char *inm_wind - input to process ("m_wind.dat")
34  * char *inpress - input to process ("press.dat")
35  * char *inp_water - input to process ("p_water.dat")
36  * char *inrel_hum - input to process ("rel_hum.dat")
37  *
38  * z_wind, m_wind, press, p_water, rel_hum are replaced by the ozone
39  * parameter only for the ozone dataset
40  *
41  * char *outdir - output directory to write file
42  *
43  * Output parms:none
44  *
45  * output name is derived from GRIB converted file header.
46  * Example name: "N199312300_MET_NCEPR_6h.hdf"
47  * "S199312300_TOVS.OZONE" for ozone file
48  *
49  * Returns: run status
50  *
51  * Local vars: numerous variables for storing HDF annotations and SDSs.
52  *
53  * Subs called:
54  * wrtattr - write HDF annotation to file
55  * fill_annot - read HDF annotations from file
56  * wrtsds - write SDS from array to file
57  * pexit - print fatal errors
58  * check_usage- check command line args
59  * readgrib - FORTRAN routine to read binary
60  * (GRIB extracted) files
61  *
62  * History: none
63  *
64  * Note: This program is meant to generate SeaWiFS style HDF
65  * ancillary real-time datafiles.
66  *
67  * Author: Brian D. Schieber, GSC, 4/93
68  *
69  * Modification history:
70  * BDS, 4/19/93 - HDF missing flag removed after discussions
71  * with Jim F. and M.Darzi.
72  * - NCEP data in Pascals, divided by 100 => millibars.
73  * BDS, 4/30/93 - Modified GRIB read WPHLONSZ to remove "world wrapped"
74  * extra Lon. Will skip last longitude in HDF write.
75  * BDS, 10/4/93 - Modified for new HDF design and to produce and
76  * output file which holds all three met fields (WPH).
77  * BDS, 11/8/93 - Modified to create z/m wind SDS rather than windspeed.
78  * BDS, 11/28/93- Modified MAX_EAST to 177.5 (from 180.0).
79  * BDS, 12/6/93 - Assuming no missing values, 0.0's passed through.
80  * BDS, 5/19/95 - Support new SeaWiFS v 2.7 product specs.
81  * BDS, 8/21/96 - Renamed 'perror' to 'pexit' to avoid conflict with
82  * HDF4.0.
83  * BDS, 9/18/96 - Changed annot structure. Modify to support new 1x1
84  * GDAS1 files.
85  * BDS, 9/19/96 - Precipitable water has units kg/m^2
86  * W. Robinson, GSC, 4 Feb 97 put rh back in
87  * W. Robinson, GSC, 18 Jun 98 rename to ancnrt to include added
88  * role of processing the TOVS ozone data
89  * W. Robinson, GSC, 18 Dec 98 for the ozone output, write the
90  * start and end times to be compatible with o3nrt
91  * W. Robinson, SAIC, 23 Jan 2008 to add ability to read the binary
92  * files derived from the GRIB 2 format files (just a few
93  * differences, see readgrib2 in readgrib.c)
94  * W. Robinson, SAIC, 18 Sep 2009 modify readgrib2 call args- rgmode
95  * W. Robinson, SAIC, 16 Feb 2010 modify readgrib2 call args npix, nlin
96  * W. Robinson, SAIC, 24 Jun 2014 updates for new met file name
97  * W. Robinson, SAIC, 24 Jun 2014 Formal 2.5 degree grid version
98  * W. Robinson, SAIC, 4 Aug 2014 use wind and height at standard
99  * heights to make the 10 m wind for the R2 data
100  * W. Robinson, SAIC, 6 Apr 2015 as this is a Reanalysis 2 only version
101  * and never does GRIB2, remove calls for readgrib2
102  *****************************************************************/
103 #include <mfhdf.h>
104 #include "ancil.h"
105 #include <time.h>
106 #include <limits.h>
107 #include <unistd.h>
108 #include "ancnrt_proto.h"
109 
110 /*
111  * Met data specific settings
112  */
113 
114 #define VGROUPNAME "Geophysical Data"
115 
116 #define BIN_METH 2
117 #define REGISTRATION CENTER
118 #define VSIZE 2.5
119 #define HSIZE 2.5
120 #define MAX_NORTH 90.0
121 #define MAX_SOUTH -90.0
122 #define MAX_WEST -180.0
123 #define MAX_EAST 177.50
124 #define WPHLATSZ 73 /* latitude of GRIB files */
125 #define WPHLONSZ 144 /* long of MODIFIED GRIB files */
126 #define OZLATSZ 180 /* TOVS output # lines */
127 #define OZLONSZ 288 /* TOVS output made to this size */
128 #define ANC_MET 0 /* for ancillary data type (anctyp) say this is met data */
129 #define ANC_OZONE 1 /* say this is ozone data */
130 #define GRIB_MODE_1 1 /* the GRIB modes, GRIB 1 old, GRIB 2 post jan 08 */
131 #define GRIB_MODE_2 2
132 #define NLEV 6
133 
134 int main(int argc, char *argv[]) {
135  int i, j, k, l, anctyp;
136  int rank;
137  int result = 0;
138  int array_size = 0;
139  int numannarr = 0;
140  int year = 0, month = 0, day = 0, hour = 0, msec = 0,
141  julval = 0, pyear = 0;
142  int32 shape[2];
143  int npix = WPHLONSZ, nlin = WPHLATSZ;
144 
145  float32 datarr1[WPHLATSZ][WPHLONSZ];
146  float32 datarr2[WPHLATSZ][WPHLONSZ];
147  float32 datarr3[WPHLATSZ][WPHLONSZ];
148  float32 datarr4[WPHLATSZ][WPHLONSZ];
149  float32 datarr5[WPHLATSZ][WPHLONSZ];
150 
151  int32 ilev, nsamp, isamp, ihgt, ipix, ilin;
152  float32 u_cube[ npix * nlin * NLEV ], v_cube[ npix * nlin * NLEV ];
153  float32 hgt_cube[ npix * nlin * (NLEV + 1) ], u_lo, u_hi, v_lo, v_hi;
154  float32 hgt_agl, hgt_agl2, corr, frac;
155  char nms_uwind[NLEV][MAXNAMELNG], nms_vwind[NLEV][MAXNAMELNG];
156  char nms_hgt[ NLEV + 1 ][MAXNAMELNG];
157  char message[MAXNAMELNG], inz_wind[MAXNAMELNG], inm_wind[MAXNAMELNG];
158  char inpress[MAXNAMELNG], inp_water[MAXNAMELNG], inrel_hum[MAXNAMELNG];
159  char in_oz[MAXNAMELNG], longname[MAXNAMELNG], *sdsname;
160  char *units;
161  char *datafmt, outfile[MAXNAMELNG];
162  char outfilename[MAXNAMELNG], outdir[MAXNAMELNG];
163  char annotfile[MAXNAMELNG], source_name[100];
164  int n_opt_arg;
165  float latstep, lonstep; /* lat/lon incr. */
166  int latsz, lonsz; /* lat/lon size */
167  float nmostlat, smostlat, wmostlon, emostlon; /* lat/lon corners */
168  time_t t; /* processing time */
169  struct tm *localtm; /* processing time */
170  struct annotation *xannot;
171  int grib_mode;
172  char grib2_t_str[300];
173 
174  /*
175  * HDF datafile variables
176  */
177 
178  int32 sdfid, fid, gridid;
179  int32 datatype;
180 
181  /*
182  * data type array pointers
183  */
184 
185  float32 *float_SDSz_wind, *float_SDSm_wind, *float_SDSpress;
186  float32 *float_SDSp_water, *float_SDSrel_hum;
187  int16 *float_SDS_oz, *oz_newsiz;
188  int8 *int8_SDSdataQC;
189 
190  /*
191  * external functions used
192  */
193 
194  int readgrib(), julian_(), wrtattr(), startHDF();
195  int addAttr(), setSDSref();
196  int32 wrtsds();
197  void deattachHDFGrid(), pexit();
198  int8 check_usage();
199  struct annotation * fillenv_annot();
200  float wind_hgt_corr(float);
201 
202  /*
203  * ------- check command line arguments and set args ------------------
204  */
205 
206  if ((check_usage(argc, argv, &anctyp, &n_opt_arg, source_name,
207  &grib_mode, grib2_t_str)) != 0)
208  exit(-1);
209  strcpy(annotfile, argv[ n_opt_arg ]);
210  if (anctyp == ANC_MET) {
211  for (ilev = 0; ilev < NLEV; ilev++) {
212  strcpy(nms_uwind[ilev], argv[ 1 + ilev + n_opt_arg ]);
213  strcpy(nms_vwind[ilev], argv[ 1 + ilev + NLEV + n_opt_arg ]);
214  strcpy(nms_hgt[ilev], argv[ 1 + ilev + 2 * NLEV + n_opt_arg ]);
215  }
216  strcpy(nms_hgt[NLEV], argv[ 1 + 3 * NLEV + n_opt_arg ]);
217  /* end new wind input */
218  strcpy(inpress, argv[ 2 + 3 * NLEV + n_opt_arg ]);
219  strcpy(inp_water, argv[ 3 + 3 * NLEV + n_opt_arg ]);
220  strcpy(inrel_hum, argv[ 4 + 3 * NLEV + n_opt_arg ]);
221  if (argc - n_opt_arg < 8) strcpy(outdir, "./");
222  else strcpy(outdir, argv[ 5 + 3 * NLEV + n_opt_arg ]);
223  } else {
224  strcpy(in_oz, argv[ 1 + n_opt_arg ]);
225  if (argc - n_opt_arg < 3) strcpy(outdir, "./");
226  else strcpy(outdir, argv[ 2 + n_opt_arg ]);
227  }
228 
229  /*
230  * ------- Read each binary file, extract data array and time ----------
231  */
232 
233  if (anctyp == ANC_MET) {
234  if (grib_mode == GRIB_MODE_2) {
235  strcpy(message, "GRIB 2 files not handled");
236  pexit(message);
237  } else {
238  /*
239  * get the u, v, height and find the 10 m wind
240  */
241  for (ilev = 0; ilev < NLEV; ilev++) {
242  result = readgrib(nms_uwind[ilev], npix, nlin,
243  (u_cube + ilev * npix * nlin), &year, &month, &day, &hour);
244  if (result == 1) {
245  strcpy(message, "readgrib fail, file: ");
246  strcat(message, nms_uwind[ilev]);
247  pexit(message);
248  }
249  /* */
250  result = readgrib(nms_vwind[ilev], npix, nlin,
251  (v_cube + ilev * npix * nlin), &year, &month, &day, &hour);
252  if (result == 1) {
253  strcpy(message, "readgrib fail, file: ");
254  strcat(message, nms_vwind[ilev]);
255  pexit(message);
256  }
257  /* */
258  result = readgrib(nms_hgt[ilev], npix, nlin,
259  (hgt_cube + ilev * npix * nlin), &year, &month, &day, &hour);
260  if (result == 1) {
261  strcpy(message, "readgrib fail, file: ");
262  strcat(message, nms_hgt[ilev]);
263  pexit(message);
264  }
265  }
266  result = readgrib(nms_hgt[NLEV], npix, nlin,
267  (hgt_cube + NLEV * npix * nlin), &year, &month, &day, &hour);
268  if (result == 1) {
269  strcpy(message, "readgrib fail, file: ");
270  strcat(message, nms_hgt[NLEV]);
271  pexit(message);
272  }
273  }
274  /*
275  * Now, derive the wind at 10 m using the wind at the 1st height that is
276  * more than 10 m above the surface. For a surface -10 -> 10 m above
277  * surface, use that wind mixed in to the wind at the next higher level
278  * corrected to 10 m
279  */
280  nsamp = npix * nlin;
281  for (isamp = 0; isamp < nsamp; isamp++) {
282  for (ihgt = 0; ihgt < NLEV; ihgt++) {
283  ilin = isamp / npix;
284  ipix = isamp % npix;
285  hgt_agl = *(hgt_cube + isamp + nsamp * ihgt) -
286  *(hgt_cube + isamp + nsamp * NLEV);
287  if ((hgt_agl < -10.) && (ihgt == NLEV - 1)) {
288  /* if we are at the top and still < -10 m, just use the vals at top */
289  datarr1[ilin][ipix] = *(u_cube + isamp + nsamp * ihgt);
290  datarr2[ilin][ipix] = *(v_cube + isamp + nsamp * ihgt);
291  break;
292  }
293  if ((hgt_agl >= -10.) && (hgt_agl <= 10.)) {
294  if (ihgt == NLEV - 1) {
295  /* if at the top level, just use the top wind */
296  datarr1[ilin][ipix] = *(u_cube + isamp + nsamp * ihgt);
297  datarr2[ilin][ipix] = *(v_cube + isamp + nsamp * ihgt);
298  break;
299  } else {
300  /*
301  * if around the level, mix wind at that level with corrected
302  * wind from next level up
303  */
304  u_lo = *(u_cube + isamp + nsamp * ihgt);
305  v_lo = *(v_cube + isamp + nsamp * ihgt);
306  frac = (10. - hgt_agl) / 20.;
307  hgt_agl2 = *(hgt_cube + isamp + nsamp * (ihgt + 1)) -
308  *(hgt_cube + isamp + nsamp * NLEV);
309  corr = wind_hgt_corr(hgt_agl2);
310  u_hi = corr * *(u_cube + isamp + nsamp * ihgt);
311  v_hi = corr * *(v_cube + isamp + nsamp * ihgt);
312  datarr1[ilin][ipix] = u_hi * frac + u_lo * (1. - frac);
313  datarr2[ilin][ipix] = v_hi * frac + v_lo * (1. - frac);
314  break;
315  }
316  } else if (hgt_agl > 10.) {
317  /* just correct the wind above down to 10 m */
318  corr = wind_hgt_corr(hgt_agl);
319  datarr1[ilin][ipix] = *(u_cube + isamp + nsamp * ihgt) * corr;
320  datarr2[ilin][ipix] = *(v_cube + isamp + nsamp * ihgt) * corr;
321  break;
322  }
323  }
324  }
325  /*
326  * on with the pressure, PW, and RH
327  */
328  result = readgrib(inpress, npix, nlin, datarr3, &year, &month, &day,
329  &hour);
330 
331  if (result == 1) {
332  strcpy(message, "readgrib file: ");
333  strcat(message, inpress);
334  pexit(message);
335  }
336 
337  result = readgrib(inp_water, npix, nlin, datarr4, &year, &month,
338  &day, &hour);
339 
340  if (result == 1) {
341  strcpy(message, "readgrib file: ");
342  strcat(message, inp_water);
343  pexit(message);
344  }
345 
346  result = readgrib(inrel_hum, npix, nlin, datarr5, &year, &month,
347  &day, &hour);
348 
349  if (result == 1) {
350  strcpy(message, "readgrib file: ");
351  strcat(message, inrel_hum);
352  pexit(message);
353  }
354  } else {
355  result = readgrib(in_oz, npix, nlin, datarr1, &year, &month,
356  &day, &hour);
357 
358  if (result == 1) {
359  strcpy(message, "readgrib file: ");
360  strcat(message, in_oz);
361  pexit(message);
362  }
363  }
364 
365  /*
366  *** This used to dump the GRIB array to stdout for a data check ***
367  dlat = 2.5;
368  dlon = 2.5;
369  for (i = 0; i < WPHLATSZ; i++) {
370  for (j = 0; j < WPHLONSZ; j++) {
371  printf("\nLat: %f", 90.0 - (i * dlat));
372  printf(" Lon: %f", (-180.0 + (j * dlon)));
373  printf(" %f ", datarr1[i][j]/100.0);
374  }
375  }
376  */
377 
378  /*
379  * Create outfile name
380  * Note that for grib 2 files, whole year is available already
381  */
382  if (grib_mode == GRIB_MODE_1) {
383  if (year < 70) year = year + 2000; /* 2 digit 19xx or 20xx yrs to 4 */
384  else year = year + 1900;
385  }
386 
387  if (anctyp == ANC_MET) {
388  julval = julian_(&day, &month, &year);
389  sprintf(outfilename, "N%04d%03d%02d_MET_%s_6h.hdf",
390  year, julval, hour, source_name);
391  sprintf(outfile, "%s/%s",
392  outdir, outfilename);
393  /* For SDPS' benefit! */
394  printf("%s\n", outfile);
395  } else {
396  julval = julian_(&day, &month, &year);
397  sprintf(outfilename, "S%04d%03d00%03d23_%s.OZONE",
398  year, julval, julval, source_name);
399  sprintf(outfile, "%s/%s",
400  outdir, outfilename);
401  /* For SDPS' benefit! */
402  printf("%s+%04d%03d000000000+%04d%03d235959999\n", outfile, year, julval,
403  year, julval);
404  }
405 
406 
407  /*
408  * Write HDF annotations, lat and lon SDSs
409  */
410 
411  /**** check for existing HDF ***/
412  /* WDR remove and let overwrite work
413  if (!access(outfile, F_OK)) pexit ("....output file exists");
414  */
415 
416  if ((numannarr = count_annot(annotfile)) == 0)
417  pexit("no annotations found");
418 
419  if ((xannot = (struct annotation *)
420  malloc(sizeof (struct annotation) * numannarr))
421  == NULL) pexit("malloc Annotation");
422 
423  xannot = fillenv_annot(annotfile);
424 
425  /*
426  * Determine processing time
427  */
428 
429  (void) time(&t);
430  localtm = localtime(&t);
431  pyear = localtm->tm_year;
432  if (pyear < 70) pyear = pyear + 2000; /* 2 digit 19xx or 20xx yrs to 4 */
433  else pyear = pyear + 1900;
434 
435  if (hour > 0) msec = hour * 60 * 60 * 1000;
436  else msec = 0;
437 
438  /*
439  * ------- assign metadata values to local descriptive variables ----
440  * ------- insert dates and other values to metadata array ---------
441  * ------- follow order of fillenv data file -----------------------
442  */
443 
444  for (i = 0; i < numannarr; i++) {
445 
446  /* Insert values to descr array element */
447 
448  if (!strcmp(xannot[i].label, "Product Name"))
449  sprintf(xannot[i].descr, "%s", outfilename);
450 
451  else if (!strcmp(xannot[i].label, "Processing Time"))
452  sprintf(xannot[i].descr, "%04d%03d%02d%02d%02d%03d",
453  pyear, (localtm->tm_yday + 1), localtm->tm_hour, localtm->tm_min,
454  localtm->tm_sec, 0);
455 
456  else if (!strcmp(xannot[i].label, "Input Files"))
457  if (anctyp == ANC_MET)
458  sprintf(xannot[i].descr, "%s %s %s %s %s",
459  inz_wind, inm_wind, inpress, inrel_hum, inp_water);
460  else
461  sprintf(xannot[i].descr, "%s", in_oz);
462 
463  else if (!strcmp(xannot[i].label, "Processing Control"))
464  if (anctyp == ANC_MET)
465  sprintf(xannot[i].descr, "%s %s %s %s %s %s %s %s",
466  argv[0], annotfile, inz_wind, inm_wind, inpress,
467  inrel_hum, inp_water, outdir);
468  else
469  sprintf(xannot[i].descr, "%s %s %s %s",
470  argv[0], annotfile, in_oz, outdir);
471 
472  else if (!strcmp(xannot[i].label, "Start Time"))
473  if (anctyp == ANC_MET)
474  sprintf(xannot[i].descr, "%04d%03d%02d0000000", year, julval, hour);
475  else
476  sprintf(xannot[i].descr, "%04d%03d000000000", year, julval);
477 
478  else if (!strcmp(xannot[i].label, "End Time"))
479  if (anctyp == ANC_MET)
480  sprintf(xannot[i].descr, "%04d%03d%02d0000000", year, julval, hour);
481  else
482  sprintf(xannot[i].descr, "%04d%03d230000000", year, julval);
483 
484  else if (!strcmp(xannot[i].label, "Start Year"))
485  sprintf(xannot[i].descr, "%04d", year);
486 
487  else if (!strcmp(xannot[i].label, "Start Day"))
488  sprintf(xannot[i].descr, "%03d", julval);
489 
490  else if (!strcmp(xannot[i].label, "Start Millisec"))
491  if (anctyp == ANC_MET)
492  sprintf(xannot[i].descr, "%08d", msec);
493  else
494  sprintf(xannot[i].descr, "00000000");
495 
496  else if (!strcmp(xannot[i].label, "End Year"))
497  sprintf(xannot[i].descr, "%04d", year);
498 
499  else if (!strcmp(xannot[i].label, "End Day"))
500  sprintf(xannot[i].descr, "%03d", julval);
501 
502  else if (!strcmp(xannot[i].label, "End Millisec"))
503  if (anctyp == ANC_MET)
504  sprintf(xannot[i].descr, "%08d", msec);
505  else
506  sprintf(xannot[i].descr, "82800000");
507 
508  /* WDR for ozone, modify the data type and data source*/
509  /* This should come from the metadata file
510  else if ( ( anctyp == ANC_OZONE ) &&
511  ( !strcmp(xannot[i].label, "Data Type")) )
512  sprintf(xannot[i].descr, "Ozone" );
513 
514  else if ( ( anctyp == ANC_OZONE ) &&
515  ( !strcmp(xannot[i].label, "Data Source")) )
516  sprintf(xannot[i].descr, "TOVS" );
517 
518  else if ( ( anctyp == ANC_OZONE ) &&
519  ( !strcmp(xannot[i].label, "Data Source Desc")) )
520  sprintf(xannot[i].descr, "NOAA TIROS Operational Vertical Sounder" );
521  */
522 
523  else if ((anctyp == ANC_OZONE) &&
524  (!strcmp(xannot[i].label, "Temporal Resolution")))
525  sprintf(xannot[i].descr, "12");
526 
527  /* Extract values from descr array element for program use */
528 
529  else if (!strcmp(xannot[i].label, "Northernmost Latitude"))
530  sscanf(xannot[i].descr, "%f", &nmostlat);
531 
532  else if (!strcmp(xannot[i].label, "Southernmost Latitude"))
533  sscanf(xannot[i].descr, "%f", &smostlat);
534 
535  else if (!strcmp(xannot[i].label, "Westernmost Longitude"))
536  sscanf(xannot[i].descr, "%f", &wmostlon);
537 
538  else if (!strcmp(xannot[i].label, "Easternmost Longitude"))
539  sscanf(xannot[i].descr, "%f", &emostlon);
540 
541  else if (!strcmp(xannot[i].label, "Latitude Step"))
542  sscanf(xannot[i].descr, "%f", &latstep);
543 
544  /*
545  * WDR now a variable longitude step, # rows and columns
546  */
547  else if (!strcmp(xannot[i].label, "Longitude Step")) {
548  if (anctyp == ANC_OZONE)
549  lonstep = 1.25;
550  else
551  lonstep = 2.5;
552  sprintf(xannot[i].descr, "%f", lonstep);
553  }
554  else if (!strcmp(xannot[i].label, "Number of Rows")) {
555  if (anctyp == ANC_OZONE)
556  latsz = 180;
557  else
558  latsz = nlin;
559  sprintf(xannot[i].descr, "%d", latsz);
560  }
561  else if (!strcmp(xannot[i].label, "Number of Columns")) {
562  if (anctyp == ANC_OZONE)
563  lonsz = 288;
564  else
565  lonsz = npix;
566  sprintf(xannot[i].descr, "%d", lonsz);
567  } /*
568  * SW point is different for the ozone
569  */
570  else if (!strcmp(xannot[i].label, "SW Point Latitude") &&
571  anctyp == ANC_OZONE)
572  sprintf(xannot[i].descr, "%f", -89.5);
573 
574  else if (!strcmp(xannot[i].label, "SW Point Longitude") &&
575  anctyp == ANC_OZONE)
576  sprintf(xannot[i].descr, "%f", -179.375);
577 
578  }
579 
580  /*
581  * Create HDF file
582  */
583 
584  if ((result = startHDF(outfile, &sdfid, &fid, DFACC_CREATE)) != 0)
585  pexit("Fatal error starting HDF file");
586 
587  /*
588  * Write attribute array to HDF file
589  */
590 
591  if ((result = wrtattr(sdfid, xannot, numannarr)) != 0) pexit("wrtattr");
592  free(xannot);
593 
594  /*
595  * -------- Allocate space for 2D data arrays -----------------------
596  */
597 
598  rank = 2;
599 
600  if (anctyp == ANC_MET) {
601  shape[0] = WPHLATSZ; /* lat */
602  shape[1] = WPHLONSZ; /* lon */
603  array_size = shape[0] * shape[1];
604 
605  if ((int8_SDSdataQC =
606  (int8 *) calloc(array_size, sizeof (int8))) == NULL)
607  pexit("calloc int8_SDSdataQC");
608 
609  if ((float_SDSz_wind =
610  (float32 *) malloc(sizeof (float32) * array_size)) == NULL)
611  pexit("malloc float_SDSz_wind");
612 
613  if ((float_SDSm_wind =
614  (float32 *) malloc(sizeof (float32) * array_size)) == NULL)
615  pexit("malloc float_SDSm_wind");
616 
617  if ((float_SDSpress =
618  (float32 *) malloc(sizeof (float32) * array_size)) == NULL)
619  pexit("malloc float_SDSpress");
620 
621  if ((float_SDSp_water =
622  (float32 *) malloc(sizeof (float32) * array_size)) == NULL)
623  pexit("malloc float_SDSp_water");
624 
625  if ((float_SDSrel_hum =
626  (float32 *) malloc(sizeof (float32) * array_size)) == NULL)
627  pexit("malloc float_SDSrel_hum");
628 
629  /*
630  * Process z/m_winds, press, rel_hum, p_water
631  * Shift all arrays so that 0 lon is centered, divide pressure by 100.
632  */
633 
634  l = 0;
635  for (j = 0; j < shape[0]; j++) { /* lats */
636  for (k = (shape[1] / 2); k < shape[1]; k++) { /* lons */
637  float_SDSz_wind[l] = datarr1[j][k];
638  float_SDSm_wind[l] = datarr2[j][k];
639  float_SDSpress[l] = datarr3[j][k] / 100.0;
640  float_SDSp_water[l] = datarr4[j][k];
641  float_SDSrel_hum[l] = datarr5[j][k];
642  l++; /* index counter */
643  } /* for k */
644 
645  for (k = 0; k < (shape[1] / 2); k++) { /* lons */
646  float_SDSz_wind[l] = datarr1[j][k];
647  float_SDSm_wind[l] = datarr2[j][k];
648  float_SDSpress[l] = datarr3[j][k] / 100.0;
649  float_SDSp_water[l] = datarr4[j][k];
650  float_SDSrel_hum[l] = datarr5[j][k];
651  l++; /* index counter */
652  } /* for k */
653  } /* for j */
654  } else {
655  shape[0] = OZLATSZ; /* lat */
656  shape[1] = OZLONSZ; /* lon */
657  array_size = shape[0] * shape[1];
658 
659  if ((int8_SDSdataQC =
660  (int8 *) calloc(array_size, sizeof (int8))) == NULL)
661  pexit("calloc int8_SDSdataQC");
662 
663  if ((float_SDS_oz =
664  (int16 *) malloc(sizeof (int16) * WPHLATSZ * WPHLONSZ)) == NULL)
665  pexit("malloc float_SDS_oz");
666 
667  if ((oz_newsiz =
668  (int16 *) malloc(sizeof (int16) * array_size)) == NULL)
669  pexit("malloc oz_newsiz");
670 
671  /*
672  * Process ozone the same way here
673  */
674  l = 0;
675  for (j = 0; j < WPHLATSZ; j++) { /* lats */
676  for (k = (WPHLONSZ / 2); k < WPHLONSZ; k++) { /* lons */
677  if (datarr1[j][k] < 0 || datarr1[j][k] > SHRT_MAX)
678  float_SDS_oz[l] = 0;
679  else
680  float_SDS_oz[l] = (int16) datarr1[j][k];
681  l++; /* index counter */
682  } /* for k */
683 
684  for (k = 0; k < (WPHLONSZ / 2); k++) { /* lons */
685  if (datarr1[j][k] < 0 || datarr1[j][k] > SHRT_MAX)
686  float_SDS_oz[l] = 0;
687  else
688  float_SDS_oz[l] = (int16) datarr1[j][k];
689  l++; /* index counter */
690  } /* for k */
691  } /* for j */
692 
693  /*
694  * interpolate the array to the traditional TOVS ozone size
695  */
696  resize_oz((short *) float_SDS_oz, WPHLONSZ, WPHLATSZ,
697  OZLONSZ, OZLATSZ, (short *) oz_newsiz);
698  }
699 
700  /*
701  * ----------------- Create Vgroup ----------------------------
702  */
703 
704  gridid = setupGrid(fid, VGROUPNAME);
705 
706  if (anctyp == ANC_MET) {
707  /*
708  * ----------------- Write z_wind SDS ----------------------------
709  */
710 
711 
712  sdsname = "z_wind";
713  strcpy(longname, "Zonal wind at 10 m");
714  units = "m sec^-1";
715  datafmt = "float32";
716  datatype = DFNT_FLOAT32;
717 
718  if ((SDSinFile(sdsname, longname, units, datafmt,
719  datatype, sdfid, rank, shape,
720  float_SDSz_wind, gridid)) != 0)
721  pexit("SDSinFile z_wind");
722 
723  free(float_SDSz_wind);
724 
725  /*
726  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
727  */
728 
729  sdsname = "z_wind_QC";
730  strcpy(longname, "Zonal wind at 10 m Q/C flag");
731  units = "";
732  datafmt = "int8";
733  datatype = DFNT_INT8;
734 
735  if ((SDSinFile(sdsname, longname, units, datafmt,
736  datatype, sdfid, rank, shape,
737  int8_SDSdataQC, gridid)) != 0)
738  pexit("SDSinFile z_wind_QC");
739 
740 
741  /*
742  * ----------------- Write m_wind SDS ----------------------------
743  */
744 
745  sdsname = "m_wind";
746  strcpy(longname, "Meridional wind at 10 m");
747  units = "m sec^-1";
748  datafmt = "float32";
749  datatype = DFNT_FLOAT32;
750 
751  if ((SDSinFile(sdsname, longname, units, datafmt,
752  datatype, sdfid, rank, shape,
753  float_SDSm_wind, gridid)) != 0)
754  pexit("SDSinFile m_wind");
755 
756  free(float_SDSm_wind);
757 
758  /*
759  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
760  */
761 
762  sdsname = "m_wind_QC";
763  strcpy(longname, "Meridional wind at 10 m Q/C flag");
764  units = "";
765  datafmt = "int8";
766  datatype = DFNT_INT8;
767 
768  if ((SDSinFile(sdsname, longname, units, datafmt,
769  datatype, sdfid, rank, shape,
770  int8_SDSdataQC, gridid)) != 0)
771  pexit("SDSinFile m_wind_QC");
772 
773  /*
774  * ----------------- Write pressure SDS ----------------------------
775  */
776 
777 
778  sdsname = "press";
779  strcpy(longname, "Atmospheric pressure at mean sea level");
780  units = "millibars";
781  datafmt = "float32";
782  datatype = DFNT_FLOAT32;
783 
784  if ((SDSinFile(sdsname, longname, units, datafmt,
785  datatype, sdfid, rank, shape,
786  float_SDSpress, gridid)) != 0)
787  pexit("SDSinFile press");
788 
789  free(float_SDSpress);
790 
791  /*
792  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
793  */
794 
795  sdsname = "press_QC";
796  strcpy(longname, "Atmospheric pressure at mean sea level Q/C flag");
797  units = "";
798  datafmt = "int8";
799  datatype = DFNT_INT8;
800 
801  if ((SDSinFile(sdsname, longname, units, datafmt,
802  datatype, sdfid, rank, shape,
803  int8_SDSdataQC, gridid)) != 0)
804  pexit("SDSinFile press_QC");
805 
806  /*
807  * ----------------- Write humidity SDS ----------------------------
808  */
809 
810  sdsname = "rel_hum";
811  strcpy(longname, "Relative humidity at 1000 mb");
812  units = "percent";
813  datafmt = "float32";
814  datatype = DFNT_FLOAT32;
815 
816  if ((SDSinFile(sdsname, longname, units, datafmt,
817  datatype, sdfid, rank, shape,
818  float_SDSrel_hum, gridid)) != 0)
819  pexit("SDSinFile rel_hum");
820 
821  free(float_SDSrel_hum);
822 
823  /*
824  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
825  */
826 
827  sdsname = "rel_hum_QC";
828  strcpy(longname, "Relative humidity at 1000 mb Q/C flag");
829  units = "";
830  datafmt = "int8";
831  datatype = DFNT_INT8;
832 
833  if ((SDSinFile(sdsname, longname, units, datafmt,
834  datatype, sdfid, rank, shape,
835  int8_SDSdataQC, gridid)) != 0)
836  pexit("SDSinFile rel_hum_QC");
837 
838  /*
839  * ----------------- Write precipitable water SDS ----------------------------
840  */
841 
842  sdsname = "p_water";
843  strcpy(longname, "Precipitable water");
844  units = "kg m^-2";
845  datafmt = "float32";
846  datatype = DFNT_FLOAT32;
847 
848  if ((SDSinFile(sdsname, longname, units, datafmt,
849  datatype, sdfid, rank, shape,
850  float_SDSp_water, gridid)) != 0)
851  pexit("SDSinFile p_water");
852 
853  free(float_SDSp_water);
854 
855  /*
856  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
857  */
858 
859  sdsname = "p_water_QC";
860  strcpy(longname, "Precipitable water Q/C flag");
861  units = "";
862  datafmt = "int8";
863  datatype = DFNT_INT8;
864 
865  if ((SDSinFile(sdsname, longname, units, datafmt,
866  datatype, sdfid, rank, shape,
867  int8_SDSdataQC, gridid)) != 0)
868  pexit("SDSinFile p_water_QC");
869  } else {
870  /*
871  * ----------------- Write ozone SDS ---------------------------- */
872 
873  sdsname = "ozone";
874  strcpy(longname, "Total ozone");
875  units = "Dobson units";
876  datafmt = "int16";
877  datatype = DFNT_INT16;
878 
879  if ((SDSinFile(sdsname, longname, units, datafmt,
880  datatype, sdfid, rank, shape,
881  oz_newsiz, gridid)) != 0)
882  pexit("SDSinFile ozone");
883 
884  free(float_SDS_oz);
885 
886  /*
887  * ---- Write QC flag SDS, units attribute, and add to grid Vgroup -----
888  */
889 
890  sdsname = "ozone_QC";
891  strcpy(longname, "Total ozone Q/C flag");
892  units = "";
893  datafmt = "int8";
894  datatype = DFNT_INT8;
895 
896  if ((SDSinFile(sdsname, longname, units, datafmt,
897  datatype, sdfid, rank, shape,
898  int8_SDSdataQC, gridid)) != 0)
899  pexit("SDSinFile ozone_QC");
900  }
901 
902  /*
903  * free storage for QC array (used for all products)
904  */
905 
906  free(int8_SDSdataQC);
907 
908  /*
909  * deattach HDF grid (used for all products)
910  */
911 
912  deattachHDFgrid(gridid);
913 
914  /*
915  * close HDF structures
916  */
917 
918  if ((result = closeHDFstructs(sdfid, fid)) != 0) pexit("closeHDFstructs");
919  return 0;
920 } /* main */
921 
922 int8 check_usage(int argc, char *argv[], int *anctyp, int *n_opt_arg,
923  char *source_name, int *grib_mode, char *grib2_t_str)
924 /*****************************************************************
925  File: check_usage
926 
927  Purpose: check command line arguments
928 
929  Description: check command line arguements and report proper usage
930  on argument count error or no argumnts.
931 
932  Returns: success (0) or failure(-1)
933 
934  Parameters: (in calling order)
935  Type Name I/O Description
936  ---- ---- --- -----------
937  int argc I arg count
938  char *[] argv I input arg list
939  int * anctyp O type of anc data, either
940  ANC_MET or ANC_OZONE
941  int * n_opt_arg O # option args
942  char * source_name O An alternate source (as in gbl
943  attrib source) name
944  int * grib_mode O Type of grib file the binary
945  file came from: GRIB_MODE_1 for
946  a GRIB 1 file, GRIB_MODE_2 for a
947  GRIB 2 file (NCEP std as of
948  Jan 2008)
949  char * grib2_t_str O string with time of the GRIB 2
950  data - used for setting file
951  name and attributes
952 
953  Note: This routine is custom for each program that uses it since
954  the arguments are different of course.
955 
956  Author: Brian D. Schieber, GSC, 10/93
957 
958  Mods: 10/4/93 BDS, new HDF inputs handle all 3 NCEP parms
959  W. Robinson, GSC, 4 Feb 97 changes for 5th param:rel_hum
960  W. Robinson, GSC, 18 Jun 98 add flexability to either accept
961  7 or 8 inputs for met data or 3 or 4 for ozone data
962  W. Robinson, SAIC, 12 May 2005 have optional argument -s
963  for an optional source name
964  W. Robinson, SAIC, 24 Jan 2008 add a grib mode -2 for grib 2
965  format files
966  *****************************************************************/ {
967  extern char *optarg;
968  extern int optind, optopt;
969  int c, opt_source_found, errflg;
970 
971  /*
972  * get the options first, one for the source name
973  */
974  *grib_mode = GRIB_MODE_1;
975  opt_source_found = 0;
976  errflg = 0;
977  *n_opt_arg = 0;
978  while ((c = getopt(argc, argv, ":s:2:")) != -1) {
979  switch (c) {
980  case 's':
981  strcpy(source_name, optarg);
982  opt_source_found = 1;
983  break;
984  case '2':
985  strcpy(grib2_t_str, optarg);
986  *grib_mode = GRIB_MODE_2;
987  break;
988  case ':': /* -s without operand */
989  fprintf(stderr,
990  "Option -%c requires an operand\n", optopt);
991  errflg++;
992  break;
993  case '?':
994  fprintf(stderr, "Unrecognized option: -%c\n", optopt);
995  errflg++;
996  }
997  }
998  if (!errflg) {
999  *n_opt_arg = optind;
1000  /*
1001  * for regular arguments
1002  * for the R2, met will have 6 files for u,v wind and height, a height
1003  * at sfc and then p, pw, rh and the making 22 files and the command,
1004  * metadata, making 24
1005  *
1006  */
1007  if (argc - optind == 24 || argc - optind == 25) {
1008  *anctyp = ANC_MET;
1009  if (!opt_source_found) strcpy(source_name, "NCEPR");
1010  } else if (argc - optind == 3 || argc - optind == 4) {
1011  *anctyp = ANC_OZONE;
1012  if (!opt_source_found) strcpy(source_name, "TOVS");
1013  } else {
1014  errflg++;
1015  }
1016  }
1017  if (errflg) {
1018  printf("\n\nUsage:\n");
1019  printf("\t%s <metadata> <fu 1-6> <fv 1-6> <fh 1-7> <fp>\n", argv[0]);
1020  printf("\t <fpw> <frh> [outdir] [options]\n");
1021  printf(" OR (for ozone input):\n");
1022  printf("\t%s [-s<sname>] <metadata> <oz_file> [outdir]\n", argv[0]);
1023  printf("\nWhere:\n");
1024  printf("\t<metadata>: DAAC-style HDF metadata (ASCII file)\n");
1025  printf("\t usually fillenv_met.ancnrt\n");
1026  printf("\t<fu 1-6> is 6 u wind grid binary files\n");
1027  printf("\t<fv 1-6> is 6 v wind grid binary files\n");
1028  printf("\t<fh 1-7> is 7 height files, telling the height in meters\n");
1029  printf("\t for the winds, going from 1000 mb up (to 500)\n");
1030  printf("\t The 7th height is the surface height\n");
1031  printf("\t<fp>, <fpw> <frh> are for the pressure, precip water,\n");
1032  printf("\t and relative humidity\n");
1033  printf("\tFor ozone data, only 1 input file (oz_file):\n");
1034  printf("\t (tovs_oz.dat)\n");
1035  printf("\toutdir: Optional output directory ('.' default)\n");
1036  printf("\t Options:\n");
1037  printf("\t-s <sname> Optional source name to output file with:\n");
1038  printf("\t for MET data: SYYYYDDD00_<sname>.MET, default sname = NCEPR\n");
1039  printf("\t for OZONE data: SYYYYDDD00DDD23_<sname>.OZONE, default sname = TOVS\n");
1040  printf(
1041  "\t-2 <GRIB str> Specify the -2 with the <GRIB str> to process\n");
1042  printf(
1043  "\t binary files derived from a GRIB 2 format file. The\n");
1044  printf(
1045  "\t binary files are derived using wgrib2 with the -bin \n");
1046  printf(
1047  "\t option. The <GRIB str> is a required date / time\n");
1048  printf(
1049  "\t identification string gotten using wgrib -t\n");
1050  printf(
1051  "\t (see $SWFAPP/scripts/met_ingest2.scr for full example)\n");
1052  printf("\n");
1053  exit(-1);
1054  }
1055  return (0);
1056 }
1057 
1058 float wind_hgt_corr(float hgt)
1059 /*****************************************************************
1060 
1061  wind_hgt_corr will return a correction factor to multiply by the wind at
1062  height hgt to get the wind at 10 m height
1063 
1064  It uses the power law relation from
1065  Hsu, S. A., Eric A. Meindl, and David B. Gilhousen, 1994: Determining
1066  the Power-Law Wind-Profile Exponent under Near-Neutral Stability Conditions
1067  at Sea, Applied Meteorology, Vol. 33, No. 6, June 1994.
1068  with the power reduced to 0.09
1069 
1070  Returns type: float - the multiplier to apply to the wind
1071 
1072  Parameters: (in calling order)
1073  Type Name I/O Description
1074  ---- ---- --- -----------
1075  float hgt I height in meters above the
1076  surface at which the wind is
1077  measured.
1078 
1079  Modification history:
1080  Programmer Date Description of change
1081  ---------- ---- ---------------------
1082  W. Robinson 5 Aug 2014 Original development
1083 
1084  *******************************************************************/ {
1085  if (hgt < 10.) return 1.;
1086  return (float) pow(10.0 / (double) hgt, 0.09);
1087 }
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
float * hgt
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)
int addAttr(int32_t sdsid, char *dataattr, int32_t datatype, char *dataunit)
Definition: ANCroutines.c:222
#define NULL
Definition: decode_rs.h:63
#define OZLATSZ
Definition: ancnrt_2p5.c:126
int8 check_usage(int argc, char *argv[], int *anctyp, int *n_opt_arg, char *source_name, int *grib_mode, char *grib2_t_str)
Definition: ancnrt_2p5.c:922
int32 * msec
Definition: l1_czcs_hdf.c:31
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
#define NLEV
Definition: ancnrt_2p5.c:132
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
#define GRIB_MODE_1
Definition: ancnrt_2p5.c:130
int32_t wrtsds(int32_t sdfid, int rank, int32_t *shape, int32_t datatype, char *datalabel, void *data)
HDF4 data type of the output SDS Default is DFNT_FLOAT32 Common types used DFNT_INT16
struct annotation * fillenv_annot(char *filename)
Definition: fillenv.c:15
#define GRIB_MODE_2
Definition: ancnrt_2p5.c:131
int readgrib(char *file, int npix, int nlin, float *data, int *year, int *month, int *day, int *hour)
Definition: readgrib.c:6
int deattachHDFgrid(int32_t gridid)
Definition: ANCroutines.c:267
#define ANC_MET
Definition: ancnrt_2p5.c:128
int closeHDFstructs(int32_t sdfid, int32_t fid)
Definition: ANCroutines.c:281
void pexit(char *string)
Definition: pexit.c:10
#define OZLONSZ
Definition: ancnrt_2p5.c:127
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
float wind_hgt_corr(float hgt)
Definition: ancnrt_2p5.c:1058
#define WPHLONSZ
Definition: ancnrt_2p5.c:125
#define ANC_OZONE
Definition: ancnrt_2p5.c:129
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 main(int argc, char *argv[])
Definition: ancnrt_2p5.c:134
int k
Definition: decode_rs.h:73
string outfilename
Definition: color_dtdb.py:220
#define WPHLATSZ
Definition: ancnrt_2p5.c:124
int npix
Definition: get_cmp.c:27
int startHDF(char *outfile, int32_t *sdfid, int32_t *fid, int32_t mode)
Definition: ANCroutines.c:27
#define VGROUPNAME
Definition: ancnrt_2p5.c:114