OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
MerisSPH.cpp
Go to the documentation of this file.
1 /*
2  * File: MerisSPH.cpp
3  * Author: dshea
4  *
5  * Created on November 28, 2012, 1:11 PM
6  */
7 
8 #include "MerisSPH.h"
9 
10 #include "EnvsatUtil.h"
11 
12 #include <stdio.h>
13 
14 using namespace std;
15 
17 EnvsatSPH(orig) {
18 
19 }
20 
21 MerisSPH::MerisSPH(EnvsatFile* file, int size, int numDSDs, int DSDSize) :
22 EnvsatSPH(file, size, numDSDs, DSDSize) {
23 
24 }
25 
26 //MerisSPH::~MerisSPH() {
27 //
28 //}
29 
31  static string name;
32  getString(buffer, name, DESCRIPTOR_OFFSET, DESCRIPTOR_LENGTH);
33  return name;
34 }
35 
37  string str;
38  getString(buffer, str, FIRST_LINE_TIME_OFFSET, UTC_DATE_LENGTH);
39  return merisTime2unix(str);
40 }
41 
42 void MerisSPH::setFirstLineTime(double unixTime) {
43  setString(unix2merisTime(unixTime), buffer, FIRST_LINE_TIME_OFFSET,
44  UTC_DATE_LENGTH);
45 }
46 
48  string str;
49  getString(buffer, str, LAST_LINE_TIME_OFFSET, UTC_DATE_LENGTH);
50  return merisTime2unix(str);
51 }
52 
53 void MerisSPH::setLastLineTime(double unixTime) {
54  setString(unix2merisTime(unixTime), buffer, LAST_LINE_TIME_OFFSET,
55  UTC_DATE_LENGTH);
56 }
57 
59  return getLatLon(buffer, FIRST_FIRST_LAT_OFFSET);
60 }
61 
63  setLatLon(lat, buffer, FIRST_FIRST_LAT_OFFSET);
64 }
65 
67  return getLatLon(buffer, FIRST_FIRST_LON_OFFSET);
68 }
69 
71  setLatLon(lon, buffer, FIRST_FIRST_LON_OFFSET);
72 }
73 
75  return getLatLon(buffer, FIRST_MID_LAT_OFFSET);
76 }
77 
79  setLatLon(lat, buffer, FIRST_MID_LAT_OFFSET);
80 }
81 
83  return getLatLon(buffer, FIRST_MID_LON_OFFSET);
84 }
85 
87  setLatLon(lon, buffer, FIRST_MID_LON_OFFSET);
88 }
89 
91  return getLatLon(buffer, FIRST_LAST_LAT_OFFSET);
92 }
93 
95  setLatLon(lat, buffer, FIRST_LAST_LAT_OFFSET);
96 }
97 
99  return getLatLon(buffer, FIRST_LAST_LON_OFFSET);
100 }
101 
103  setLatLon(lon, buffer, FIRST_LAST_LON_OFFSET);
104 }
105 
107  return getLatLon(buffer, LAST_FIRST_LAT_OFFSET);
108 }
109 
111  setLatLon(lat, buffer, LAST_FIRST_LAT_OFFSET);
112 }
113 
115  return getLatLon(buffer, LAST_FIRST_LON_OFFSET);
116 }
117 
119  setLatLon(lon, buffer, LAST_FIRST_LON_OFFSET);
120 }
121 
123  return getLatLon(buffer, LAST_MID_LAT_OFFSET);
124 }
125 
127  setLatLon(lat, buffer, LAST_MID_LAT_OFFSET);
128 }
129 
131  return getLatLon(buffer, LAST_MID_LON_OFFSET);
132 }
133 
135  setLatLon(lon, buffer, LAST_MID_LON_OFFSET);
136 }
137 
139  return getLatLon(buffer, LAST_LAST_LAT_OFFSET);
140 }
141 
143  setLatLon(lat, buffer, LAST_LAST_LAT_OFFSET);
144 }
145 
147  return getLatLon(buffer, LAST_LAST_LON_OFFSET);
148 }
149 
151  setLatLon(lon, buffer, LAST_LAST_LON_OFFSET);
152 }
153 
155  return getInt(buffer, SAMPLES_PER_LINE_OFFSET, SAMPLES_PER_LINE_LENGTH);
156 }
157 
159  return getInt(buffer, LINES_PER_TIEPOINT_OFFSET, LINES_PER_TIEPOINT_LENGTH);
160 }
161 
163  return getInt(buffer, SAMPLES_PER_TIEPOINT_OFFSET,
164  SAMPLES_PER_TIEPOINT_LENGTH);
165 }
166 
167 const string& MerisSPH::getQualityName() {
168  static string result("Quality ADS");
169  return result;
170 }
171 
172 const string& MerisSPH::getTiepointName() {
173  static string result("Tie points ADS");
174  return result;
175 }
176 
179  printf("\nMeris SPH\n");
180  printf("firstLineTime = %s\n", unix2merisTime(getFirstLineTime()).c_str());
181  printf("lastLineTime = %s\n", unix2merisTime(getLastLineTime()).c_str());
182 
183  printf("firstFirstLat = %f\n", getFirstFirstLat());
184  printf("firstFirstLon = %f\n", getFirstFirstLon());
185  printf("firstMidLat = %f\n", getFirstMidLat());
186  printf("firstMidLon = %f\n", getFirstMidLon());
187  printf("firstLastLat = %f\n", getFirstLastLat());
188  printf("firstLastLon = %f\n", getFirstLastLon());
189 
190  printf("lastFirstLat = %f\n", getLastFirstLat());
191  printf("lastFirstLon = %f\n", getLastFirstLon());
192  printf("lastMidLat = %f\n", getLastMidLat());
193  printf("lastMidLon = %f\n", getLastMidLon());
194  printf("lastLastLat = %f\n", getLastLastLat());
195  printf("lastLastLon = %f\n", getLastLastLon());
196 
197  printf("samplesPerLine = %d\n", getSamplesPerLine());
198  printf("linesPerTiepoint = %d\n", getLinesPerTiepoint());
199  printf("samplesPerTiepoint = %d\n", getSamplesPerTiepoint());
200 }
virtual void setLastFirstLat(double lat)
Definition: MerisSPH.cpp:110
virtual double getFirstLastLat()
Definition: MerisSPH.cpp:90
virtual double getFirstMidLat()
Definition: MerisSPH.cpp:74
virtual void setFirstLastLon(double lon)
Definition: MerisSPH.cpp:102
virtual std::string & getDescriptor()
Definition: MerisSPH.cpp:30
virtual double getLastMidLat()
Definition: MerisSPH.cpp:122
virtual void setFirstFirstLat(double lat)
Definition: MerisSPH.cpp:62
int getInt(const char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:50
virtual double getLastLastLon()
Definition: MerisSPH.cpp:146
virtual double getLastLineTime()
Definition: MerisSPH.cpp:47
float * lat
virtual void setLastLineTime(double unixTime)
Definition: MerisSPH.cpp:53
virtual void setLastFirstLon(double lon)
Definition: MerisSPH.cpp:118
virtual int getSamplesPerLine()
Definition: MerisSPH.cpp:154
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413
virtual void setFirstFirstLon(double lon)
Definition: MerisSPH.cpp:70
virtual double getFirstFirstLat()
Definition: MerisSPH.cpp:58
virtual void print()
Definition: MerisSPH.cpp:177
virtual double getFirstMidLon()
Definition: MerisSPH.cpp:82
virtual double getFirstLineTime()
Definition: MerisSPH.cpp:36
virtual double getLastFirstLon()
Definition: MerisSPH.cpp:114
double merisTime2unix(const string &timeStr)
Definition: EnvsatUtil.cpp:144
virtual const std::string & getTiepointName()
Definition: MerisSPH.cpp:172
void setString(const string &str, char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:33
virtual int getLinesPerTiepoint()
Definition: MerisSPH.cpp:158
void getString(const char *buffer, string &str, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:45
virtual void setLastMidLat(double lat)
Definition: MerisSPH.cpp:126
virtual double getFirstLastLon()
Definition: MerisSPH.cpp:98
virtual double getLastLastLat()
Definition: MerisSPH.cpp:138
const char * str
Definition: l1c_msi.cpp:35
void setLatLon(double val, char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:87
virtual void setFirstMidLon(double lon)
Definition: MerisSPH.cpp:86
MerisSPH(const MerisSPH &orig)
Definition: MerisSPH.cpp:16
virtual void print()
Definition: EnvsatSPH.cpp:158
virtual double getFirstFirstLon()
Definition: MerisSPH.cpp:66
float * lon
const string & unix2merisTime(double unixTime)
Definition: EnvsatUtil.cpp:160
virtual void setLastMidLon(double lon)
Definition: MerisSPH.cpp:134
double getLatLon(const char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:82
char * buffer
Definition: EnvsatSPH.h:94
virtual void setFirstLineTime(double unixTime)
Definition: MerisSPH.cpp:42
virtual double getLastFirstLat()
Definition: MerisSPH.cpp:106
virtual int getSamplesPerTiepoint()
Definition: MerisSPH.cpp:162
virtual double getLastMidLon()
Definition: MerisSPH.cpp:130
virtual void setFirstMidLat(double lat)
Definition: MerisSPH.cpp:78
virtual void setLastLastLon(double lon)
Definition: MerisSPH.cpp:150
virtual void setLastLastLat(double lat)
Definition: MerisSPH.cpp:142
virtual void setFirstLastLat(double lat)
Definition: MerisSPH.cpp:94
virtual const std::string & getQualityName()
Definition: MerisSPH.cpp:167