Skip to content. | Skip to navigation

Personal tools

vnir_rad_rdr.c

#include <stdio.h>
#include <stdlib.h>
#include "hdf.h" /* defines int32, intn, etc. */
#include "HdfEosDef.h" /* declares SWopen(), etc. */
#include "vnir_rad_typ.h"
#include "vnir_rad_struct.h"


/*
* This function is autogenerated by the mkezio program to read
* an AIRS swath of type "L1B_VIS_Science" from file given by the
* file_name argument into a buffer pointed to by the vnir_rad_gran
* argument. The caller owns the buffer. The entire granule
* is read -- every attribute and field, the whole lat/lon/time
* extent.
*
* Errors opening the file, etc. are fatal and cause exit(EXIT_FAILURE).
* Problems reading individual attributes or fields are reported to
* the console but do not interrupt program flow.
*/
void vnir_rad_rdr(
char * file_name, /* name of file to read */
vnir_rad_gran_t * vnir_rad_gran ) /* structured buffer to hold entire granule */
{
intn statn; /* HDF-EOS status. 0 for success */
int32 fid; /* HDF-EOS file ID */
int32 swid; /* HDF-EOS swath ID */
int32 nchar; /* Number of characters */
char swathname[256]; /* Name of swath */
int nswath; /* Number of swaths */
char * cp = 0; /* pointer to start of version # in file name */
int major = 0, minor = 0, patch = 0, subpatch = 0;
/* parts of version number */

/* Figure out version from file name */

/* skip past directories if full path is present */
cp = strrchr(file_name, '/');
if (!cp) cp = file_name;

/*
* File will look more or less like:
* AIRS.2002.09.06.125.L1B.AIRS_Rad.v4.0.6.0.PGE_Verify.T04352025159.hdf
*/
cp = strstr(cp, ".v");

if (cp) {
int nscanned = sscanf(cp, ".v%d.%d.%d.%d",
&major, &minor, &patch, &subpatch);
if (nscanned != 4)
printf("Failed to get version from file name %s starting at %s\n",
file_name, cp);
} else {
printf("Failed to get version from file name %s\n", file_name);
printf("so version number cannot be checked.\n\n");
}

/* if we did get a version number, check it */
if (major + minor + patch + subpatch) {
if (major != 5 || minor != 0 || patch != 14 || subpatch != 0) {
printf("Warning: vnir_rad file read is version %d.%d.%d.%d ",
major, minor, patch, subpatch);
printf("but reader is designed for 5.0.14.0\n");
}
}

/* Clear granule structure */
memset(vnir_rad_gran, 0, sizeof(vnir_rad_gran));

fid = SWopen(file_name, DFACC_READ);
if (fid <= 0) {
printf("Error %ld opening file %s\n", (long)fid, file_name);
exit(EXIT_FAILURE);
}

/* Get name of swath(s) */
nswath = SWinqswath(file_name, swathname, &nchar);
if (nswath != 1) {
printf("SWinqswath found %d swaths for file \"%s\". Need exactly 1\n", nswath, file_name);
exit(EXIT_FAILURE);
}

/* There's exactly one swath. Make sure it is the right one. */
if (strcmp(swathname, "L1B_VIS_Science")) {
printf("Error: bad swath name \"%s\" in file \"%s\"\n", swathname, file_name);
printf("Expected \"L1B_VIS_Science\"\n");
exit(EXIT_FAILURE);
}

/* Attach to (open) the one swath. */
swid = SWattach(fid, swathname);
if (swid <= 0) {
printf("Failed to attach to swath \"%s\" in file %s\n", swathname, file_name);
exit(EXIT_FAILURE);
}

/* Attributes */
statn = SWreadattr(swid, "VISDarkAMSUFOVCount",
(void *)&vnir_rad_gran->VISDarkAMSUFOVCount);
if (statn != 0)
printf("Error %d reading attribute VISDarkAMSUFOVCount\n", statn);

statn = SWreadattr(swid, "VISBrightAMSUFOVCount",
(void *)&vnir_rad_gran->VISBrightAMSUFOVCount);
if (statn != 0)
printf("Error %d reading attribute VISBrightAMSUFOVCount\n", statn);

statn = SWreadattr(swid, "processing_level",
(void *)vnir_rad_gran->processing_level);
if (statn != 0)
printf("Error %d reading attribute processing_level\n", statn);

statn = SWreadattr(swid, "instrument",
(void *)vnir_rad_gran->instrument);
if (statn != 0)
printf("Error %d reading attribute instrument\n", statn);

statn = SWreadattr(swid, "DayNightFlag",
(void *)vnir_rad_gran->DayNightFlag);
if (statn != 0)
printf("Error %d reading attribute DayNightFlag\n", statn);

statn = SWreadattr(swid, "AutomaticQAFlag",
(void *)vnir_rad_gran->AutomaticQAFlag);
if (statn != 0)
printf("Error %d reading attribute AutomaticQAFlag\n", statn);

statn = SWreadattr(swid, "NumTotalData",
(void *)&vnir_rad_gran->NumTotalData);
if (statn != 0)
printf("Error %d reading attribute NumTotalData\n", statn);

statn = SWreadattr(swid, "NumProcessData",
(void *)&vnir_rad_gran->NumProcessData);
if (statn != 0)
printf("Error %d reading attribute NumProcessData\n", statn);

statn = SWreadattr(swid, "NumSpecialData",
(void *)&vnir_rad_gran->NumSpecialData);
if (statn != 0)
printf("Error %d reading attribute NumSpecialData\n", statn);

statn = SWreadattr(swid, "NumBadData",
(void *)&vnir_rad_gran->NumBadData);
if (statn != 0)
printf("Error %d reading attribute NumBadData\n", statn);

statn = SWreadattr(swid, "NumMissingData",
(void *)&vnir_rad_gran->NumMissingData);
if (statn != 0)
printf("Error %d reading attribute NumMissingData\n", statn);

statn = SWreadattr(swid, "NumLandSurface",
(void *)&vnir_rad_gran->NumLandSurface);
if (statn != 0)
printf("Error %d reading attribute NumLandSurface\n", statn);

statn = SWreadattr(swid, "NumOceanSurface",
(void *)&vnir_rad_gran->NumOceanSurface);
if (statn != 0)
printf("Error %d reading attribute NumOceanSurface\n", statn);

statn = SWreadattr(swid, "node_type",
(void *)vnir_rad_gran->node_type);
if (statn != 0)
printf("Error %d reading attribute node_type\n", statn);

statn = SWreadattr(swid, "start_year",
(void *)&vnir_rad_gran->start_year);
if (statn != 0)
printf("Error %d reading attribute start_year\n", statn);

statn = SWreadattr(swid, "start_month",
(void *)&vnir_rad_gran->start_month);
if (statn != 0)
printf("Error %d reading attribute start_month\n", statn);

statn = SWreadattr(swid, "start_day",
(void *)&vnir_rad_gran->start_day);
if (statn != 0)
printf("Error %d reading attribute start_day\n", statn);

statn = SWreadattr(swid, "start_hour",
(void *)&vnir_rad_gran->start_hour);
if (statn != 0)
printf("Error %d reading attribute start_hour\n", statn);

statn = SWreadattr(swid, "start_minute",
(void *)&vnir_rad_gran->start_minute);
if (statn != 0)
printf("Error %d reading attribute start_minute\n", statn);

statn = SWreadattr(swid, "start_sec",
(void *)&vnir_rad_gran->start_sec);
if (statn != 0)
printf("Error %d reading attribute start_sec\n", statn);

statn = SWreadattr(swid, "start_orbit",
(void *)&vnir_rad_gran->start_orbit);
if (statn != 0)
printf("Error %d reading attribute start_orbit\n", statn);

statn = SWreadattr(swid, "end_orbit",
(void *)&vnir_rad_gran->end_orbit);
if (statn != 0)
printf("Error %d reading attribute end_orbit\n", statn);

statn = SWreadattr(swid, "orbit_path",
(void *)&vnir_rad_gran->orbit_path);
if (statn != 0)
printf("Error %d reading attribute orbit_path\n", statn);

statn = SWreadattr(swid, "start_orbit_row",
(void *)&vnir_rad_gran->start_orbit_row);
if (statn != 0)
printf("Error %d reading attribute start_orbit_row\n", statn);

statn = SWreadattr(swid, "end_orbit_row",
(void *)&vnir_rad_gran->end_orbit_row);
if (statn != 0)
printf("Error %d reading attribute end_orbit_row\n", statn);

statn = SWreadattr(swid, "granule_number",
(void *)&vnir_rad_gran->granule_number);
if (statn != 0)
printf("Error %d reading attribute granule_number\n", statn);

statn = SWreadattr(swid, "num_scansets",
(void *)&vnir_rad_gran->num_scansets);
if (statn != 0)
printf("Error %d reading attribute num_scansets\n", statn);

statn = SWreadattr(swid, "num_scanlines",
(void *)&vnir_rad_gran->num_scanlines);
if (statn != 0)
printf("Error %d reading attribute num_scanlines\n", statn);

statn = SWreadattr(swid, "start_Latitude",
(void *)&vnir_rad_gran->start_Latitude);
if (statn != 0)
printf("Error %d reading attribute start_Latitude\n", statn);

statn = SWreadattr(swid, "start_Longitude",
(void *)&vnir_rad_gran->start_Longitude);
if (statn != 0)
printf("Error %d reading attribute start_Longitude\n", statn);

statn = SWreadattr(swid, "start_Time",
(void *)&vnir_rad_gran->start_Time);
if (statn != 0)
printf("Error %d reading attribute start_Time\n", statn);

statn = SWreadattr(swid, "end_Latitude",
(void *)&vnir_rad_gran->end_Latitude);
if (statn != 0)
printf("Error %d reading attribute end_Latitude\n", statn);

statn = SWreadattr(swid, "end_Longitude",
(void *)&vnir_rad_gran->end_Longitude);
if (statn != 0)
printf("Error %d reading attribute end_Longitude\n", statn);

statn = SWreadattr(swid, "end_Time",
(void *)&vnir_rad_gran->end_Time);
if (statn != 0)
printf("Error %d reading attribute end_Time\n", statn);

statn = SWreadattr(swid, "eq_x_longitude",
(void *)&vnir_rad_gran->eq_x_longitude);
if (statn != 0)
printf("Error %d reading attribute eq_x_longitude\n", statn);

statn = SWreadattr(swid, "eq_x_tai",
(void *)&vnir_rad_gran->eq_x_tai);
if (statn != 0)
printf("Error %d reading attribute eq_x_tai\n", statn);

statn = SWreadattr(swid, "orbitgeoqa",
(void *)&vnir_rad_gran->orbitgeoqa);
if (statn != 0)
printf("Error %d reading attribute orbitgeoqa\n", statn);

statn = SWreadattr(swid, "num_satgeoqa",
(void *)&vnir_rad_gran->num_satgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_satgeoqa\n", statn);

statn = SWreadattr(swid, "num_glintgeoqa",
(void *)&vnir_rad_gran->num_glintgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_glintgeoqa\n", statn);

statn = SWreadattr(swid, "num_moongeoqa",
(void *)&vnir_rad_gran->num_moongeoqa);
if (statn != 0)
printf("Error %d reading attribute num_moongeoqa\n", statn);

statn = SWreadattr(swid, "num_ftptgeoqa",
(void *)&vnir_rad_gran->num_ftptgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_ftptgeoqa\n", statn);

statn = SWreadattr(swid, "num_zengeoqa",
(void *)&vnir_rad_gran->num_zengeoqa);
if (statn != 0)
printf("Error %d reading attribute num_zengeoqa\n", statn);

statn = SWreadattr(swid, "num_demgeoqa",
(void *)&vnir_rad_gran->num_demgeoqa);
if (statn != 0)
printf("Error %d reading attribute num_demgeoqa\n", statn);

statn = SWreadattr(swid, "num_fpe",
(void *)&vnir_rad_gran->num_fpe);
if (statn != 0)
printf("Error %d reading attribute num_fpe\n", statn);

statn = SWreadattr(swid, "LonGranuleCen",
(void *)&vnir_rad_gran->LonGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LonGranuleCen\n", statn);

statn = SWreadattr(swid, "LatGranuleCen",
(void *)&vnir_rad_gran->LatGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LatGranuleCen\n", statn);

statn = SWreadattr(swid, "LocTimeGranuleCen",
(void *)&vnir_rad_gran->LocTimeGranuleCen);
if (statn != 0)
printf("Error %d reading attribute LocTimeGranuleCen\n", statn);

statn = SWreadattr(swid, "VegMapFileName",
(void *)vnir_rad_gran->VegMapFileName);
if (statn != 0)
printf("Error %d reading attribute VegMapFileName\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.red_lo_limit",
(void *)&vnir_rad_gran->limit_vis_det_temp.red_lo_limit);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.red_lo_limit\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.red_lo_cnt",
(void *)&vnir_rad_gran->limit_vis_det_temp.red_lo_cnt);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.red_lo_cnt\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.to_red_lo",
(void *)&vnir_rad_gran->limit_vis_det_temp.to_red_lo);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.to_red_lo\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.yellow_lo_limit",
(void *)&vnir_rad_gran->limit_vis_det_temp.yellow_lo_limit);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.yellow_lo_limit\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.yellow_lo_cnt",
(void *)&vnir_rad_gran->limit_vis_det_temp.yellow_lo_cnt);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.yellow_lo_cnt\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.to_yellow_lo",
(void *)&vnir_rad_gran->limit_vis_det_temp.to_yellow_lo);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.to_yellow_lo\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.green_cnt",
(void *)&vnir_rad_gran->limit_vis_det_temp.green_cnt);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.green_cnt\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.to_green",
(void *)&vnir_rad_gran->limit_vis_det_temp.to_green);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.to_green\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.yellow_hi_limit",
(void *)&vnir_rad_gran->limit_vis_det_temp.yellow_hi_limit);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.yellow_hi_limit\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.yellow_hi_cnt",
(void *)&vnir_rad_gran->limit_vis_det_temp.yellow_hi_cnt);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.yellow_hi_cnt\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.to_yellow_hi",
(void *)&vnir_rad_gran->limit_vis_det_temp.to_yellow_hi);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.to_yellow_hi\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.red_hi_limit",
(void *)&vnir_rad_gran->limit_vis_det_temp.red_hi_limit);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.red_hi_limit\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.red_hi_cnt",
(void *)&vnir_rad_gran->limit_vis_det_temp.red_hi_cnt);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.red_hi_cnt\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.to_red_hi",
(void *)&vnir_rad_gran->limit_vis_det_temp.to_red_hi);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.to_red_hi\n", statn);

