Go to the documentation of this file.
18 const char*
monthArray[12] = {
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
19 "AUG",
"SEP",
"OCT",
"NOV",
"DEC"};
22 return s.erase(
s.find_last_not_of(delimiters) + 1);
26 return s.erase(0,
s.find_first_not_of(delimiters));
29 string&
trim(
string&
s,
const string& delimiters) {
54 sprintf(formatStr,
"%%%dd",
size);
60 char tmpBuff[
size + 32];
62 sprintf(tmpBuff,
"%+0*d",
size,
val);
70 sprintf(formatStr,
"%%%dlld",
size);
76 char tmpBuff[
size + 32];
78 sprintf(tmpBuff,
"%+0*lld",
size, (
long long)
val);
84 return ((
double)
val) * 1.0e-6;
88 int64_t
i = round(
val * 1.0e6);
93 return (((buffer[
offset + 0] & 0xff) << 8) | (buffer[
offset + 1] & 0xff));
97 ((
unsigned char*) buffer)[
offset + 0] = (
val >> 8) & 0xff;
98 ((
unsigned char*) buffer)[
offset + 1] =
val & 0xff;
102 return (((buffer[
offset + 0] & 0xff) << 24)
103 | ((buffer[
offset + 1] & 0xff) << 16)
104 | ((buffer[
offset + 2] & 0xff) << 8) | (buffer[
offset + 3] & 0xff));
108 ((
unsigned char*) buffer)[
offset + 0] = (
val >> 24) & 0xff;
109 ((
unsigned char*) buffer)[
offset + 1] = (
val >> 16) & 0xff;
110 ((
unsigned char*) buffer)[
offset + 2] = (
val >> 8) & 0xff;
111 ((
unsigned char*) buffer)[
offset + 3] =
val & 0xff;
115 int day, sec, microsec;
123 trec.tm_year = 2000 - 1900;
125 trec.tm_mday =
day + 1;
135 return secSince + sec + microsec * 1.0e-6;
150 sscanf(timeStr.c_str(),
"%2hd-%3s-%4hd %2hd:%2hd:%lf", &
day, monthStr,
152 for (month = 0; month < 12; month++) {
156 sec += hour * 3600.0 +
min * 60.0;
165 static string timeStr;
174 double envsatInterp(
double x1,
double x2,
double y1,
double y2,
double xin) {
175 double m = (y2 - y1) / (x2 - x1);
string & trim_left(string &s, const string &delimiters)
These are used to scale the SD before writing it to the HDF4 file The default is and which means the product is not scaled at all Since the product is usually stored as a float inside of this is a way to write the float out as a integer l2prod min
int64_t getInt64(const char *buffer, unsigned int offset, int size)
int getRawInt32(const char *buffer, unsigned int offset)
const char * monthArray[12]
int getInt(const char *buffer, unsigned int offset, int size)
void setRawInt16(int val, char *buffer, unsigned int offset)
double getMJD(const char *buffer, unsigned int offset)
void setMJD(int day, int sec, int microsec, char *buffer, unsigned int offset)
void setInt64(int64_t val, char *buffer, unsigned int offset, int size)
double merisTime2unix(const string &timeStr)
int getRawInt16(const char *buffer, unsigned int offset)
void setString(const string &str, char *buffer, unsigned int offset, int size)
void getString(const char *buffer, string &str, unsigned int offset, int size)
string & trim(string &s, const string &delimiters)
void setRawInt32(int val, char *buffer, unsigned int offset)
void setLatLon(double val, char *buffer, unsigned int offset)
double envsatInterp(double x1, double x2, double y1, double y2, double xin)
const string & unix2merisTime(double unixTime)
double ymds2unix(short year, short month, short day, double secs)
string & trim_right(string &s, const string &delimiters)
double getLatLon(const char *buffer, unsigned int offset)
void unix2ymdhms(double usec, int16_t *year, int16_t *mon, int16_t *day, int16_t *hour, int16_t *min, double *sec)
void setInt(int val, char *buffer, unsigned int offset, int size)