WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
NidsFile.h
1#ifndef _WINC_NIDSFILE
2#define _WINC_NIDSFILE
3
4#include <WXP/Buffer.h>
5#include <WXP/BZlib.h>
6#include <WXP/Date.h>
7#include <WXP/DomainVal.h>
8#include <WXP/File.h>
9#include <WXP/NidsData.h>
10#include <WXP/NidsInfo.h>
11#include <WXP/NidsRadial.h>
12#include <WXP/NidsRun.h>
13#include <WXP/NidsText.h>
14#include <WXP/NidsVector.h>
15#include <WXP/NidsWind.h>
16#include <WXP/Zlib.h>
17
18namespace WXP {
19
20 class NidsFile {
21 File file;
22 bool opened;
23 DomainVal dom;
24 Date date;
25 int seg_type; // Segment type, reg or zlib
26 int data_type; // Compressed or Encypted
27 int comp_test; // Test for compression
28
29 Buffer raw;
30 Buffer in;
31 Buffer out;
32 Zlib zs;
33 BZlib bz;
34
35 // Header parameters
36 int code;
37 int mess_date;
38 int mess_len;
39 int src;
40 int mess_blks;
41
42 // Product description
43 float lat,lon,elev;
44 int mode; // Mode = clear air, precip
45 int vol_scan;
46 int vol_date;
47 int vcp;
48 int seq;
49 int prod_date;
50 int param[10];
51 int ithres[16]; // Threshold values
52 float thres[16];
53 int nmaps; // Offset information
54 int off_symb;
55 int off_graph;
56 int off_tab;
57
58 // Product symbology
59 int prodsym_len;
60 int prodsym_lyr;
61
62 // Product symbology layer
63 int prodsym_lyr_len;
64
65 // Packet
66 int pk_code;
67
68 // Radial parameters
69 int rad, bin;
70 int nrad, nbin;
71 int rad0, bin0;
72 float ang0, ang1;
73
74 // Rastor parameters
75 int row, col;
76 int nrow, ncol;
77 int row0, col0;
78
79 // Generic packet parameters
80 int len, num;
81 int val;
82 int bytes, nbytes;
83 int pack;
84
85 // Product parameter data
86 float res;
87 float dx,dy;
88 int nx,ny;
89 int scan_num;
90 float scan_elev;
91 float range;
92 float max,nmax;
93 int beg_date;
94 int end_date;
95 int num_graph;
96
97 int setInfo( char *info );
98 int setMisc( char *misc );
99
100 public:
101 NidsFile();
102 NidsFile( const char *filename );
103 ~NidsFile();
104 int init();
105 int open( const char *filename );
106 int close();
107 bool isOpen();
108 int skipLine();
109 int readRaw();
110 int readBytes( unsigned char *data, int size );
111 int dump( int num, int flag );
112 int readShort( short &val );
113 short readShort();
114 int readUshort( unsigned short &val );
115 int readLong( int &val );
116 int readLong();
117 int readUlong( unsigned int &val );
118 float float16( int val );
119 float float32( int val1, int val2 );
120 int readHeader( NidsInfo &info );
121 int messHeader();
122 int prodDesc();
123 int prodSymb();
124 int prodSymbLayer();
125 int gotoGraphic();
126 int graphic();
127 int graphicLayer();
128 int readPacket();
129
130 int readRastor();
131 int readRadial( NidsRadial &radial );
132 int readRun( NidsRun &data );
133 int readVector( NidsVector &vect );
134 int skipVector();
135 int readText( NidsText &text );
136 int skipText();
137 int readWind( NidsWind &wind );
138 int skipWind();
139 int readData( NidsData &data );
140
141 inline int getCode(){ return code; };
142 bool isBRef();
143 bool isBSW();
144 bool isCRef();
145 bool isVel();
146 bool isSRVel();
147 bool isTops();
148 bool isEnhTops();
149 bool isLRef();
150 bool isVIL();
151 bool isDigVIL();
152 bool isVAD();
153 bool isPrec();
154 bool isDPrec();
155 bool isDPrRate();
156 bool isHydroClass();
157 bool isCorrel();
158 bool isDPA();
159 bool isDHR();
160 bool isDSP();
161 bool isDRef();
162 bool isDual();
163 bool isPacketRadial();
164 bool isPacketRastor();
165 bool isPacketVector();
166 bool isPacketWindbarb();
167 bool isPacketText();
168 bool isPacketDpa();
169 inline int getPacketCode() { return pk_code; };
170 inline int getNbin() { return nbin; };
171 inline int getNrad() { return nrad; };
172
173 DomainVal getDomainVal();
174
175 static const int RADIAL = 0xAF1F;
176 static const int RASTOR = 0xBA0F;
177
178 enum Mode {
179 OM,
180 CLEARAIR,
181 PRECIP
182 };
183 enum Type {
184 REG,
185 ZCOMP,
186 ENC,
187 BCOMP
188 };
189 };
190}
191#endif
192
This class manages bzip2 decompression.
Definition BZlib.h:9
This class creates a generic buffer for data.
Definition Buffer.h:5
This class stores date and time information.
Definition Date.h:8
This class accesses files.
Definition File.h:15
This class reads and decodes NIDS data from file.
Definition NidsFile.h:20
~NidsFile()
Definition NidsFile.cc:46
int init()
Definition NidsFile.cc:53
int readRadial(NidsRadial &radial)
Definition NidsFile.cc:1571
int close()
Definition NidsFile.cc:95
int open(const char *filename)
Definition NidsFile.cc:69
int readBytes(unsigned char *data, int size)
Definition NidsFile.cc:137
int skipLine()
Definition NidsFile.cc:244
NidsFile()
Definition NidsFile.cc:30
bool isOpen()
Definition NidsFile.cc:88
int readVector(NidsVector &vect)
Definition NidsFile.cc:1695
int readRun(NidsRun &data)
Definition NidsFile.cc:1615
int readShort(short &val)
Definition NidsFile.cc:258
This class manages zlib decompression.
Definition Zlib.h:9
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic domain parameters.
Definition DomainVal.h:5
This struct stores NIDS data.
Definition NidsData.h:14
This struct stores NIDS header data.
Definition NidsInfo.h:12
This struct stores NIDS radial block header information.
Definition NidsRadial.h:11
This struct stores NIDS run length encoding block header information.
Definition NidsRun.h:12
This struct stores NIDS text block header information.
Definition NidsText.h:6
This struct stores NIDS vector block header information.
Definition NidsVector.h:6
This struct stores NIDS wind data block header information.
Definition NidsWind.h:6