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