statn = SWreadattr(swid, "limit_vis_det_temp.missing",
(void *)&vnir_rad_gran->limit_vis_det_temp.missing);
if (statn != 0)
printf("Error %d reading attribute limit_vis_det_temp.missing\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.min",
(void *)&vnir_rad_gran->input_vis_det_temp.min);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.min\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.max",
(void *)&vnir_rad_gran->input_vis_det_temp.max);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.max\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.mean",
(void *)&vnir_rad_gran->input_vis_det_temp.mean);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.mean\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.dev",
(void *)&vnir_rad_gran->input_vis_det_temp.dev);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.dev\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.num_in",
(void *)&vnir_rad_gran->input_vis_det_temp.num_in);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.num_in\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.num_lo",
(void *)&vnir_rad_gran->input_vis_det_temp.num_lo);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.num_lo\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.num_hi",
(void *)&vnir_rad_gran->input_vis_det_temp.num_hi);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.num_hi\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.num_bad",
(void *)&vnir_rad_gran->input_vis_det_temp.num_bad);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.num_bad\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.range_min",
(void *)&vnir_rad_gran->input_vis_det_temp.range_min);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.range_min\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.range_max",
(void *)&vnir_rad_gran->input_vis_det_temp.range_max);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.range_max\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.missing",
(void *)&vnir_rad_gran->input_vis_det_temp.missing);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.missing\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.max_track",
(void *)&vnir_rad_gran->input_vis_det_temp.max_track);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.max_track\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.max_xtrack",
(void *)&vnir_rad_gran->input_vis_det_temp.max_xtrack);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.max_xtrack\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.min_track",
(void *)&vnir_rad_gran->input_vis_det_temp.min_track);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.min_track\n", statn);

