bes Updated for version 3.20.10
HDFEOS2ArraySwathGeoMultiDimMapField.h
1
2// Retrieves the latitudes and longitudes of an HDF-EOS2 Swath using multiple dimension maps
3
4// Authors: MuQun Yang <myang6@hdfgroup.org>
5// Copyright (c) 2010-2020 The HDF Group
7// For the swath using the multiple dimension maps,
8// Latitude/longitude will be interpolated accordingly.
9#ifdef USE_HDFEOS2_LIB
10#ifndef HDFEOS2ARRAY_SWATHGEOMULTIDIMMAPFIELD_H
11#define HDFEOS2ARRAY_SWATHGEOMULTIDIMMAPFIELD_H
12
13#include <libdap/Array.h>
14#include "HDFCFUtil.h"
15#include "HdfEosDef.h"
16
17
18class HDFEOS2ArraySwathGeoMultiDimMapField:public libdap::Array
19{
20 public:
21 HDFEOS2ArraySwathGeoMultiDimMapField (int rank, const std::string & filename,
22 const int swathfd, const std::string & swathname,
23 const std::string & fieldname,
24 const int dim0size,const int dim0offset,const int dim0inc,
25 const int dim1size,const int dim1offset,const int dim1inc,
26 const std::string & n = "",
27 libdap::BaseType * v = 0):
28 libdap::Array (n, v),
29 rank (rank),
30 filename(filename),
31 swathfd (swathfd),
32 swathname (swathname),
33 fieldname (fieldname),
34 dim0size(dim0size),
35 dim0offset(dim0offset),
36 dim0inc(dim0inc),
37 dim1size(dim1size),
38 dim1offset(dim1offset),
39 dim1inc(dim1inc){
40 }
41 virtual ~ HDFEOS2ArraySwathGeoMultiDimMapField ()
42 {
43 }
44
45 // Standard way to pass the coordinates of the subsetted region from the client to the handlers
46 int format_constraint (int *cor, int *step, int *edg);
47
48 libdap::BaseType *ptr_duplicate ()
49 {
50 return new HDFEOS2ArraySwathGeoMultiDimMapField (*this);
51 }
52
53 // Read the data
54 virtual bool read ();
55
56 private:
57
58 // Field array rank
59 int rank;
60
61 // HDF-EOS2 file name
62 std::string filename;
63
64 int swathfd;
65
66 // HDF-EOS2 swath name
67 std::string swathname;
68
69 // HDF-EOS2 field name
70 std::string fieldname;
71
72 int dim0size;
73 int dim0offset;
74 int dim0inc;
75 int dim1size;
76 int dim1offset;
77 int dim1inc;
78 // Obtain Field value
79 template < class T > int GetFieldValue (int32, const std::string &,const std::vector <int>&,const std::vector <int>&,const std::vector<int>&, std::vector < T > &, std::vector<int32>&);
80
81 // The internal routine to do the interpolation
82 template < class T > int _expand_dimmap_field (std::vector < T > *pvals, int32 rank, int32 dimsa[], int dimindex, int32 ddimsize, int32 offset, int32 inc);
83
84 // subsetting routine to ensure the subsetted 2D field to be returned.
85 template < class T > bool Field2DSubset (T * outlatlon, const int majordim, const int minordim, T * latlon, int32 * offset, int32 * count, int32 * step);
86
87
88
89};
90
91
92#endif
93#endif