OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
HE5Parser.cc
Go to the documentation of this file.
1 // This file is part of the hdf5 data handler for the OPeNDAP data server.
3 //
4 // Author: Hyo-Kyung Lee <hyoklee@hdfgroup.org>
5 //
6 // Copyright (c) 2007-2013 The HDF Group, Inc. and OPeNDAP, Inc.
7 //
8 // This is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License as published by the Free
10 // Software Foundation; either version 2.1 of the License, or (at your
11 // option) any later version.
12 //
13 // This software is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 // License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
23 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
24 // Suite 203, Champaign, IL 61820
25 
26 #include "HE5Parser.h"
27 
28 using namespace std;
29 
31 {
32  structure_state = -1; // Za/Swath/Grid state
33  parser_state = 0; // Parser's current state
34  err_msg = ""; // error message.
35 }
36 
38 {
39 }
40 
41 
43 {
44  unsigned int i = 0;
45 
46  if(err_msg != ""){
47  cerr << "Parse error:" << err_msg << endl;
48  }
49  cout << "ZA Size=" << za_list.size() << endl;
50  for(i=0; i < za_list.size(); i++) {
51  HE5Za z = za_list.at(i);
52  cout << "ZA Name=" << z.name << endl;
53  cout << "ZA Dim Size=" << z.dim_list.size() << endl;
54  unsigned int j = 0;
55  for(j=0; j < z.dim_list.size(); j++) {
56  HE5Dim d = z.dim_list.at(j);
57  cout << "ZA Dim Name=" << d.name;
58  cout << " Size=" << d.size << endl;
59  }
60 
61  cout << "ZA Var Size=" << z.data_var_list.size()
62  << endl;
63  for(j=0; j < z.data_var_list.size(); j++) {
64  HE5Var v = z.data_var_list.at(j);
65  cout << "ZA Var Name=" << v.name << endl;
66  cout << "ZA Var Dim Size=" << v.dim_list.size() << endl;
67  unsigned int k = 0;
68  for(k=0; k < v.dim_list.size(); k++) {
69  HE5Dim d = v.dim_list.at(k);
70  cout << "ZA Var Dim Name=" << d.name << endl;
71  }
72  }
73  }
74 
75  cout << "Swath Size=" << swath_list.size() << endl;
76  for(i=0; i < swath_list.size(); i++) {
77  HE5Swath s = swath_list.at(i);
78  cout << "Swath Name=" << s.name << endl;
79  cout << "Swath Dim Size=" << s.dim_list.size() << endl;
80  unsigned int j = 0;
81  for(j=0; j < s.dim_list.size(); j++) {
82  HE5Dim d = s.dim_list.at(j);
83  cout << "Swath Dim Name=" << d.name;
84  cout << " Size=" << d.size << endl;
85  }
86 
87  cout << "Swath Geo Var Size=" << s.geo_var_list.size()
88  << endl;
89  for(j=0; j < s.geo_var_list.size(); j++) {
90  HE5Var v = s.geo_var_list.at(j);
91  cout << "Swath Geo Var Name=" << v.name << endl;
92  cout << "Swath Geo Var Dim Size=" << v.dim_list.size() << endl;
93  unsigned int k = 0;
94  for(k=0; k < v.dim_list.size(); k++) {
95  HE5Dim d = v.dim_list.at(k);
96  cout << "Swath Geo Var Dim Name=" << d.name;
97  cout << " Size=" << d.size << endl;
98  }
99  }
100 
101  cout << "Swath Data Var Size=" << s.data_var_list.size()
102  << endl;
103  for(j=0; j < s.data_var_list.size(); j++) {
104  HE5Var v = s.data_var_list.at(j);
105  cout << "Swath Data Var Name=" << v.name << endl;
106  cout << "Swath Data Var Number Dim =" << v.dim_list.size() << endl;
107  unsigned int k = 0;
108  for(k=0; k < v.dim_list.size(); k++) {
109  HE5Dim d = v.dim_list.at(k);
110  cout << "Swath Data Var Dim Name=" << d.name << endl;
111  cout <<"Swath Data Var Dim Size= "<< d.size<<endl;
112  }
113  }
114  }
115 
116  cout << "Grid Size=" << grid_list.size() << endl;
117  for(i=0; i < grid_list.size(); i++) {
118  HE5Grid g = grid_list.at(i);
119  cout << "Grid Name=" << g.name << endl;
120 
121  cout << "Grid point_lower=" << g.point_lower << endl;
122  cout << "Grid point_upper=" << g.point_upper << endl;
123  cout << "Grid point_left=" << g.point_left << endl;
124  cout << "Grid point_right=" << g.point_right << endl;
125 
126  cout << "Grid Dim Size=" << g.dim_list.size() << endl;
127  unsigned int j = 0;
128  for(j=0; j < g.dim_list.size(); j++) {
129  HE5Dim d = g.dim_list.at(j);
130  cout << "Grid Dim Name=" << d.name;
131  cout << " Size=" << d.size << endl;
132  }
133 
134  cout << "Grid Var Size=" << g.data_var_list.size()
135  << endl;
136  for(j=0; j < g.data_var_list.size(); j++) {
137  HE5Var v = g.data_var_list.at(j);
138  cout << "Grid Var Name=" << v.name << endl;
139  cout << "Grid Var Dim Size=" << v.dim_list.size() << endl;
140  unsigned int k = 0;
141  for(k=0; k < v.dim_list.size(); k++) {
142  HE5Dim d = v.dim_list.at(k);
143  cout << "Grid Var Dim Name=" << d.name << endl;
144  }
145  }
146  cout << "Grid pixelregistration=" <<
148  << endl;
149  cout << "Grid origin=" <<
150  g.gridorigin
151  << endl;
152  cout << "Grid projection=" <<
153  g.projection
154  << endl;
155  }
156 
157 }
Definition: HE5Dim.h:8
vector< HE5Dim > dim_list
Definition: HE5Var.h:11
string name
Definition: HE5Za.h:9
vector< HE5Dim > dim_list
Definition: HE5Swath.h:11
float point_right
The rightmost coordinate value of a Grid.
Definition: HE5Grid.h:26
vector< HE5Dim > dim_list
Definition: HE5Za.h:10
string name
Definition: HE5Grid.h:15
STL namespace.
vector< HE5Var > data_var_list
Definition: HE5Swath.h:13
string name
Definition: HE5Dim.h:9
void print()
Print the information about the members of the Vector list.
Definition: HE5Parser.cc:42
EOS5GridPRType pixelregistration
Definition: HE5Grid.h:35
float point_left
The leftmost coordinate value of a Grid.
Definition: HE5Grid.h:24
EOS5GridPCType projection
Definition: HE5Grid.h:42
string name
Definition: HE5Swath.h:10
float point_lower
The bottom coordinate value of a Grid.
Definition: HE5Grid.h:20
float point_upper
The top coordinate value of a Grid.
Definition: HE5Grid.h:22
int size
Definition: HE5Dim.h:10
string name
Definition: HE5Var.h:10
Definition: HE5Za.h:7
EOS5GridOriginType gridorigin
Definition: HE5Grid.h:39
A class for parsing NASA HDF-EOS5 StructMetadata.
vector< HE5Var > data_var_list
Definition: HE5Grid.h:17
vector< HE5Var > data_var_list
Definition: HE5Za.h:11
vector< HE5Var > geo_var_list
Definition: HE5Swath.h:12
vector< HE5Dim > dim_list
Definition: HE5Grid.h:16
Definition: HE5Var.h:9
virtual ~HE5Parser()
Definition: HE5Parser.cc:37