statn = SWreadattr(swid, "input_vis_det_temp.min_xtrack",
(void *)&vnir_rad_gran->input_vis_det_temp.min_xtrack);
if (statn != 0)
printf("Error %d reading attribute input_vis_det_temp.min_xtrack\n", statn);

statn = SWreadattr(swid, "granules_present",
(void *)vnir_rad_gran->granules_present);
if (statn != 0)
printf("Error %d reading attribute granules_present\n", statn);

statn = SWreadattr(swid, "align_1_2_nadir",
(void *)&vnir_rad_gran->align_1_2_nadir);
if (statn != 0)
printf("Error %d reading attribute align_1_2_nadir\n", statn);

statn = SWreadattr(swid, "align_2_3_nadir",
(void *)&vnir_rad_gran->align_2_3_nadir);
if (statn != 0)
printf("Error %d reading attribute align_2_3_nadir\n", statn);

statn = SWreadattr(swid, "align_2_4_nadir",
(void *)&vnir_rad_gran->align_2_4_nadir);
if (statn != 0)
printf("Error %d reading attribute align_2_4_nadir\n", statn);

statn = SWreadattr(swid, "align_1_2_maxang",
(void *)&vnir_rad_gran->align_1_2_maxang);
if (statn != 0)
printf("Error %d reading attribute align_1_2_maxang\n", statn);

