Skip to content. | Skip to navigation

Personal tools

hsb_bt_rdr.c

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


/*
* This function is autogenerated by the mkezio program to read
* an AIRS swath of type "L1B_HSB" from file given by the
* file_name argument into a buffer pointed to by the hsb_bt_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 hsb_bt_rdr(
char * file_name, /* name of file to read */
hsb_bt_gran_t * hsb_bt_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: hsb_bt 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(hsb_bt_gran, 0, sizeof(hsb_bt_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_HSB")) {
printf("Error: bad swath name \"%s\" in file \"%s\"\n", swathname, file_name);
printf("Expected \"L1B_HSB\"\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, "processing_level",
(void *)hsb_bt_gran->processing_level);
if (statn != 0)
printf("Error %d reading attribute processing_level\n", statn);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

statn = SWreadfield(swid, "sat_lat", NULL, NULL, NULL,
(void *)&hsb_bt_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 *)&hsb_bt_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 *)&hsb_bt_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 *)&hsb_bt_gran->satzen[0][0]);
if (statn != 0)
printf("Error %d reading field satzen\n", statn);

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

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

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

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

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

statn = SWreadfield(swid, "sun_glint_distance", NULL, NULL, NULL,
(void *)&hsb_bt_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 *)&hsb_bt_gran->topog[0][0]);
if (statn != 0)
printf("Error %d reading field topog\n", statn);

statn = SWreadfield(swid, "topog_err", NULL, NULL, NULL,
(void *)&hsb_bt_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 *)&hsb_bt_gran->landFrac[0][0]);
if (statn != 0)
printf("Error %d reading field landFrac\n", statn);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

statn = SWreadfield(swid, "qa_channel", NULL, NULL, NULL,
(void *)&hsb_bt_gran->qa_channel[0][0]);
if (statn != 0)
printf("Error %d reading field qa_channel\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