/* * dump_pidf.c */ #ident "@(#) $Id: dump_pidf.c 22020 2012-12-05 19:42:53Z carrie $ SwRI" #include #include #include #include #include "ant.h" #include "libCfg.h" /* for CfgInit */ #include "libdb.h" /* for dbGetDataKey */ #include "libPIDF.h" #ifndef _PIDF_TBL_OPPS #define _PIDF_TBL_OPPS typedef enum { _EQ_, _ADD_, _MINUS_, _MULT_, _DIV_, _NOP_ } TBLOPS; #endif int p_errno; void PERR (int p_errno); char BackTblOpsMap( TBLOPS op ) { switch ( op ) { case _EQ_: return '='; case _ADD_: return '+'; case _MINUS_: return '-'; case _MULT_: return '*'; case _DIV_: return '/'; default:; } return '?'; } void Header (SDDAS_ULONG key, SDDAS_CHAR *ex) { SDDAS_FLOAT f1; SDDAS_CHAR string [400] = ""; int a, k, i, Int; SDDAS_INT dimen; SDDAS_CHAR C; SDDAS_CHAR **dstring; SDDAS_CHAR **sstring; SDDAS_INT *iptr, *iptr1; if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, VERSION, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "Version : %.1f\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, INSTITUTE, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Institute : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, PROJ, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Project : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, MISS, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Mission : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, EXP, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Experiment : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, INST, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Instrument : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, VINST, (void *) string))) { PERR (p_errno); } fprintf (stdout, "VInstrument : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PIDF_GROUP, NOTUSED, NOTUSED, NUMOF, (void *) &k))) { PERR (p_errno); } fprintf (stdout, "Number of Groups : %d\n", k); dstring = Challoc (k, MAX_PIDF_NAME); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PIDF_GROUP, NOTUSED, NOTUSED, NAMES, (void *) dstring))) { PERR (p_errno); } a = 0; fprintf (stdout, "Group Names :\n"); while (a < k) { fprintf (stdout, " : %s\n", dstring[a]); a++; } Ch_Free (dstring, k); for (a = 0; a < k; a++) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PIDF_GROUP, a, NOTUSED, NUMINGRP, (void *) &Int))) { PERR (p_errno); } dstring = Challoc (Int, MAX_PIDF_NAME); sstring = Challoc (Int, MAX_PIDF_NAME); iptr = (SDDAS_INT *) calloc (Int, sizeof (SDDAS_INT)); iptr1 = (SDDAS_INT *) calloc (Int, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PIDF_GROUP, a, NOTUSED, COMPNAMES, (void *) dstring))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PIDF_GROUP, a, NOTUSED, SENNAMES, (void *) sstring))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, a, NOTUSED, VIDFNUMS, (void *) iptr))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, a, NOTUSED, PIDFNUMS, (void *) iptr1))) { PERR (p_errno); } fprintf (stdout, "Number of sensors in group %d : %d\n", a, Int); for (i = 0; i < Int; i++) { fprintf (stdout, "Component %d in group %d : %s\n", i, a, dstring[i]); fprintf (stdout, "Sensor name %d in group %d : %s\n", i, a, sstring[i]); fprintf (stdout, "PIDF Sensor num %d in group %d : %d\n", i, a, iptr1[i]); fprintf (stdout, "VIDF Sensor num %d in group %d : %d\n", i, a, iptr[i]); } free (iptr); free (iptr1); Ch_Free (sstring, Int); Ch_Free (dstring, Int); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, AVG, NOTUSED, NOTUSED, DIMEN, (void *) &dimen))) { PERR (p_errno); } fprintf (stdout, "Averaging Dimension Flag : %d \n", dimen); if (_PHI_ & dimen) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PHI, NOTUSED, NOTUSED, DEPEN, (void *) &C))) { PERR (p_errno); } fprintf (stdout, "Phi Dependency Flag (Cyclic) : %c \n", C); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, CHARGE, NOTUSED, NOTUSED, START, (void *) &f1))) { fprintf (stdout, "Charge Min Max : %.3e ", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, CHARGE, NOTUSED, NOTUSED, STOP, (void *) &f1))) { fprintf (stdout, "%.3e\n", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SCAN, NOTUSED, NOTUSED, START, (void *) &f1))) { fprintf (stdout, "Scan Min Max : %.3e ", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SCAN, NOTUSED, NOTUSED, STOP, (void *) &f1))) { fprintf (stdout, "%.3e\n", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, THETA, NOTUSED, NOTUSED, START, (void *) &f1))) { fprintf (stdout, "Theta Min Max : %.3e ", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, THETA, NOTUSED, NOTUSED, STOP, (void *) &f1))) { fprintf (stdout, "%.3e\n", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, PHI, NOTUSED, NOTUSED, START, (void *) &f1))) { fprintf (stdout, "Phi Min Max : %.3e ", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, PHI, NOTUSED, NOTUSED, STOP, (void *) &f1))) { fprintf (stdout, "%.3e\n", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, MASS, NOTUSED, NOTUSED, START, (void *) &f1))) { fprintf (stdout, "Mass Min Max : %.3e ", f1); } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, MASS, NOTUSED, NOTUSED, STOP, (void *) &f1))) { fprintf (stdout, "%.3e\n", f1); } } void Binning (SDDAS_ULONG key, SDDAS_CHAR *ex) { int d, i, k, Int; SDDAS_FLOAT f1; fprintf (stdout, "\n************* BINNING *************\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, NOTUSED, NOTUSED, NSETS, (void *) &k))) { PERR (p_errno); } fprintf (stdout, "\nNumber of Bin Sets : %d\n", k); for (i = 0; i < k; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, BINMETHOD, (void *) &Int))) { PERR (p_errno); } fprintf (stdout, "\nBin Method : %d\n", Int); if (Int == 2) { /* if variable binning only */ if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, START, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "Bin Min Max : %.3e ", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, STOP, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, SPACING, (void *) &d))) { PERR (p_errno); } fprintf (stdout, "Bin Spacing Flag : %d\n", d); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, NUMOF, (void *) &Int))) { PERR (p_errno); } fprintf (stdout, "Number of Bins : %d\n", Int); } } } void Imaging (SDDAS_ULONG key, SDDAS_CHAR *ex) { char C; int i, ntbl, Int, Int1; char string[400] = ""; SDDAS_FLOAT f1, f2, f3; fprintf (stdout, "\n************* IMAGE *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGFMT, (void *) &C))) { PERR (p_errno); } fprintf (stdout, "Image Format : %c\n", C); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGTYPE, (void *) &C))) { PERR (p_errno); } fprintf (stdout, "Image Type : %c\n", C); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, NUMOF, (void *) &ntbl))) { PERR (p_errno); } for (i = 0; i < ntbl; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLATLOC, (void *) &C))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLATNUM, (void *) &Int))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLATUN, (void *) &Int1))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLATDEF, string))) { PERR (p_errno); } fprintf (stdout, "Image Lat %d Loc/Number/Unit : %c %d %d %s\n", i, C, Int, Int1, string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLONGLOC, (void *) &C))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLONGNUM, (void *) &Int))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLONGUN, (void *) &Int1))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, i, NOTUSED, IMGLONGDEF, string))) { PERR (p_errno); } fprintf (stdout, "Image Long %d Loc/Number/Unit : %c %d %d %s\n", i, C, Int, Int1, string); } /* for loop */ if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGBIN, (void *) &C))) { PERR (p_errno); } fprintf (stdout, "Image Binning Type : %c\n", C); if (C == 'G' || C == 'g') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLATMIN, (void *) &f1))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLATMAX, (void *) &f2))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLATDEL, (void *) &f3))) { PERR (p_errno); } fprintf (stdout, "Image Lat Min Max Delta : %f %f %f\n", f1, f2, f3); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLONGMIN, (void *) &f1))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLONGMAX, (void *) &f2))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGLONGDEL, (void *) &f3))) { PERR (p_errno); } fprintf (stdout, "Image Long Min Max Delta : %f %f %f\n", f1, f2, f3); } else if (C == 'T' || C == 't') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGNUMSWPS, (void *) &Int))) PERR (p_errno); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGSTORAGE, string))) PERR (p_errno); fprintf (stdout, "Image Num of Sweeps/Storage : %d %s\n" ,Int, string); } else if (C == 'N' || C == 'n') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, IMAGE, NOTUSED, NOTUSED, IMGSTORAGE, string))) PERR (p_errno); fprintf (stdout, "Image Storage : %s\n", string); } } void SensorInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int snum, unum, i, sbidx, Int, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *iptr1, *iptr2, *tptr; char *cptr, *cptr1; fprintf (stdout, "\n************* SENSOR *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, NOTUSED, NOTUSED, NUMOF, (void *) &snum))) { PERR (p_errno); } fprintf (stdout, "Number of Sensors : %d\n", snum); for (i = 0; i < snum; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, NAME, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Sensor %d Name : %s\n", i, string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, COMPNAME, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Component Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, DISPLAY, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Display Flag : %d\n", unum); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, SWPNDX, (void *) &sbidx))) { fprintf (stdout, "Scan Block Index : %d\n", sbidx); if (sbidx != -1) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, sbidx, NUNITS, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Swp Num of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); iptr1 = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); iptr2 = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); cptr = (char *) calloc ((size_t) unum + 1, sizeof (char)); cptr1 = (char *) calloc ((size_t) unum + 1, sizeof (char)); if ((p_errno = ReadPidf (key, ex, SWEEP_STEP, i, NOTUSED, UNITNUMS, (void *) iptr) != ALL_OKAY)) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, NOTUSED, UNITFMTS, cptr))) { PERR (p_errno); } for (a = 0; a < unum; a++) { if (cptr[a] == 'V') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, i, VARUNITNUMS, (void *) iptr1))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, i, VARUNITFMTS, cptr1))) { PERR (p_errno); } if (cptr1[a] == 'A' || cptr1[a] == 'a') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, i, VARUNITUBNUMS, (void *) iptr2))) { PERR (p_errno); } } } fprintf (stdout, "Swp Unit Numbers : "); fprintf (stdout, "%c %d ", cptr[a], iptr[a]); if (cptr[a] == 'V') { fprintf (stdout, "%c %d ", cptr1[a], iptr1[a]); if (cptr1[a] == 'A' || cptr1[a] == 'a') fprintf (stdout, "%d ", iptr2[a]); } fprintf (stdout, "\n"); } free (cptr); free (iptr); free (cptr1); free (iptr1); free (iptr2); } } if (ALL_OKAY == (p_errno = ReadPidf (key, ex, BIN, i, NOTUSED, NUMBININDEX, (void *) &Int))) { if (Int) { /* if any bin info */ fprintf (stdout, "\nNum Bin Indexes : %d\n", Int); iptr = (SDDAS_INT *) malloc ((size_t) Int * sizeof (SDDAS_INT)); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, BININDEX, (void *) iptr))) { fprintf (stdout, "Bin Index Number(s) : "); for (j = 0; j < Int; j++) fprintf (stdout, "%d ", iptr[j]); fprintf (stdout, "\n"); } free ((char *) iptr); /* JG */ } } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, NUNITS, (void *) &unum))) { puts ("SENSOR"); PERR (p_errno); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) malloc ((size_t) unum * sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, NOTUSED, UNITNUMS, (void *) iptr))) { puts ("SENSOR"); PERR (p_errno); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, " \n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], UNITID, (void *) &Int))) { PERR (p_errno); } fprintf (stdout, "Unit %3d Id : %d\n", iptr[j], Int); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], DEFAULTMIN, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], DEFAULTMAX, (void *) &f1))) { PERR (p_errno); } /* This is where the ERROR is */ fprintf (stdout, "%.3e\n", (double) f1); /******************************/ if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], SCALING, (void *) &ch))) { PERR (p_errno); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], UNITLAB, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], LONGDESC, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], SHORTDESC, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SENSOR, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } fprintf (stdout, "\n"); } fprintf (stdout, "\n"); } free ((char *) iptr); } /* for unit num */ } void ScanInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i, j, ch, snums; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *iptr1, *iptr2, *tptr; char *cptr, *cptr1; fprintf (stdout, "************* SCAN *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, NOTUSED, NOTUSED, NUMOF, (void *) &snums))) { PERR (p_errno); } fprintf (stdout, "Number of scans : %d\n", snums); for (i = 0; i < snums; i++) { fprintf (stdout, "Scan Number %d :\n", i); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SCAN_DATA, i, NOTUSED, NUNITS, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); iptr1 = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); iptr2 = (SDDAS_INT *) calloc ((size_t) unum + 1, sizeof (SDDAS_INT)); cptr = (char *) calloc ((size_t) unum + 1, sizeof (char)); cptr1 = (char *) calloc ((size_t) unum + 1, sizeof (char)); a = 0; while (a < unum) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SCAN_DATA, i, a, UNITNUMS, (void *) iptr))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SCAN_DATA, i, a, UNITFMTS, (void *) cptr))) { PERR (p_errno); } if (cptr [a] == 'V') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, a, VARUNITNUM, (void *) &iptr1 [a]))) { PERR (p_errno); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, a, VARUNITFMT, (void *) &cptr1 [a]))) { PERR (p_errno); } if (cptr1[a] == 'A' || cptr1[a] == 'a') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, a, VARUNITUBNUM, (void *) &iptr2 [a]))) { PERR (p_errno); } } } fprintf (stdout, "Unit Numbers : "); fprintf (stdout, "%c %d ", cptr[a], iptr[a]); if (cptr[a] == 'V') { fprintf (stdout, "%c %d ", cptr1[a], iptr1[a]); if (cptr1[a] == 'A' || cptr1[a] == 'a') fprintf (stdout, "%d ", iptr2[a]); } ++a; fprintf (stdout, "\n"); } for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], DEFAULTMIN, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], DEFAULTMAX, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], SCALING, (void *) &ch))) { PERR (p_errno); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], UNITLAB, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], LONGDESC, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], SHORTDESC, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SWEEP_STEP, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } fprintf (stdout, "\n"); } } /* for unit num */ free ((char *) iptr); free ((char *) iptr1); free ((char *) iptr2); free ((char *) cptr); free ((char *) cptr1); puts ("\n"); } } void CalibrationInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int snum, unum, i, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char modify, src_flag; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* CAL SETS *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, NOTUSED, NOTUSED, NUMOF, (void *) &snum))) { puts ("failure"); } fprintf (stdout, "Number of Cal Sets : %d\n\n", snum); for (i = 0; i < snum; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, NAME, (void *) string))) { puts ("failure"); } fprintf (stdout, "Long Cal Set Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, SHORTNAME, (void *) string))) { puts ("failure"); } fprintf (stdout, "Short Cal Set Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, SRCFLAG, (void *) &src_flag))) { PERR (p_errno); } fprintf (stdout, "Cal Source Flag : %c\n", src_flag); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, VIDFNUM, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Cal Set Number : %d\n", unum); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, MODIFY, (void *) &modify))) { PERR (p_errno); } fprintf (stdout, "Cals modify the sensor data : %c\n", modify); if (modify == 'Y') { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, NSETS, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Number of Sen Sets : %d\n", unum); if (unum > 0) { iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, SENSETS, (void *) iptr))) { PERR (p_errno); } a = 0; fprintf (stdout, "Sen Set Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); puts (" "); free ((char *) iptr); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, NUNITS, (void *) &unum))) { puts ("failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, NOTUSED, UNITNUMS, (void *) iptr))) { puts ("failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); puts ("\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], DEFAULTMIN, (void *) &f1))) { puts ("failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], DEFAULTMAX, (void *) &f1))) { puts ("failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], SCALING, (void *) &ch))) { puts ("failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], UNITLAB, (void *) string))) { puts ("failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], LONGDESC, (void *) string))) { puts ("failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], SHORTDESC, (void *) string))) { puts ("failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { PERR (p_errno); } fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, CAL_DATA, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } fprintf (stdout, "\n"); } /* for unit num */ free ((char *) iptr); puts ("\n"); } } } } void ModeInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int snum, unum, i, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* MODE *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, NOTUSED, NOTUSED, NUMOF, (void *) &snum))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Number of Modes : %d\n", snum); for (i = 0; i < snum; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Long Mode Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Short Mode Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, NOTUSED, VIDFNUM, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Mode Number : %d\n", unum); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure\n"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure\n"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MODE, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } /* for unit num */ free ((char *) iptr); } fprintf (stdout, "\n"); } void DataQualInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* D_QUAL *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Data Quality Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Data Quality Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, D_QUAL, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); fprintf (stdout, "\n"); } void PitchAngleInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* PITCH_ANGLE *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Pitch Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Pitch Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, PITCH_ANGLE, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); fprintf (stdout, "\n"); } void SpinAngleInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* SPIN_ANGLE *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Spin Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Spin Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, START_AZ_ANGLE, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); fprintf (stdout, "\n"); } void StopAzAngleInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* STOP_AZ_ANGLE *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Stop Azimuthal Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Stop Azimuthal Angle Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, STOP_AZ_ANGLE, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); fprintf (stdout, "\n"); } void SCPotentialInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* SC_POTENTIAL ************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long S/C Potential Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short S/C Potential Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); unum = 0; if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, NUNITSUSEP, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Num of units that use potential data : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, SC_POTENTIAL, i, NOTUSED, USEDUNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Used In Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); free ((char *) iptr); fprintf (stdout, "\n"); } void BackgroundInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, i = 0, j, ch; int a, ntbl, q; SDDAS_FLOAT f1; char string[400] = ""; SDDAS_INT *iptr, *tptr; fprintf (stdout, "************* BACKGROUND ************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, NOTUSED, NAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Background Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, NOTUSED, SHORTNAME, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Background Name : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, NOTUSED, NUNITS, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Number of units : %d\n", unum); iptr = (SDDAS_INT *) calloc ((size_t) unum, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, NOTUSED, UNITNUMS, (void *) iptr))) { fprintf (stdout, "failure"); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); fprintf (stdout, "\n"); for (j = 0; j < unum; ++j) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], DEFAULTMIN, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit %3d Min Max : %.3e ", iptr[j], f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], DEFAULTMAX, (void *) &f1))) { fprintf (stdout, "failure"); } fprintf (stdout, "%.3e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], SCALING, (void *) &ch))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Scaling : %d\n", ch); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], UNITLAB, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Unit Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], LONGDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Long Description Label : %s\n", string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], SHORTDESC, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Short Description Label : %s\n", string); if (ALL_OKAY == (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], NUMTBLAPP, (void *) &ntbl))) { fprintf (stdout, "Num of Table Application Flags : %d\n", ntbl); if (ntbl > 0) { tptr = (SDDAS_INT *) calloc ((size_t) ntbl, sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], TABLEAPP, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "Table Application Flags : %d ", tptr[0]); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%d ", tptr[q]); } if (ALL_OKAY != (p_errno = ReadPidf (key, ex, BACKGROUND, i, iptr[j], TBLAPPOPS, (void *) tptr))) { PERR (p_errno); } fprintf (stdout, "\nTable Application Opers : %c ", BackTblOpsMap (tptr[0])); for (q = 1; q < ntbl; ++q) { fprintf (stdout, "%c ", BackTblOpsMap (tptr[q])); } fprintf (stdout, "\n"); free ((char *) tptr); } } fprintf (stdout, "\n"); } free ((char *) iptr); fprintf (stdout, "\n"); } void MomentsInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int inum, mom_def; SDDAS_FLOAT f1; fprintf (stdout, "************* MOMENTS *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MOMENTS, NOTUSED, NOTUSED, MOMENTSDEF, (void *) &mom_def))) { PERR (p_errno); } fprintf (stdout, "Moments Defined : %d\n", mom_def); if (mom_def == 1) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MOMENTS, NOTUSED, NOTUSED, MOMENTMASS, (void *) &f1))) { PERR (p_errno); } fprintf (stdout, "Moments Mass : %.2e\n", f1); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MOMENTS, NOTUSED, NOTUSED, VUNIT, (void *) &inum))) { PERR (p_errno); } fprintf (stdout, "Scan Unit for Moments : %d\n", inum); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MOMENTS, NOTUSED, NOTUSED, VDIFFUNIT, (void *) &inum))) { PERR (p_errno); } fprintf (stdout, "Sensor Unit for Moments : %d\n", inum); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, MOMENTS, NOTUSED, NOTUSED, MOMENTCHARGE, (void *) &inum))) { PERR (p_errno); } fprintf (stdout, "Moments Charge : %d\n", inum); } fprintf (stdout, "\n"); } void TensorInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { register int i, a; int tensor_def, rank, dimen_id, dimen_size, unum; SDDAS_INT *iptr; SDDAS_FLOAT *fptr; char string[400] = ""; fprintf (stdout, "************* TENSOR *************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, NOTUSED, NOTUSED, TENSORDEF, (void *) &tensor_def))) { PERR (p_errno); } fprintf (stdout, "Tensor Defined : %d\n", tensor_def); if (tensor_def == 1) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, NOTUSED, NOTUSED, TENSORRANK, (void *) &rank))) { PERR (p_errno); } fprintf (stdout, "Tensor Rank : %d\n", rank); for (i = 0; i < rank; ++i) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, DIMENNAME, (void *) string))) { PERR (p_errno); } fprintf (stdout, "Dimension %d Name : %s\n", i, string); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, DIMENID, (void *) &dimen_id))) { PERR (p_errno); } fprintf (stdout, "Dimension %d Id : %d\n", i, dimen_id); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, DIMENSIZE, (void *) &dimen_size))) { PERR (p_errno); } fprintf (stdout, "Dimension %d Size : %d\n", i, dimen_size); fptr = (SDDAS_FLOAT *) malloc ((size_t) dimen_size * sizeof (SDDAS_FLOAT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, DIMENVALUES, (void *) fptr))) { PERR (p_errno); } a = 0; fprintf (stdout, "Bin Centers : "); while (a < dimen_size) { if (a % 5 == 0) printf ("\n "); fprintf (stdout, "%10.2f ", fptr[a++]); } free ((char *) fptr); fprintf (stdout, "\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, NUNITS, (void *) &unum))) { PERR (p_errno); } fprintf (stdout, "Number of units for Dimension %d : %d\n", i, unum); iptr = (SDDAS_INT *) malloc ((size_t) unum * sizeof (SDDAS_INT)); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, TENSOR, i, NOTUSED, UNITNUMS, (void *) iptr))) { PERR (p_errno); } a = 0; fprintf (stdout, "Unit Numbers : "); while (a < unum) fprintf (stdout, "%d ", iptr[a++]); free ((char *) iptr); fprintf (stdout, "\n"); fprintf (stdout, "\n"); } } fprintf (stdout, "\n"); } void CoordinateSystemInfo (SDDAS_ULONG key, SDDAS_CHAR *ex) { int unum, cs_def; int a; char string[400] = ""; SDDAS_CHAR **dstring; fprintf (stdout, "************* COORD_SYSTEM ************\n\n"); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, COORD_SYSTEM, NOTUSED, NOTUSED, CSDEF, (void *) &cs_def))) { PERR (p_errno); } fprintf (stdout, "Coordinate System Defined : %d\n", cs_def); if (cs_def == 1) { if (ALL_OKAY != (p_errno = ReadPidf (key, ex, COORD_SYSTEM, NOTUSED, NOTUSED, CSDEFAULT, (void *) string))) { fprintf (stdout, "failure"); } fprintf (stdout, "Default Coordinate System : %s\n", string); unum = 0; if (ALL_OKAY != (p_errno = ReadPidf (key, ex, COORD_SYSTEM, NOTUSED, NOTUSED, CSNUMTRANSFER, (void *) &unum))) { fprintf (stdout, "failure"); } fprintf (stdout, "Num of transformation coordinate systems : %d\n", unum); dstring = Challoc (unum, MAX_PIDF_NAME); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, COORD_SYSTEM, NOTUSED, NOTUSED, CSTRANSFERUNIT, (void *) dstring))) { PERR (p_errno); } a = 0; while (a < unum) fprintf (stdout, "Defined Coordinate Systems : %s\n", dstring[a++]); fprintf (stdout, "\n"); Ch_Free (dstring, unum); } fprintf (stdout, "\n"); } void DumpPidf (SDDAS_ULONG key) { char *ex = ""; SDDAS_LONG mask = 0; int PltA; SDDAS_CHAR flow_into; Header (key, ex); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, FLOWINTO, (void *) &flow_into))) { PERR (p_errno); } fprintf (stdout, "Plasma Flows Into The Sensor : %c\n", flow_into); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, MASK, (void *) &mask))) { PERR (p_errno); } fprintf (stdout, "\nData Type Mask : %x \n", (int) mask); if (ALL_OKAY != (p_errno = ReadPidf (key, ex, NOTUSED, NOTUSED, NOTUSED, PLTAVL, (void *) &PltA))) { PERR (p_errno); } fprintf (stdout, "Plot Availability Flag : %x\n", PltA); Binning (key, ex); if (_IMAGE_ & PltA) { /* see if any image info exists */ Imaging (key, ex); } /* If image data */ if (_SMSK_ & mask) { /* see if any sensor info exists */ SensorInfo (key, ex); } if (_TMSK_ & mask) { /* see if any scan info exists */ ScanInfo (key, ex); } if (_CMSK_ & mask) { /* see if any cal set info exists */ CalibrationInfo (key, ex); } if (_MMSK_ & mask) { /* see if any mode info exists */ ModeInfo (key, ex); } if (_QMSK_ & mask) { /* see if any sensor info exists */ DataQualInfo (key, ex); } if (_PMSK_ & mask) { /* see if any pitch angle info exists */ PitchAngleInfo (key, ex); } if (_STARTAZMSK_ & mask) { /* see if any start_az angle info exists */ SpinAngleInfo (key, ex); } if (_SCPOTMSK_ & mask) { /* see if any S/C potential info exists */ SCPotentialInfo (key, ex); } if (_BKGDMSK_ & mask) { /* see if any background info exists */ BackgroundInfo (key, ex); } MomentsInfo (key, ex); CoordinateSystemInfo (key, ex); TensorInfo (key, ex); } void PERR (int p_errno) { char error_str[150]; pidf_error_str (p_errno, error_str); puts (error_str); exit (1); } int main (int argc, char **argv) { SDDAS_ULONG key = 0; if (argc < 2) { puts ("Error! Usage: dump_pidf P M E I V or "); puts ("Error! Usage: dump_pidf filename"); return -1; } if (argc > 2) { CfgInit (); key = dbGetDataKey (argv [1], argv [2], argv [3], argv [4], argv [5]); if (key == 0) { printf ("dump_pidf: Can't open (%s/%s/%s/%s/%s)\n", argv [1], argv [2], argv [3], argv [4], argv [5]); exit (-1); } } else { char vinst [255]; char *beginning; memset (vinst, 0, sizeof (vinst)); beginning = strrchr (argv [1], '/'); if (beginning == NULL) beginning = argv [1]; else beginning++; strncpy (vinst, beginning, strcspn (beginning, ".")); PIDF_SetFileName (argv [1], vinst); } DumpPidf (key); if (argc > 2) CfgTerm (); return (0); }