bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
HDFEOS2Array_RealField.h
1
2// This file is part of the hdf4 data handler for the OPeNDAP data server.
3// It retrieves the real field values.
4// Authors: Kent Yang <myang6@hdfgroup.org> Eunsoo Seo
5// Copyright (c) The HDF Group
7
8#ifdef USE_HDFEOS2_LIB
9#ifndef HDFEOS2ARRAY_REALFIELD_H
10#define HDFEOS2ARRAY_REALFIELD_H
11
12#include <libdap/Array.h>
13
14#include "HDFCFUtil.h"
15#include "HdfEosDef.h"
16
17
18#include "HDFEOS2EnumType.h"
19
20
21class HDFEOS2Array_RealField:public libdap::Array
22{
23 public:
24 HDFEOS2Array_RealField (int rank, const std::string & filename, bool isgeofile, const int sdfd, const int gridswathfd, const std::string & gridname, const std::string & swathname, const std::string & fieldname, SOType sotype, const std::string & n = "", libdap::BaseType * v = nullptr):
25 libdap::Array (n, v),
26 rank (rank),
27 filename (filename),
28 isgeofile(isgeofile),
29 sdfd(sdfd),
30 gsfd(gridswathfd),
31 gridname (gridname),
32 swathname (swathname),
33 fieldname (fieldname),
34 sotype(sotype) {
35 }
36 ~ HDFEOS2Array_RealField () override = default;
37
38 // Standard way to pass the coordinates of the subsetted region from the client to the handlers
39 int format_constraint (int *cor, int *step, int *edg);
40
41 libdap::BaseType *ptr_duplicate () override
42 {
43 return new HDFEOS2Array_RealField (*this);
44 }
45
46 // Read the data.
47 bool read () override;
48
49 private:
50
51 // Field array rank
52 int rank;
53
54 // HDF-EOS2 file name
55 std::string filename;
56
57 bool isgeofile;
58
59 int sdfd;
60 int gsfd;
61
62 // HDF-EOS2 grid name
63 std::string gridname;
64
65 // HDF-EOS2 swath name
66 std::string swathname;
67
68 // HDF-EOS2 field name
69 std::string fieldname;
70
71 // MODIS scale and offset type
72 // Some MODIS files don't use the CF linear equation y = scale * x + offset,
73 // the scaletype distinguishs products following different scale and offset rules.
74 SOType sotype;
75
76 int write_dap_data_scale_comp( int32 gridid, int nelms, std::vector<int32> &offset32,std::vector<int32> &count32,std::vector<int32> &step32);
77 int write_dap_data_disable_scale_comp( int32 gridid, int nelms, int32 *offset32,int32*count32,int32*step32);
78 void release_mod1b_res(float*ref_scale,float*ref_offset,float*rad_scale,float*rad_offset);
79 void close_fileid(const int gsfileid, const int sdfileid) const;
80
81};
82
83
84#endif
85#endif