statn = SWreadattr(swid, "align_2_3_maxang",
(void *)&vnir_rad_gran->align_2_3_maxang);
if (statn != 0)
printf("Error %d reading attribute align_2_3_maxang\n", statn);

statn = SWreadattr(swid, "align_2_4_maxang",
(void *)&vnir_rad_gran->align_2_4_maxang);
if (statn != 0)
printf("Error %d reading attribute align_2_4_maxang\n", statn);

statn = SWreadattr(swid, "align_vis_airs",
(void *)&vnir_rad_gran->align_vis_airs);
if (statn != 0)
printf("Error %d reading attribute align_vis_airs\n", statn);


/* Geolocation fields */
statn = SWreadfield(swid, "Latitude", NULL, NULL, NULL,
(void *)&vnir_rad_gran->Latitude[0][0]);
if (statn != 0)
printf("Error %d reading field Latitude\n", statn);

statn = SWreadfield(swid, "Longitude", NULL, NULL, NULL,
(void *)&vnir_rad_gran->Longitude[0][0]);
if (statn != 0)
printf("Error %d reading field Longitude\n", statn);

statn = SWreadfield(swid, "Time", NULL, NULL, NULL,
(void *)&vnir_rad_gran->Time[0][0]);
if (statn != 0)
printf("Error %d reading field Time\n", statn);


/* Data Fields */
statn = SWreadfield(swid, "radiances", NULL, NULL, NULL,
(void *)&vnir_rad_gran->radiances[0][0][0][0][0]);
if (statn != 0)
printf("Error %d reading field radiances\n", statn);

statn = SWreadfield(swid, "offset", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset[0][0][0]);
if (statn != 0)
printf("Error %d reading field offset\n", statn);

