OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
HDF5GCFProduct.h
Go to the documentation of this file.
1 // This file is part of the hdf5_handler implementing for the CF-compliant
2 // Copyright (c) 2011-2013 The HDF Group, Inc. and OPeNDAP, Inc.
3 //
4 // This is free software; you can redistribute it and/or modify it under the
5 // terms of the GNU Lesser General Public License as published by the Free
6 // Software Foundation; either version 2.1 of the License, or (at your
7 // option) any later version.
8 //
9 // This software is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 // License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 //
18 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
19 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
20 // Suite 203, Champaign, IL 61820
21 
31 
32 #ifndef _H5GCFProduct_H
33 #define _H5GCFProduct_H
34 
35 #include <string>
36 #include <iostream>
37 #include <vector>
38 #include "hdf5.h"
39 
40 using namespace std;
41 
42 
45 
46 // Currently we only need to support four NASA generic HDF5 products for
47 // the access of NASA data via CF-compliant vis. tools(IDV and Panoply)
48 // via OPeNDAP.
49 // MEaSUREs SeaWiFS level 2 and level 3
50 // MEaSUREs Ozone zonal average
51 // Aquarius level 3
52 // Decadal survey SMAP level 2
53 // ACOS_L2S needs special handling of 64-bit integer mapping but there
54 // is no way to support the access of data via the CF-compliant tools.
55 
56 // For all products
57 static const char ROOT_NAME[] ="/";
58 
59 // GPM
60 static const char GPM_ATTR1_NAME[] ="FileHeader";
61 // GPM level 3
62 static const char GPM_GRID_GROUP_NAME1[]="Grid";
63 static const char GPM_GRID_GROUP_NAME2[]="GRID";
64 static const char GPM_GRID_MULTI_GROUP_NAME[]="Grids";
65 static const char GPM_ATTR2_NAME[] ="GridHeader";
66 // GPM level 1
67 static const char GPM_SWATH_ATTR2_NAME[] ="SwathHeader";
68 
69 
70 // MEaSUREs SeaWiFS level 2 and 3
71 static const char SeaWiFS_ATTR1_NAME[] ="instrument_short_name";
72 static const char SeaWiFS_ATTR2_NAME[] ="long_name";
73 static const char SeaWiFS_ATTR3_NAME[] ="short_name";
74 static const string SeaWiFS_ATTR1_VALUE ="SeaWiFS";
75 
76 // FPVALUE means Part of the attribute VALUE starting from the First value.
77 // PVALUE means Part VALUE.
78 static const string SeaWiFS_ATTR2_FPVALUE ="SeaWiFS";
79 static const string SeaWiFS_ATTR2_L2PVALUE ="Level 2";
80 static const string SeaWiFS_ATTR2_L3PVALUE ="Level 3";
81 static const string SeaWiFS_ATTR3_L2FPVALUE ="SWDB_L2";
82 static const string SeaWiFS_ATTR3_L3FPVALUE ="SWDB_L3";
83 
84 // Aquarius level 3
85 static const char Aquarius_ATTR1_NAME[] ="Sensor";
86 static const char Aquarius_ATTR2_NAME[] ="Title";
87 static const string Aquarius_ATTR1_VALUE ="Aquarius";
88 static const string Aquarius_ATTR2_PVALUE ="Level-3";
89 
90 // OBPG level 3
91 static const char Obpgl3_ATTR1_NAME[] ="processing_level";
92 static const string Obpgl3_ATTR1_VALUE ="L3 Mapped";
93 static const char Obpgl3_ATTR2_NAME[] ="cdm_data_type";
94 static const string Obpgl3_ATTR2_VALUE ="grid";
95 
96 
97 // SMAP simulation and ACOS L2S
98 static const char SMAC2S_META_GROUP_NAME[] ="Metadata";
99 static const char SMAP_ATTR_NAME[] ="ProjectID";
100 static const string SMAP_ATTR_VALUE ="SMAP";
101 
102 static const char ACOS_L2S_DSET_NAME[] ="ProjectId";
103 static const string ACOS_L2S_ATTR_VALUE ="ACOS";
104 
105 // MEaSURES Ozone level 2 and level 3
106 static const char Ozone_ATTR1_NAME[] ="ProductType";
107 static const string Ozone_ATTR1_VALUE1 ="L3 Monthly Zonal Means";
108 static const string Ozone_ATTR1_VALUE2 ="L2 Daily Trajectory";
109 
110 static const char Ozone_ATTR2_NAME[] ="ParameterName";
111 static const string Ozone_ATTR2_VALUE ="Nadir Profile and Total Column Ozone";
112 
113 // Function to check the product type
114 H5GCFProduct check_product(hid_t fileid);
115 
116 // Function to check if the product is GPM level 1
117 bool check_gpm_l1(hid_t root_id);
118 
119 // Function to check if the product is GPM level 3
120 bool check_gpmm_l3(hid_t root_id);
121 
122 bool check_gpms_l3(hid_t root_id);
123 
124 // Function to check if the product is MeaSure seaWiFS
125 // The returned integer reference of level will tell the level
126 // of the SeaWiFS product.
127 bool check_measure_seawifs(hid_t root_id,int& level);
128 
129 // Function to check if the product is Aquarius
130 // The returned integer reference of level will tell the level
131 // of the Aquarius product.
132 bool check_aquarius(hid_t root_id,int & level);
133 
134 // Check if this product is an OBPG HDF5 file
135 bool check_obpg(hid_t root_id,int & level);
136 
137 // Function to check if the product is ACOS Level 2 or SMAP.
138 // which_product tells if the product is SMAP or ACOSL2S.
139 // For example, if which_product is SMAP, it will just check
140 // if the attribute name and value are SMAP attribute and value.
141 // Then return true or false. Similar case is applied to ACOSL2S.
142 bool check_smap_acosl2s(hid_t root_id, int which_product);
143 
144 // Function to check if the product is MEaSURES Ozone zonal average or level 2.
145 bool check_measure_ozone(hid_t root_id);
146 
147 // Function to check if the product is NETCDF4_GENERAL.
148 bool check_netcdf4_general(hid_t root_id);
149 
150 // Obtain the attribute value of the HDF5 general attribute.
151 void obtain_gm_attr_value(hid_t group_id, const char* attr_name, string & attr_value);
152 
153 
154 #endif
H5GCFProduct check_product(hid_t fileid)
void obtain_gm_attr_value(hid_t group_id, const char *attr_name, string &attr_value)
STL namespace.
bool check_netcdf4_general(hid_t root_id)
bool check_obpg(hid_t root_id, int &level)
H5GCFProduct
bool check_measure_seawifs(hid_t root_id, int &level)
bool check_gpms_l3(hid_t root_id)
bool check_aquarius(hid_t root_id, int &level)
bool check_gpmm_l3(hid_t root_id)
bool check_gpm_l1(hid_t root_id)
bool check_smap_acosl2s(hid_t root_id, int which_product)
bool check_measure_ozone(hid_t root_id)