Go to the documentation of this file.
16 static size_t num_scans, num_pixels;
20 static double start_time;
21 static double end_time;
22 static double delta_time;
25 static int lonId, latId;
26 static float latFillValue =
BAD_FLT;
27 static float lonFillValue =
BAD_FLT;
40 printf(
"Opening L1C file\n");
41 status = nc_open(
file->name, NC_NOWRITE, &ncid_L1C);
43 fprintf(
stderr,
"-E- %s line %d: nc_open(%s) failed.\n",
44 __FILE__, __LINE__,
file->name);
49 status = nc_inq_dimid(ncid_L1C,
"bins_along_track", &dimid);
51 fprintf(
stderr,
"-E- Error reading bins_along_track.\n");
54 nc_inq_dimlen(ncid_L1C, dimid, &num_scans);
57 status = nc_inq_dimid(ncid_L1C,
"bins_across_track", &dimid);
59 fprintf(
stderr,
"-E- Error reading bins_across_track.\n");
62 nc_inq_dimlen(ncid_L1C, dimid, &num_pixels);
65 printf(
"L1C Ancillary Npix :%d Nlines:%d\n", (
int)num_pixels, (
int)num_scans);
70 status = nc_inq_attlen(ncid_L1C, NC_GLOBAL,
"time_coverage_start", &att_len);
74 char*
time_str = (
char *) malloc(att_len + 1);
77 status = nc_get_att_text(ncid_L1C, NC_GLOBAL,
"time_coverage_start",
time_str);
84 status = nc_inq_attlen(ncid_L1C, NC_GLOBAL,
"time_coverage_end", &att_len);
88 time_str = (
char *) malloc(att_len + 1);
91 status = nc_get_att_text(ncid_L1C, NC_GLOBAL,
"time_coverage_end",
time_str);
97 delta_time = (end_time - start_time) / num_scans;
100 status = nc_inq_varid(ncid_L1C,
"longitude", &lonId);
102 status = nc_inq_var_fill(ncid_L1C, lonId,
NULL, &lonFillValue);
104 status = nc_inq_varid(ncid_L1C,
"latitude", &latId);
106 status = nc_inq_var_fill(ncid_L1C, latId,
NULL, &latFillValue);
109 file->sd_id = ncid_L1C;
110 file->npix = num_pixels;
111 file->nscan = num_scans;
113 file->terrain_corrected = 1;
135 size_t start[] = { 0, 0, 0 };
136 size_t count[] = { 1, 1, 1 };
138 for (
int ip = 0; ip < num_pixels; ip++) {
139 l1rec->pixnum[ip] = ip;
143 l1rec->scantime = start_time + (delta_time *
line);
151 int32_t
msec = (int32_t) (secs * 1000.0);
160 count[1] = num_pixels;
167 for(
int i=0;
i<num_pixels;
i++) {
168 if(
l1rec->lat[
i] == latFillValue)
170 if(
l1rec->lon[
i] == lonFillValue)
190 printf(
"Closing L1C Ancillary file\n");
int readl1_l1c_anc(filehandle *file, int32_t line, l1str *l1rec)
void check_err(const int stat, const int line, const char *file)
int closel1_l1c_anc(filehandle *file)
int openl1_l1c_anc(filehandle *file)
double esdist_(int32_t *year, int32_t *day, int32_t *msec)
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
int time_str(short, short, int, char *)
void unix2yds(double usec, short *year, short *day, double *secs)
real *8 function esdist(iyr, iday, msec)
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
double isodate2unix(const char *isodate)