OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
EnvsatUtil.h
Go to the documentation of this file.
1 /*
2  * File: EnvsatUtil.h
3  * Author: dshea
4  *
5  * Created on December 10, 2012, 12:33 PM
6  */
7 
8 #ifndef ENVSATUTIL_H
9 #define ENVSATUTIL_H
10 
11 #include <string>
12 #include <stdint.h>
13 
15 static const unsigned int UTC_DATE_LENGTH = 27;
16 static const unsigned int LAT_LON_LENGTH = 11;
17 
18 std::string& trim_right(std::string& s, const std::string& delimiters =
19  " \n\r\t");
21  const std::string& delimiters = " \n\r\t");
22 std::string& trim(std::string& s, const std::string& delimiters = " \n\r\t");
23 
24 // generic set and get of string out of buffer
25 void setString(const std::string &str, char* buffer, unsigned int offset,
26  int size);
27 void getString(const char* buffer, std::string &str, unsigned int offset,
28  int size);
29 
30 int getInt(const char* buffer, unsigned int offset, int size);
31 void setInt(int val, char* buffer, unsigned int offset, int size);
32 int64_t getInt64(const char* buffer, unsigned int offset, int size);
33 void setInt64(int64_t val, char* buffer, unsigned int offset, int size);
34 
38 double getLatLon(const char* buffer, unsigned int offset);
39 void setLatLon(double val, char* buffer, unsigned int offset);
40 
41 int getRawInt16(const char* buffer, unsigned int offset);
42 void setRawInt16(int val, char* buffer, unsigned int offset);
43 int getRawInt32(const char* buffer, unsigned int offset);
44 void setRawInt32(int val, char* buffer, unsigned int offset);
45 
46 double getMJD(const char* buffer, unsigned int offset);
47 void setMJD(int day, int sec, int microsec, char* buffer, unsigned int offset);
48 
49 double merisTime2unix(const std::string& timeStr);
50 const std::string& unix2merisTime(double unixTime);
51 
52 double envsatInterp(double x1, double x2, double y1, double y2, double xin);
53 
54 #endif /* ENVSATUTIL_H */
int64_t getInt64(const char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:66
int32_t day
void setInt64(int64_t val, char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:75
std::string & trim(std::string &s, const std::string &delimiters=" \n\r\t")
void setRawInt32(int val, char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:107
@ string
int getRawInt32(const char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:101
int getInt(const char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:50
std::string & trim_left(std::string &s, const std::string &delimiters=" \n\r\t")
void setRawInt16(int val, char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:96
int getRawInt16(const char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:92
void setString(const std::string &str, char *buffer, unsigned int offset, int size)
double getLatLon(const char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:82
void setLatLon(double val, char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:87
double envsatInterp(double x1, double x2, double y1, double y2, double xin)
Definition: EnvsatUtil.cpp:174
const char * str
Definition: l1c_msi.cpp:35
void setMJD(int day, int sec, int microsec, char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:138
void setInt(int val, char *buffer, unsigned int offset, int size)
Definition: EnvsatUtil.cpp:59
double getMJD(const char *buffer, unsigned int offset)
Definition: EnvsatUtil.cpp:114
data_t s[NROOTS]
Definition: decode_rs.h:75
const std::string & unix2merisTime(double unixTime)
Definition: EnvsatUtil.cpp:160
std::string & trim_right(std::string &s, const std::string &delimiters=" \n\r\t")
l2prod offset
msiBandIdx val
Definition: l1c_msi.cpp:34
double merisTime2unix(const std::string &timeStr)
void getString(const char *buffer, std::string &str, unsigned int offset, int size)