bes Updated for version 3.20.13
HDFSPArrayGeoField.h
1
2// This file is part of the hdf4 data handler for the OPeNDAP data server.
3// It retrieves the latitude and longitude fields for some special HDF4 data products.
4// The products include TRMML2_V6,TRMML3B_V6,CER_AVG,CER_ES4,CER_CDAY,CER_CGEO,CER_SRB,CER_SYN,CER_ZAVG,OBPGL2,OBPGL3
5// To know more information about these products,check HDFSP.h.
6// Each product stores lat/lon in different way, so we have to retrieve them differently.
7// Authors: MuQun Yang <myang6@hdfgroup.org>
8// Copyright (c) 2010-2012 The HDF Group
10#ifndef HDFSPARRAYGeoField_H
11#define HDFSPARRAYGeoField_H
12
13#include <libdap/Array.h>
14#include "hdf.h"
15#include "mfhdf.h"
16#include "HDFSPEnumType.h"
17
18class HDFSPArrayGeoField:public libdap::Array
19{
20 public:
21 HDFSPArrayGeoField (int32 rank, const std::string& filename, const int sdfd, int32 fieldref, int32 dtype, SPType sptype, int fieldtype, const std::string & fieldname, const std::string & n = "", libdap::BaseType * v = 0):
22 libdap::Array (n, v),
23 rank (rank),
24 filename(filename),
25 sdfd(sdfd),
26 fieldref (fieldref),
27 dtype (dtype),
28 sptype (sptype),
29 fieldtype (fieldtype),
30 name (fieldname) {
31 }
32 virtual ~ HDFSPArrayGeoField ()
33 {
34 }
35
36 // Standard way of DAP handlers to pass the coordinates of the subsetted region to the handlers
37 // Return the number of elements to read.
38 int format_constraint (int *cor, int *step, int *edg);
39
40 libdap::BaseType *ptr_duplicate ()
41 {
42 return new HDFSPArrayGeoField (*this);
43 }
44
45 virtual bool read ();
46
47
48 private:
49
51 int32 rank;
52
54 std::string filename;
55 int sdfd;
56
58 int32 fieldref;
59
61 int32 dtype;
62
64 SPType sptype;
65
73 int fieldtype;
74
76 std::string name;
77
78 // Read TRMM level 2 version 6 lat/lon
79 void readtrmml3a_v6 (int32 *, int32 *, int32 *, int);
80
81 // Read TRMM level 2 version 6 lat/lon
82 void readtrmml3c_v6 (int32 *, int32 *, int32 *, int);
83 // Read TRMM level 2 version 6 lat/lon
84 void readtrmml2_v6 (int32 *, int32 *, int32 *, int);
85
86
87 // Read OBPG level 2 lat/lon
88 void readobpgl2 (int32 *, int32 *, int32 *, int);
89
90 // Read OBPG level 3 lat/lon
91 void readobpgl3 (int *, int *, int);
92
93 // Read TRMM level 3 version 6 lat/lon
94 void readtrmml3b_v6 (int32 *, int32 *, int32 *, int);
95
96 // Read TRMM level 3 version 7 lat/lon
97 void readtrmml3_v7 (int32 *, int32 *, int);
98
99
100 // Read CERES SAVG and CERES ICCP_DAYLIKE lat/lon
101 void readcersavgid1 (int *, int *, int *, int);
102
103 // Read CERES SAVG and ICCP_DAYLIKE lat/lon
104 void readcersavgid2 (int *, int *, int *, int);
105
106 // Read CERES ZAVG lat/lon
107 void readcerzavg (int32 *, int32 *, int32 *, int);
108
109 // Read CERES AVG and SYN lat/lon
110 void readceravgsyn (int32 *, int32 *, int32 *, int);
111
112 // Read CERES ES4 and ICCP_GEO lat/lon
113 void readceres4ig (int32 *, int32 *, int32 *, int);
114
115 template <typename T> void LatLon2DSubset (T* outlatlon, int ydim, int xdim, T* latlon, int32 * offset, int32 * count, int32 * step);
116
117
118
119};
120
121
122#endif