Go to the documentation of this file.
11 #include <sys/types.h>
47 void EnvsatFile::init(
const string&
name) {
68 sph = mph->createSPH();
80 fd = open(
filename.c_str(), O_RDONLY);
87 int result = mph->readHeader(fd);
90 sph = mph->createSPH();
92 printf(
"Error %s:%s:%d Could not create SPH\n", __FILE__, __func__,
96 return sph->readHeader(fd);
100 int result = mph->writeHeader(fd);
105 printf(
"Error %s:%s:%d Could not create SPH\n", __FILE__, __func__,
109 return sph->writeHeader(fd);
129 printf(
"EnvsatFile-----\n");
130 printf(
"File Name = %s\n", getFileName().c_str());
136 mph->printRecursive();
139 sph->printRecursive();
152 printf(
"Error %s:%s:%d SPH is NULL\n", __FILE__, __func__, __LINE__);
158 printf(
"Error %s:%s:%d Could not find first Measurement DSD\n",
159 __FILE__, __func__, __LINE__);
167 printf(
"Error %s:%s:%d SPH is NULL\n", __FILE__, __func__, __LINE__);
170 return sph->getSamplesPerLine();
191 printf(
"Error %s:%s:%d mph == NULL\n", __FILE__, __func__, __LINE__);
195 printf(
"Error %s:%s:%d sph == NULL\n", __FILE__, __func__, __LINE__);
203 string oldName = mph->getProductName();
204 string newName = oldName.substr(0, 14);
207 sprintf(
str,
"%04d%02d%02d_%02d%02d%02d_",
year, month,
day, hour,
min,
210 int deltaT =
abs((
int) (sph->getLastLineTime() - sph->getFirstLineTime()));
211 sprintf(
str,
"%08d", deltaT);
213 newName += oldName.substr(38, 17);
virtual EnvsatFile & operator=(const EnvsatFile &src)
virtual int writeData(EnvsatDSR *dsr)
virtual void setFileName(const std::string &name)
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
virtual int seekData(EnvsatDSD *dsd, int scanLine=0)
virtual int readData(int fin)
virtual EnvsatSPH * createSPH()
virtual EnvsatMPH * getMPH()
virtual int getNumScans()
virtual int64_t getDSRSize()
int init(int32_t ipr, int32_t jpr, char *efile, char *pfile)
virtual int readData(EnvsatDSR *dsr)
virtual int64_t getDSOffset()
virtual EnvsatSPH * getSPH()
char filename[FILENAME_MAX]
virtual void modifyProductName()
virtual int writeData(int fout)
virtual int writeHeader()
virtual void printRecursive()
virtual int openFile(bool write=false)
EnvsatFile(const EnvsatFile &orig)
virtual const std::string & getFileName()
void unix2ymdhms(double usec, int16_t *year, int16_t *mon, int16_t *day, int16_t *hour, int16_t *min, double *sec)
virtual int getNumPixels()