]> Pileus Git - ~andy/rsl/blob - toolkit_1BC-51_appl.h
RSL v1.44
[~andy/rsl] / toolkit_1BC-51_appl.h
1 /*
2    Parameter definitions for 1B-51 and 1C-51 HDF
3          file handling applications using the TSDIS toolkit. 
4
5          Mike Kolander
6 */
7
8 #define SCALE_FACTOR     100.0   /* Most data values placed into HDF file
9                                                                                                                                           are scaled by this factor. */
10 #define X 200.0                  /* Used to create 1C-51 reflectivity
11                                                                                                                                                 values: 
12                                                                                                                                                 1C-51_val = dBz_val - X * MaskValue,
13                                                                                                                                                 where MaskValue = 0 or 1 .
14                                                                                                                                  */
15
16 /* For missing HDF header values. From TSDIS specs. */
17 #define NOVAL_INT16 -9999
18 #define NOVAL_INT32 -9999
19 #define NOVAL_FLOAT -9999.9
20
21 /* HDF cell value flags. */
22 #define NO_VALUE -32767      /* No value recorded in bin by radar site. */
23 #define RNG_AMBIG_VALUE -32766    /* Range-ambiguous flag */
24 #define NOECHO_VALUE -32765       /* Value too low for SNR */
25 #define AP_VALUE -32764           /* Anomalous propagation flag */
26
27
28 #define MAX_RANGE_1B51   230.0   /* Max range (km) for 1B-51. */
29 #define MAX_RANGE_1C51   200.0   /* Max range (km) for 1C-51. */
30 #define TK_MAX_FILENAME  256     /* 256 bytes for filename storage. */
31
32 /* ----------- Function return codes --------------
33          See RSL files: radar_to_hdf_1.c, radar_to_hdf_2.c, hdf_to_radar.c
34          See application files: level_1.c, hdf_to_uf.c   */
35 #define OK        0  /* Nominal termination with product produced. */
36 #define ABORT    -1  /* PANIC exit -> No product produced. */
37 #define INTER    -2  /* Abort execution. Received signal INT, KILL, or STOP */
38 #define QUIT     -3  /* Anomalous_condition exit -> No product produced. */
39 #define SHUTDOWN -4  /* Shut down all processing, including scripts. */
40
41 /* TSDIS toolkit parameter definitions. */
42 #include "IO_GV.h"
43
44
45 /* VOS dimensions w.r.t toolkit. The toolkit L1 structure is logically
46    organized as a sequence of physical sweeps. */
47 typedef struct
48 {
49 int nparm;  /* No. of toolkit parameters (ie, volumes) for this VOS. */
50 int nsweep;
51 int nray[MAX_SWEEP];
52 int ncell[MAX_SWEEP][MAX_PARM];  /* ncell[tk_sindex][pindex] */
53 } tkVosSize;
54
55
56 /* VOS dimensions w.r.t RSL. RSL is logically organized as a sequence
57          of "volumes".*/
58 typedef struct
59 {
60 int maxNsweep;
61 int maxNray;    /* Max(nray[sweep0] ... nray[nsweep-1]) */
62 int nsweep[MAX_PARM];
63 int nray[MAX_PARM][MAX_SWEEP];
64 int ncell[MAX_PARM][MAX_SWEEP];
65 /* Arrays of pointers mapping toolkit objects back to the
66          corresponding rsl objects. */
67 Volume *v[MAX_PARM];     /* Maps each tk volume to a rsl volume. */
68 Sweep *sweep[MAX_SWEEP]; /* Maps each tk sweep to a rsl sweep. */
69 } rslVosSize;
70
71
72 typedef struct
73 {
74 int vos_num;  /* 0...MAX_VOS-1 : Position no. of this VOS in HDF file. */
75 rslVosSize rsl;  /* Dimensions of rsl radar structure. */
76 tkVosSize tk;    /* Dimensions of toolkit structure. */
77 } VosSize;
78
79 #define NUMBER_QC_PARAMS 10
80 enum QC_parameters
81 {
82         HTHRESH1, HTHRESH2, HTHRESH3,
83         ZTHRESH0, ZTHRESH1, ZTHRESH2, ZTHRESH3, 
84         HFREEZE, DBZNOISE, ZCAL
85 };
86
87 /*************************************************************/
88 /*                                                           */
89 /*                Function Prototypes                        */
90 /*                                                           */
91 /*************************************************************/
92 /* Toolkit memory management functions in file: toolkit_memory_mgt.c */
93 void TKfreeGVL1(L1B_1C_GV *gvl1);
94 int8 ***TKnewParmData1byte(int nsweep, int nray, int ncell);
95 int16 ***TKnewParmData2byte(int nsweep, int nray, int ncell);
96 PARAMETER *TKnewGVL1parm(void);
97 L1B_1C_GV *TKnewGVL1(void);