|
ocssw
1.0
|
00001 /****************************************************************************** 00002 * 00003 * NSSDC/CDF Header file for CDFstats. 00004 * 00005 * Version 1.5a, 15-May-95, Hughes STX. 00006 * 00007 * Modification history: 00008 * 00009 * V1.0 23-Sep-91, J Love Original version (for CDF V2.1). 00010 * V1.1 23-Mar-92, J Love CDF V2.2. Added fill value filtering. 00011 * V1.2 11-Jun-92, J Love CDF V2.3 (shareable/NeXT). 00012 * V1.3 26-Nov-93, J Love CDF V2.4. 00013 * V1.4 13-Dec-94, J Love CDF V2.5. 00014 * V1.5 28-Mar-95, J Love POSIX. 00015 * V1.5a 15-May-95, J Love Prototypes for `ASSIGNx', `EQx', etc. moved 00016 * to `cdftools.h'. 00017 * 00018 ******************************************************************************/ 00019 00020 #if !defined(CDFSTATSh_INCLUDEd__) 00021 #define CDFSTATSh_INCLUDEd__ 00022 00023 /****************************************************************************** 00024 * Include files. 00025 ******************************************************************************/ 00026 00027 #include "cdftools.h" 00028 00029 #if defined(mac) 00030 #include "cdfstats.rh" 00031 #endif 00032 00033 /****************************************************************************** 00034 * QOP constants. 00035 ******************************************************************************/ 00036 00037 #define CDFPATHparm 0 00038 00039 #define RANGEqual 0 00040 #define NORANGEqual 1 00041 #define OUTPUTqual 2 00042 #define FILLqual 3 00043 #define NOFILLqual 4 00044 #define FORMATqual 5 00045 #define NOFORMATqual 6 00046 #define PAGEqual 7 00047 #define NOPAGEqual 8 00048 #define UPDATE_VALIDSqual 9 00049 #define NOUPDATE_VALIDSqual 10 00050 #define UPDATE_SCALESqual 11 00051 #define NOUPDATE_SCALESqual 12 00052 #define ZMODEqual 13 00053 #define NEG2POSFP0qual 14 00054 #define NONEG2POSFP0qual 15 00055 #define UPDATE_MONOTONICqual 16 00056 #define NOUPDATE_MONOTONICqual 17 00057 #define REPORTqual 18 00058 #define CACHEqual 19 00059 00060 /****************************************************************************** 00061 * Lengths. 00062 ******************************************************************************/ 00063 00064 #define MONOTON_RESULT_LEN 8 00065 00066 /****************************************************************************** 00067 * Enumerators. 00068 ******************************************************************************/ 00069 00070 enum monoStatesENUM { _Init, _Steady, _Increase, _Decrease, _noIncrease, 00071 _noDecrease, _False }; 00072 00073 /****************************************************************************** 00074 * Global variables. 00075 ******************************************************************************/ 00076 00077 #if defined(CDFSTATS) 00078 Logical updateValids; 00079 Logical updateScales; 00080 Logical updateMonotonic; 00081 Logical useFormat; 00082 Logical rangeCheck; 00083 Logical ignoreFills; 00084 FILE *OUTfp; 00085 int32_t validminAttrN; /* attribute number */ 00086 int32_t validmaxAttrN; /* attribute number */ 00087 int32_t fillvalAttrN; 00088 int32_t formatAttrN; 00089 #else 00090 extern Logical updateValids; 00091 extern Logical updateScales; 00092 extern Logical updateMonotonic; 00093 extern Logical useFormat; 00094 extern Logical rangeCheck; 00095 extern Logical ignoreFills; 00096 extern FILE *OUTfp; 00097 extern int32_t validminAttrN; /* attribute number */ 00098 extern int32_t validmaxAttrN; /* attribute number */ 00099 extern int32_t fillvalAttrN; 00100 extern int32_t formatAttrN; 00101 #endif 00102 00103 /****************************************************************************** 00104 * VARstruct. 00105 ******************************************************************************/ 00106 00107 struct VARstruct { 00108 Logical Z; 00109 int32_t varN; 00110 char varName[CDF_VAR_NAME_LEN+1]; 00111 int32_t dataTypeV; 00112 int32_t numElemsV; 00113 int32_t numDims; 00114 int32_t dimSizes[CDF_MAX_DIMS]; 00115 int32_t recVary; 00116 int32_t dimVarys[CDF_MAX_DIMS]; 00117 int32_t varMaxRec; 00118 Logical checkMonotonicVar; 00119 Logical rangeCheckVar; 00120 Logical ignoreFillsVar; 00121 char *format; 00122 void *validmin; 00123 void *validmax; 00124 void *fillval; 00125 void *buffer; 00126 void *min, *max, *last; 00127 void *minINrange, *maxINrange; 00128 int32_t low, high; 00129 int32_t fills; 00130 Logical oneINrange; 00131 Logical minmaxInited; 00132 Logical monoInited; 00133 Logical hyper; 00134 enum monoStatesENUM monoState; 00135 int32_t nRecValues; 00136 int32_t nValueBytes; 00137 int32_t valueN; 00138 }; 00139 00140 /****************************************************************************** 00141 * Function Prototypes. 00142 ******************************************************************************/ 00143 00144 Logical CalculateStatistics PROTOARGs((int argC, char *argV[])); 00145 Logical StatisticsQOPs PROTOARGs((int *argC, char **argV[])); 00146 void MinMaxInit PROTOARGs((struct VARstruct *)); 00147 void MinMaxCheck PROTOARGs((struct VARstruct *)); 00148 void Monotonic PROTOARGs((struct VARstruct *)); 00149 void DisplayMin PROTOARGs((struct VARstruct *)); 00150 void DisplayMax PROTOARGs((struct VARstruct *)); 00151 void DisplayFill PROTOARGs((struct VARstruct *)); 00152 Logical SetupVar PROTOARGs((struct VARstruct *)); 00153 Logical CALCstat PROTOARGs((struct VARstruct *)); 00154 void DISPstat PROTOARGs((struct VARstruct *)); 00155 Logical StatusHandler PROTOARGs((CDFstatus)); 00156 00157 /*****************************************************************************/ 00158 00159 #endif
1.7.6.1