statn = SWreadfield(swid, "offset_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_err[0][0][0]);
if (statn != 0)
printf("Error %d reading field offset_err\n", statn);

statn = SWreadfield(swid, "NeN", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN[0][0][0]);
if (statn != 0)
printf("Error %d reading field NeN\n", statn);

statn = SWreadfield(swid, "PrelimCldQA", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimCldQA[0][0]);
if (statn != 0)
printf("Error %d reading field PrelimCldQA\n", statn);

statn = SWreadfield(swid, "PrelimCldFracVis", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimCldFracVis[0][0]);
if (statn != 0)
printf("Error %d reading field PrelimCldFracVis\n", statn);

statn = SWreadfield(swid, "PrelimCldFracVisErr", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimCldFracVisErr[0][0]);
if (statn != 0)
printf("Error %d reading field PrelimCldFracVisErr\n", statn);

statn = SWreadfield(swid, "PrelimClrFracVis", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimClrFracVis[0][0]);
if (statn != 0)
printf("Error %d reading field PrelimClrFracVis\n", statn);

statn = SWreadfield(swid, "PrelimClrFracVisErr", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimClrFracVisErr[0][0]);
if (statn != 0)
printf("Error %d reading field PrelimClrFracVisErr\n", statn);

statn = SWreadfield(swid, "PrelimCldMapVis", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimCldMapVis[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field PrelimCldMapVis\n", statn);

statn = SWreadfield(swid, "PrelimNDVI", NULL, NULL, NULL,
(void *)&vnir_rad_gran->PrelimNDVI[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field PrelimNDVI\n", statn);

statn = SWreadfield(swid, "bright_index", NULL, NULL, NULL,
(void *)&vnir_rad_gran->bright_index[0][0]);
if (statn != 0)
printf("Error %d reading field bright_index\n", statn);

statn = SWreadfield(swid, "inhomo_index", NULL, NULL, NULL,
(void *)&vnir_rad_gran->inhomo_index[0][0]);
if (statn != 0)
printf("Error %d reading field inhomo_index\n", statn);

statn = SWreadfield(swid, "scanang", NULL, NULL, NULL,
(void *)&vnir_rad_gran->scanang[0][0]);
if (statn != 0)
printf("Error %d reading field scanang\n", statn);

statn = SWreadfield(swid, "satheight", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satheight[0]);
if (statn != 0)
printf("Error %d reading field satheight\n", statn);

statn = SWreadfield(swid, "satroll", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satroll[0]);
if (statn != 0)
printf("Error %d reading field satroll\n", statn);

statn = SWreadfield(swid, "satpitch", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satpitch[0]);
if (statn != 0)
printf("Error %d reading field satpitch\n", statn);

statn = SWreadfield(swid, "satyaw", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satyaw[0]);
if (statn != 0)
printf("Error %d reading field satyaw\n", statn);

statn = SWreadfield(swid, "satgeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satgeoqa[0]);
if (statn != 0)
printf("Error %d reading field satgeoqa\n", statn);

statn = SWreadfield(swid, "glintgeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->glintgeoqa[0]);
if (statn != 0)
printf("Error %d reading field glintgeoqa\n", statn);

statn = SWreadfield(swid, "moongeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->moongeoqa[0]);
if (statn != 0)
printf("Error %d reading field moongeoqa\n", statn);

statn = SWreadfield(swid, "ftptgeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->ftptgeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field ftptgeoqa\n", statn);

statn = SWreadfield(swid, "zengeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->zengeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field zengeoqa\n", statn);

statn = SWreadfield(swid, "demgeoqa", NULL, NULL, NULL,
(void *)&vnir_rad_gran->demgeoqa[0][0]);
if (statn != 0)
printf("Error %d reading field demgeoqa\n", statn);

statn = SWreadfield(swid, "nadirTAI", NULL, NULL, NULL,
(void *)&vnir_rad_gran->nadirTAI[0]);
if (statn != 0)
printf("Error %d reading field nadirTAI\n", statn);

statn = SWreadfield(swid, "sat_lat", NULL, NULL, NULL,
(void *)&vnir_rad_gran->sat_lat[0]);
if (statn != 0)
printf("Error %d reading field sat_lat\n", statn);

statn = SWreadfield(swid, "sat_lon", NULL, NULL, NULL,
(void *)&vnir_rad_gran->sat_lon[0]);
if (statn != 0)
printf("Error %d reading field sat_lon\n", statn);

statn = SWreadfield(swid, "scan_node_type", NULL, NULL, NULL,
(void *)&vnir_rad_gran->scan_node_type[0]);
if (statn != 0)
printf("Error %d reading field scan_node_type\n", statn);

statn = SWreadfield(swid, "satzen", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satzen[0][0]);
if (statn != 0)
printf("Error %d reading field satzen\n", statn);

statn = SWreadfield(swid, "satazi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->satazi[0][0]);
if (statn != 0)
printf("Error %d reading field satazi\n", statn);

statn = SWreadfield(swid, "solzen", NULL, NULL, NULL,
(void *)&vnir_rad_gran->solzen[0][0]);
if (statn != 0)
printf("Error %d reading field solzen\n", statn);

statn = SWreadfield(swid, "solazi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->solazi[0][0]);
if (statn != 0)
printf("Error %d reading field solazi\n", statn);

statn = SWreadfield(swid, "glintlat", NULL, NULL, NULL,
(void *)&vnir_rad_gran->glintlat[0]);
if (statn != 0)
printf("Error %d reading field glintlat\n", statn);

statn = SWreadfield(swid, "glintlon", NULL, NULL, NULL,
(void *)&vnir_rad_gran->glintlon[0]);
if (statn != 0)
printf("Error %d reading field glintlon\n", statn);

statn = SWreadfield(swid, "sun_glint_distance", NULL, NULL, NULL,
(void *)&vnir_rad_gran->sun_glint_distance[0][0]);
if (statn != 0)
printf("Error %d reading field sun_glint_distance\n", statn);

statn = SWreadfield(swid, "topog", NULL, NULL, NULL,
(void *)&vnir_rad_gran->topog[0][0]);
if (statn != 0)
printf("Error %d reading field topog\n", statn);

statn = SWreadfield(swid, "topog_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->topog_err[0][0]);
if (statn != 0)
printf("Error %d reading field topog_err\n", statn);

statn = SWreadfield(swid, "landFrac", NULL, NULL, NULL,
(void *)&vnir_rad_gran->landFrac[0][0]);
if (statn != 0)
printf("Error %d reading field landFrac\n", statn);

statn = SWreadfield(swid, "landFrac_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->landFrac_err[0][0]);
if (statn != 0)
printf("Error %d reading field landFrac_err\n", statn);

statn = SWreadfield(swid, "ViSnsrArrTemp", NULL, NULL, NULL,
(void *)&vnir_rad_gran->ViSnsrArrTemp[0]);
if (statn != 0)
printf("Error %d reading field ViSnsrArrTemp\n", statn);

statn = SWreadfield(swid, "ScHeadTemp1", NULL, NULL, NULL,
(void *)&vnir_rad_gran->ScHeadTemp1[0]);
if (statn != 0)
printf("Error %d reading field ScHeadTemp1\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.red_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.red_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.red_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.red_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.red_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.red_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.to_red_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.to_red_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.to_red_lo\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.yellow_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.yellow_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.yellow_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.yellow_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.yellow_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.yellow_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.to_yellow_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.to_yellow_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.to_yellow_lo\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.green_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.green_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.green_cnt\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.to_green", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.to_green[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.to_green\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.yellow_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.yellow_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.yellow_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.yellow_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.yellow_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.yellow_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.to_yellow_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.to_yellow_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.to_yellow_hi\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.red_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.red_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.red_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.red_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.red_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.red_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.to_red_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.to_red_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.to_red_hi\n", statn);

statn = SWreadfield(swid, "limit_scene_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_scene_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field limit_scene_counts.missing\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.red_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.red_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.red_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.red_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.red_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.red_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.to_red_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.to_red_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.to_red_lo\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.yellow_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.yellow_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.yellow_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.yellow_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.yellow_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.yellow_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.to_yellow_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.to_yellow_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.to_yellow_lo\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.green_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.green_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.green_cnt\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.to_green", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.to_green[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.to_green\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.yellow_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.yellow_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.yellow_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.yellow_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.yellow_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.yellow_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.to_yellow_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.to_yellow_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.to_yellow_hi\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.red_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.red_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.red_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.red_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.red_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.red_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.to_red_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.to_red_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.to_red_hi\n", statn);

statn = SWreadfield(swid, "limit_bb_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_bb_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field limit_bb_counts.missing\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.red_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.red_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.red_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.red_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.red_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.red_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.to_red_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.to_red_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.to_red_lo\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.yellow_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.yellow_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.yellow_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.yellow_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.yellow_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.yellow_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.to_yellow_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.to_yellow_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.to_yellow_lo\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.green_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.green_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.green_cnt\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.to_green", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.to_green[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.to_green\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.yellow_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.yellow_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.yellow_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.yellow_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.yellow_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.yellow_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.to_yellow_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.to_yellow_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.to_yellow_hi\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.red_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.red_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.red_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.red_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.red_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.red_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.to_red_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.to_red_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.to_red_hi\n", statn);

statn = SWreadfield(swid, "limit_phot_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_phot_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field limit_phot_counts.missing\n", statn);

statn = SWreadfield(swid, "input_scene_counts.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.min[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.min\n", statn);

statn = SWreadfield(swid, "input_scene_counts.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.max[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.max\n", statn);

statn = SWreadfield(swid, "input_scene_counts.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.mean[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.mean\n", statn);

statn = SWreadfield(swid, "input_scene_counts.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.dev[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.dev\n", statn);

statn = SWreadfield(swid, "input_scene_counts.num_in", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.num_in[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.num_in\n", statn);

statn = SWreadfield(swid, "input_scene_counts.num_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.num_lo[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.num_lo\n", statn);

statn = SWreadfield(swid, "input_scene_counts.num_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.num_hi[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.num_hi\n", statn);

statn = SWreadfield(swid, "input_scene_counts.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.num_bad\n", statn);

statn = SWreadfield(swid, "input_scene_counts.range_min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.range_min[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.range_min\n", statn);

statn = SWreadfield(swid, "input_scene_counts.range_max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.range_max[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.range_max\n", statn);

statn = SWreadfield(swid, "input_scene_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.missing\n", statn);

statn = SWreadfield(swid, "input_scene_counts.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.max_track\n", statn);

statn = SWreadfield(swid, "input_scene_counts.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.max_xtrack\n", statn);

statn = SWreadfield(swid, "input_scene_counts.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.min_track\n", statn);

statn = SWreadfield(swid, "input_scene_counts.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_scene_counts.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_scene_counts.min_xtrack\n", statn);

statn = SWreadfield(swid, "input_bb_counts.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.min[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.min\n", statn);

statn = SWreadfield(swid, "input_bb_counts.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.max[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.max\n", statn);

statn = SWreadfield(swid, "input_bb_counts.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.mean[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.mean\n", statn);

statn = SWreadfield(swid, "input_bb_counts.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.dev[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.dev\n", statn);

statn = SWreadfield(swid, "input_bb_counts.num_in", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.num_in[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.num_in\n", statn);

statn = SWreadfield(swid, "input_bb_counts.num_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.num_lo[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.num_lo\n", statn);

statn = SWreadfield(swid, "input_bb_counts.num_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.num_hi[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.num_hi\n", statn);

statn = SWreadfield(swid, "input_bb_counts.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.num_bad\n", statn);

statn = SWreadfield(swid, "input_bb_counts.range_min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.range_min[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.range_min\n", statn);

statn = SWreadfield(swid, "input_bb_counts.range_max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.range_max[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.range_max\n", statn);

statn = SWreadfield(swid, "input_bb_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.missing\n", statn);

statn = SWreadfield(swid, "input_bb_counts.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.max_track\n", statn);

statn = SWreadfield(swid, "input_bb_counts.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.max_xtrack\n", statn);

statn = SWreadfield(swid, "input_bb_counts.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.min_track\n", statn);

statn = SWreadfield(swid, "input_bb_counts.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_bb_counts.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_bb_counts.min_xtrack\n", statn);

statn = SWreadfield(swid, "input_phot_counts.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.min[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.min\n", statn);

statn = SWreadfield(swid, "input_phot_counts.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.max[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.max\n", statn);

statn = SWreadfield(swid, "input_phot_counts.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.mean[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.mean\n", statn);

statn = SWreadfield(swid, "input_phot_counts.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.dev[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.dev\n", statn);

statn = SWreadfield(swid, "input_phot_counts.num_in", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.num_in[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.num_in\n", statn);

statn = SWreadfield(swid, "input_phot_counts.num_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.num_lo[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.num_lo\n", statn);

statn = SWreadfield(swid, "input_phot_counts.num_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.num_hi[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.num_hi\n", statn);

statn = SWreadfield(swid, "input_phot_counts.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.num_bad\n", statn);

statn = SWreadfield(swid, "input_phot_counts.range_min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.range_min[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.range_min\n", statn);

statn = SWreadfield(swid, "input_phot_counts.range_max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.range_max[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.range_max\n", statn);

statn = SWreadfield(swid, "input_phot_counts.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.missing[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.missing\n", statn);

statn = SWreadfield(swid, "input_phot_counts.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.max_track\n", statn);

statn = SWreadfield(swid, "input_phot_counts.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.max_xtrack\n", statn);

statn = SWreadfield(swid, "input_phot_counts.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.min_track\n", statn);

statn = SWreadfield(swid, "input_phot_counts.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->input_phot_counts.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field input_phot_counts.min_xtrack\n", statn);

statn = SWreadfield(swid, "limit_offsets.red_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.red_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.red_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_offsets.red_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.red_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.red_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_offsets.to_red_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.to_red_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.to_red_lo\n", statn);

statn = SWreadfield(swid, "limit_offsets.yellow_lo_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.yellow_lo_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.yellow_lo_limit\n", statn);

statn = SWreadfield(swid, "limit_offsets.yellow_lo_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.yellow_lo_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.yellow_lo_cnt\n", statn);

statn = SWreadfield(swid, "limit_offsets.to_yellow_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.to_yellow_lo[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.to_yellow_lo\n", statn);

statn = SWreadfield(swid, "limit_offsets.green_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.green_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.green_cnt\n", statn);

statn = SWreadfield(swid, "limit_offsets.to_green", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.to_green[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.to_green\n", statn);

statn = SWreadfield(swid, "limit_offsets.yellow_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.yellow_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.yellow_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_offsets.yellow_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.yellow_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.yellow_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_offsets.to_yellow_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.to_yellow_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.to_yellow_hi\n", statn);

statn = SWreadfield(swid, "limit_offsets.red_hi_limit", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.red_hi_limit[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.red_hi_limit\n", statn);

statn = SWreadfield(swid, "limit_offsets.red_hi_cnt", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.red_hi_cnt[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.red_hi_cnt\n", statn);

statn = SWreadfield(swid, "limit_offsets.to_red_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.to_red_hi[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.to_red_hi\n", statn);

statn = SWreadfield(swid, "limit_offsets.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->limit_offsets.missing[0][0]);
if (statn != 0)
printf("Error %d reading field limit_offsets.missing\n", statn);

statn = SWreadfield(swid, "offset_stats.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.min[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.min\n", statn);

statn = SWreadfield(swid, "offset_stats.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.max[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.max\n", statn);

statn = SWreadfield(swid, "offset_stats.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.mean[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.mean\n", statn);

statn = SWreadfield(swid, "offset_stats.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.dev[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.dev\n", statn);

statn = SWreadfield(swid, "offset_stats.num", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.num[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.num\n", statn);

statn = SWreadfield(swid, "offset_stats.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.num_bad\n", statn);

statn = SWreadfield(swid, "offset_stats.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.max_track\n", statn);

statn = SWreadfield(swid, "offset_stats.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.max_xtrack\n", statn);

statn = SWreadfield(swid, "offset_stats.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.min_track\n", statn);

statn = SWreadfield(swid, "offset_stats.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_stats.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field offset_stats.min_xtrack\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.min[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.min\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.max[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.max\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.mean[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.mean\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.dev[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.dev\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.num", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.num[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.num\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.num_bad\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.max_track\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.max_xtrack\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.min_track\n", statn);

statn = SWreadfield(swid, "offset_unc_stats.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->offset_unc_stats.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field offset_unc_stats.min_xtrack\n", statn);

statn = SWreadfield(swid, "gain", NULL, NULL, NULL,
(void *)&vnir_rad_gran->gain[0][0]);
if (statn != 0)
printf("Error %d reading field gain\n", statn);

statn = SWreadfield(swid, "gain_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->gain_err[0][0]);
if (statn != 0)
printf("Error %d reading field gain_err\n", statn);

statn = SWreadfield(swid, "rad_stats.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.min[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.min\n", statn);

statn = SWreadfield(swid, "rad_stats.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.max[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.max\n", statn);

statn = SWreadfield(swid, "rad_stats.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.mean[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.mean\n", statn);

statn = SWreadfield(swid, "rad_stats.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.dev[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.dev\n", statn);

statn = SWreadfield(swid, "rad_stats.num", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.num[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.num\n", statn);

statn = SWreadfield(swid, "rad_stats.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.num_bad\n", statn);

statn = SWreadfield(swid, "rad_stats.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.max_track\n", statn);

statn = SWreadfield(swid, "rad_stats.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.max_xtrack\n", statn);

statn = SWreadfield(swid, "rad_stats.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.min_track\n", statn);

statn = SWreadfield(swid, "rad_stats.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->rad_stats.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field rad_stats.min_xtrack\n", statn);

statn = SWreadfield(swid, "NeN_stats.min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.min[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.min\n", statn);

statn = SWreadfield(swid, "NeN_stats.max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.max[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.max\n", statn);

statn = SWreadfield(swid, "NeN_stats.mean", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.mean[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.mean\n", statn);

statn = SWreadfield(swid, "NeN_stats.dev", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.dev[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.dev\n", statn);

statn = SWreadfield(swid, "NeN_stats.num_in", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.num_in[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.num_in\n", statn);

statn = SWreadfield(swid, "NeN_stats.num_lo", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.num_lo[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.num_lo\n", statn);

statn = SWreadfield(swid, "NeN_stats.num_hi", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.num_hi[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.num_hi\n", statn);

statn = SWreadfield(swid, "NeN_stats.num_bad", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.num_bad[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.num_bad\n", statn);

statn = SWreadfield(swid, "NeN_stats.range_min", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.range_min[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.range_min\n", statn);

statn = SWreadfield(swid, "NeN_stats.range_max", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.range_max[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.range_max\n", statn);

statn = SWreadfield(swid, "NeN_stats.missing", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.missing[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.missing\n", statn);

statn = SWreadfield(swid, "NeN_stats.max_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.max_track[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.max_track\n", statn);

statn = SWreadfield(swid, "NeN_stats.max_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.max_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.max_xtrack\n", statn);

statn = SWreadfield(swid, "NeN_stats.min_track", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.min_track[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.min_track\n", statn);

statn = SWreadfield(swid, "NeN_stats.min_xtrack", NULL, NULL, NULL,
(void *)&vnir_rad_gran->NeN_stats.min_xtrack[0][0]);
if (statn != 0)
printf("Error %d reading field NeN_stats.min_xtrack\n", statn);

statn = SWreadfield(swid, "state", NULL, NULL, NULL,
(void *)&vnir_rad_gran->state[0][0]);
if (statn != 0)
printf("Error %d reading field state\n", statn);

statn = SWreadfield(swid, "xtrack_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->xtrack_err[0]);
if (statn != 0)
printf("Error %d reading field xtrack_err\n", statn);

statn = SWreadfield(swid, "track_err", NULL, NULL, NULL,
(void *)&vnir_rad_gran->track_err[0]);
if (statn != 0)
printf("Error %d reading field track_err\n", statn);

statn = SWreadfield(swid, "OpMode", NULL, NULL, NULL,
(void *)&vnir_rad_gran->OpMode[0]);
if (statn != 0)
printf("Error %d reading field OpMode\n", statn);

statn = SWreadfield(swid, "cornerlats", NULL, NULL, NULL,
(void *)&vnir_rad_gran->cornerlats[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field cornerlats\n", statn);

statn = SWreadfield(swid, "cornerlons", NULL, NULL, NULL,
(void *)&vnir_rad_gran->cornerlons[0][0][0][0]);
if (statn != 0)
printf("Error %d reading field cornerlons\n", statn);


/* Final clean-up */
statn = SWdetach(swid);
if (statn != 0) printf("Error detaching from input file %s\n", file_name);

statn = SWclose(fid);
if (statn != 0) printf("Error closing input file %s\n", file_name);
}

Document Actions
NASA Logo - nasa.gov
NASA Privacy Policy and Important Notices
Last updated: Sep 09, 2009 02:26 PM ET
Top