WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
UpaData.h
1#ifndef _WINC_UPADATA
2#define _WINC_UPADATA
3
4#include <WXP/Date.h>
5#include <WXP/StrLib.h>
6#include <WXP/UpaLevel.h>
7#include <WXP/VCoord.h>
8
9namespace WXP {
10 /*
11 Upper air merged data structure
12 */
13 class UpaData {
14 int type; /* Observation type */
15 Date date; /* Observation time */
16 int fhour; /* Forecast hour */
17 char gen_name[20]; /* Generation name */
18 char id[20]; /* Station identifier */
19 char area[20]; /* Regional identifier */
20 char wmo[6]; /* WMO station number */
21 float lat; /* Station latitude */
22 float lon; /* Station longitude */
23 float elev; /* Station elevation */
24 public:
25 static const int MAXLEV = 300;
26
27 UpaLevel lev[MAXLEV]; /* Level information */
28 int num; /* Number of levels */
29 int sfc; /* Index of surface level */
30 int maxwnd; /* Index of max wind level */
31 int trop; /* Index of tropopause level */
32
33 public:
34 UpaData();
35 int init();
36 int print();
37 int addLevel( UpaLevel &level );
38 int delLevel( int ind );
39 int updateLevel( int ind, UpaLevel &level );
40 int setNum( int val );
41 bool isSfc();
42 bool isLevelMandatory( int ind );
43 int sortPres();
44 int sortHeight();
45 int calcHeight();
46 int calcPres();
47 int interpTemps();
48 int interpWinds();
49 int interp( int coord, float val, UpaLevel &level );
50 int interp( VCoord coord, UpaLevel &level );
51
52 inline int setType( int rtype ){ type = rtype; return 1; };
53 inline int getType(){ return type; };
54 int setId( const char *rid );
55 inline const char *getId(){ return id; };
56 int setArea( const char *rarea );
57 inline const char *getGenName(){ return gen_name; };
58 int setGenName( const char *str );
59 inline int setFhour( int val ){ fhour = val; return 1; };
60 inline int getFhour(){ return fhour; };
61 inline const char *getArea(){ return area; };
62 inline int setDate( Date &rdate ){ date = rdate; return 1; };
63 inline Date getDate(){ return date; };
64 inline int getDate( Date &rdate ){ rdate = date; return 1; };
65 inline int setWmo( const char *rwmo ){ StrLib::copy( wmo, 6, rwmo ); return 1; };
66 inline const char *getWmo(){ return wmo; };
67 inline int setLoc( float rlat, float rlon ){ lat = rlat; lon = rlon; return 1; };
68 inline float getLat(){ return lat; };
69 inline float getLon(){ return lon; };
70 int setElev( float relev );
71 inline float getElev(){ return elev; };
72
73 inline int setSfc( int ind ){ sfc = ind; return 1; };
74 inline int getSfc(){ return sfc; };
75 inline int setMaxWnd( int ind ){ maxwnd = ind; return 1; };
76 inline int getMaxWnd(){ return maxwnd; };
77 inline int setTrop( int ind ){ trop = ind; return 1; };
78 inline int getTrop(){ return trop; };
79
80 int getSfc( UpaLevel &lev );
81 float getSfcPres();
82 int setSfcHght( float val );
83 float getSfcHght();
84 int getTrop( UpaLevel &lev );
85 float getTropPres();
86 int getMaxWnd( UpaLevel &lev );
87 float getMaxWndPres();
88
89 inline int getNum(){ return num; };
90 UpaLevel getLevel( int level );
91 int setType( int level, int val );
92 int getType( int level );
93 int setPres( int level, float val );
94 float getPres( int level );
95 int setHght( int level, float val );
96 float getHght( int level );
97 int setTemp( int level, float val );
98 float getTemp( int level );
99 float getTempK( int level );
100 int setDewp( int level, float val );
101 float getDewp( int level );
102 float getDewpK( int level );
103 int setSpd( int level, float val );
104 float getSpd( int level );
105 int setDir( int level, float val );
106 float getDir( int level );
107 bool validPres( int level );
108 bool validHght( int level );
109 bool validTemp( int level );
110 bool validDewp( int level );
111 bool validDir( int level );
112 bool validSpd( int level );
113
114 friend class UpaDataTool;
115 };
116}
117#endif
118
This class stores date and time information.
Definition Date.h:8
static int copy(char *s1, int len1, const char s2)
Definition StrLib.cc:506
This class processes data from UpaData class.
Definition UpaDataTool.h:9
This class stores upper air data.
Definition UpaData.h:13
int init()
Definition UpaData.cc:32
UpaData()
Definition UpaData.cc:25
This structure defines a vertical coordinate (type,val)
Definition VCoord.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct contains data for a specific upper air level.
Definition UpaLevel.h:5