bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
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: Kent Yang <myang6@hdfgroup.org>
8// Copyright (c) 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 = nullptr):
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 ~ HDFSPArrayGeoField () override = default;
33
34 // Standard way of DAP handlers to pass the coordinates of the subsetted region to the handlers
35 // Return the number of elements to read.
36 int format_constraint (int *cor, int *step, int *edg);
37
38 libdap::BaseType *ptr_duplicate () override
39 {
40 return new HDFSPArrayGeoField (*this);
41 }
42
43 bool read () override;
44
45
46 private:
47
49 int32 rank;
50
52 std::string filename;
53 int sdfd;
54
56 int32 fieldref;
57
59 int32 dtype;
60
62 SPType sptype;
63
71 int fieldtype;
72
74 std::string name;
75
76 // Read TRMM level 2 version 6 lat/lon
77 void readtrmml3a_v6 (const int32 *, const int32 *, const int32 *, int);
78
79 // Read TRMM level 2 version 6 lat/lon
80 void readtrmml3c_v6 (const int32 *, const int32 *, const int32 *, int);
81 // Read TRMM level 2 version 6 lat/lon
82 void readtrmml2_v6 (const int32 *, const int32 *, const int32 *, int);
83
84
85 // Read OBPG level 2 lat/lon
86 void readobpgl2 (int32 *, int32 *, int32 *, int);
87
88 // Read OBPG level 3 lat/lon
89 void readobpgl3 (const int *, const int *, int);
90
91 // Read TRMM level 3 version 6 lat/lon
92 void readtrmml3b_v6 (const int32 *, const int32 *, const int32 *, int);
93
94 // Read TRMM level 3 version 7 lat/lon
95 void readtrmml3_v7 (const int32 *, const int32 *, int);
96
97
98 // Read CERES SAVG and CERES ICCP_DAYLIKE lat/lon
99 void readcersavgid1 (const int *, const int *, const int *, int);
100
101 // Read CERES SAVG and ICCP_DAYLIKE lat/lon
102 void readcersavgid2 (const int *, const int *, const int *, int);
103
104 // Read CERES ZAVG lat/lon
105 void readcerzavg (const int32 *, const int32 *, const int32 *, int);
106
107 // Read CERES AVG and SYN lat/lon
108 void readceravgsyn (int32 *, int32 *, int32 *, int);
109
110 // Read CERES ES4 and ICCP_GEO lat/lon
111 void readceres4ig (const int32 *, const int32 *, const int32 *, int);
112
113 template <typename T> void LatLon2DSubset (T* outlatlon, int xdim, T* latlon, const int32 * offset, const int32 * count, const int32 * step);
114
115
116
117};
118
119
120#endif