WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
BufrFile.h
1#ifndef _WINC_BUFRFILE
2#define _WINC_BUFRFILE
3
4#include <WXP/BufrCode.h>
5#include <WXP/BufrData.h>
6#include <WXP/BufrParam.h>
7#include <WXP/File.h>
8
9namespace WXP {
10#define DATA_SIZE 10000
11 class BufrFile {
12 File file;
13 bool opened;
14
15 int type;
16 int version;
17 int size;
18
19 int loc;
20 int flag;
21 int data_size;
22 int data_type;
23 int data_subtype;
24 File lfile;
25 unsigned char data[DATA_SIZE];
26 unsigned char *data_ptr;
27
28 int bpval; /* Specifies the number of bits per
29 * gridpoint value used in encoding GRIB */
30 int bpoff; /* Offset in data stream in bytes */
31 int data_bits;
32 long bit_mask;
33 int temp_data;
34
35 int loop_ind;
36 int beg[20]; // Loop codes
37 int end[20];
38 int cnt[20];
39 int num[20];
40
41 int twidth; // Temporary changes to width, scale and reference
42 int tscale;
43 int tref;
44
45 int master_table;
46
47 BufrCode *codes;
48 int code_ind;
49 int num_codes;
50 int max_codes;
51
52 int num_params;
53 int num_subset;
54 int set_ind;
55
56 int seq_ind;
57 int seq_end;
58
59 int dind;
60 int dcode[30];
61 int dcodei[30];
62 char dcodes[30][200];
63
64 int initClass();
65 int searchBUFR();
66 int readData( int bytes );
67 int readBits( int bpval );
68 unsigned char getByte( int loc );
69 int seekData( int val );
70 int addCode( BufrCode &code );
71 int insertCode( int ind, BufrCode &code );
72 int resizeCode( int size );
73 int searchCode( int rmaj, int rmin, BufrCode &code );
74 int searchCodes( int rmaj, int rmin, char *name, int *pcodes );
75 int searchDataCode( int rmaj, int rmin, int val, char *str );
76
77 public:
78 BufrFile();
79 ~BufrFile();
80 int init();
81 int open( const char *filename );
82 bool isOpen();
83 int close();
84 int readHeader();
85 int readPDB();
86 int readIS();
87 int readOS();
88 int readDDS();
89 int readDS();
90 int readData( BufrData &data );
92 inline int getCodeInd(){ return code_ind; };
94 inline int getLoop(){ return loop_ind; };
96 inline int getLoopNum(){ return num[loop_ind]; };
98 inline int getLoopInd(){ return cnt[loop_ind]; };
100 inline int getLoopBeg(){ return beg[loop_ind]; };
102 inline int getLoopEnd(){ return end[loop_ind]; };
104 inline int getNumSubsets(){ return num_subset; };
105 int nextDataset();
106 int printCodes();
107 int print();
108
109 static int checkType( const char *filename );
110
111 enum FileType {
112 NONE,
113 WXP,
114 LDM,
115 NCEP,
116 RAW
117 };
118 };
119}
120
121#endif
This class reads in BUFR data from a file.
Definition BufrFile.h:11
BufrFile()
Definition BufrFile.cc:26
int readIS()
Definition BufrFile.cc:480
int open(const char *filename)
Definition BufrFile.cc:98
int printCodes()
Definition BufrFile.cc:926
int readOS()
Definition BufrFile.cc:755
int close()
Definition BufrFile.cc:126
bool isOpen()
Definition BufrFile.cc:119
static int checkType(const char *filename)
Definition BufrFile.cc:73
~BufrFile()
Definition BufrFile.cc:34
int getLoopBeg()
Definition BufrFile.h:100
int print()
Definition BufrFile.cc:1165
int getLoopInd()
Definition BufrFile.h:98
int nextDataset()
Definition BufrFile.cc:1154
int getLoop()
Definition BufrFile.h:94
int readHeader()
Definition BufrFile.cc:137
int getLoopNum()
Definition BufrFile.h:96
int getCodeInd()
Definition BufrFile.h:92
int getNumSubsets()
Definition BufrFile.h:104
int init()
Definition BufrFile.cc:49
int getLoopEnd()
Definition BufrFile.h:102
int readDDS()
Definition BufrFile.cc:770
This class accesses files.
Definition File.h:15
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct stores BUFR codes.
Definition BufrCode.h:6
This struct stores BUFR data.
Definition BufrData.h:5