29 static ossimTrace traceDebug(
"ossimErsSarModel:debug");
38 RTTI_DEF1(ossimErsSarModel,
"ossimErsSarModel", ossimGeometricSarSensorModel);
71 const double c = 2.99792458e+8;
78 const char* wave_length_str = kwl.
find(prefix,
"wave_length");
79 double wave_length = atof(wave_length_str);
80 const char* fr_str = kwl.
find(prefix,
"fr");
81 double fr = atof(fr_str) * 1e6;
82 const char* fa_str = kwl.
find(prefix,
"fa");
83 double fa = atof(fa_str);
93 const char* ellip_maj_str = kwl.
find(prefix,
"ellip_maj");
94 double ellip_maj = atof(ellip_maj_str) * 1000.0;
95 const char* ellip_min_str = kwl.
find(prefix,
"ellip_min");
96 double ellip_min = atof(ellip_min_str) * 1000.0;
105 if (strcmp(time_dir_pix.
c_str(),
"INCREASE") == 0)
114 if (strcmp(time_dir_lin.
c_str(),
"INCREASE") == 0)
125 double nlooks_az = atof(kwl.
find(prefix,
"nlooks_az"));
127 double n_rnglok = atof(kwl.
find(prefix,
"n_rnglok"));
142 static const char MODULE[] =
"ossimErsSarModel::open";
147 << MODULE <<
" entered...\n" 148 <<
"file: " << file <<
"\n";
179 <<
"Begin reading Leader file" << std::endl;
191 <<
"End reading Leader file" << std::endl;
209 << MODULE <<
" exit status = " << (result ?
"true" :
"false\n")
223 static const char MODULE[] =
"ossimErsSarModel::saveState";
236 std::cout <<
"Error: ErsSarleader is NULL" << std::endl;
245 << MODULE <<
" exit status = " << (result ?
"true" :
"false\n")
254 static const char MODULE[] =
"ossimErsSarModel::loadState";
261 const char* lookup = 0;
285 <<
"\nCan't init platform position \n";
298 <<
"\nCan't init sensor parameters \n";
312 <<
"\nCan't init ref point \n";
326 <<
"\nCan't init ref point \n";
341 const char* eph_year_str = kwl.
find(prefix,
"eph_year");
342 int eph_year = atoi(eph_year_str);
343 const char* eph_month_str = kwl.
find(prefix,
"eph_month");
344 int eph_month = atoi(eph_month_str);
345 const char* eph_day_str = kwl.
find(prefix,
"eph_day");
346 int eph_day = atoi(eph_day_str);
347 const char* eph_sec_str = kwl.
find(prefix,
"eph_sec");
348 double eph_sec = atof(eph_sec_str);
352 ref_civil_date.
set_day(eph_day);
354 ref_civil_date.
set_decimal(eph_sec - (
double)((
int)eph_sec));
361 const char* eph_int_str = kwl.
find(prefix,
"eph_int");
362 double eph_int = atof(eph_int_str);
366 const char* neph_str = kwl.
find(prefix,
"neph");
367 int neph = atoi(neph_str);
374 for (
int i = 0; i < neph; i++)
381 sprintf(name,
"eph%i_posX", i);
382 const char* px_str = kwl.
find(prefix, name);
383 pos[0] = atof(px_str);
385 sprintf(name,
"eph%i_posY", i);
386 const char* py_str = kwl.
find(prefix, name);
387 pos[1] = atof(py_str);
389 sprintf(name,
"eph%i_posZ", i);
390 const char* pz_str = kwl.
find(prefix, name);
391 pos[2] = atof(pz_str);
394 sprintf(name,
"eph%i_velX", i);
395 const char* vx_str = kwl.
find(prefix, name);
396 vit[0] = atof(vx_str);
398 sprintf(name,
"eph%i_velY", i);
399 const char* vy_str = kwl.
find(prefix, name);
400 vit[1] = atof(vy_str);
402 sprintf(name,
"eph%i_velZ", i);
403 const char* vz_str = kwl.
find(prefix, name);
404 vit[2] = atof(vz_str);
430 for (
int i = 0; i < neph; i++)
441 const char* sc_lin_str = kwl.
find(prefix,
"sc_lin");
442 double sc_lin = atof(sc_lin_str);
444 const char* sc_pix_str = kwl.
find(prefix,
"sc_pix");
445 double sc_pix = atof(sc_pix_str);
447 const char* inp_sctim_str = kwl.
find(prefix,
"inp_sctim");
449 const char* rng_gate_str = kwl.
find(prefix,
"zero_dop_range_time_f_pixel");
450 double rng_gate = atof(rng_gate_str);
461 for (
int i = 0; i < 4; i++)
463 year_str[i] = inp_sctim_str[i];
468 for (
int i = 4; i < 6; i++)
470 month_str[i-4] = inp_sctim_str[i];
475 for (
int i = 6; i < 8; i++)
477 day_str[i-6] = inp_sctim_str[i];
482 for (
int i = 8; i < 10; i++)
484 hour_str[i-8] = inp_sctim_str[i];
489 for (
int i = 10; i < 12; i++)
491 min_str[i-10] = inp_sctim_str[i];
496 for (
int i = 12; i < 14; i++)
498 sec_str[i-12] = inp_sctim_str[i];
503 for (
int i = 14; i < 17; i++)
505 mili_str[i-14] = inp_sctim_str[i];
509 int year = atoi(year_str);
510 int month = atoi(month_str);
511 int day = atoi(day_str);
512 int hour = atoi(hour_str);
513 int min = atoi(min_str);
514 int sec = atoi(sec_str);
515 double mili = atof(mili_str);
518 CivilDateTime date(year, month, day, hour * 3600 +
min * 60 + sec, mili / 1000.0);
523 if (ephemeris == NULL)
return false ;
533 double c = 2.99792458e+8;
540 const char* nbCol_str = kwl.
find(prefix,
"num_pix");
541 const char* nbLin_str = kwl.
find(prefix,
"num_lines");
547 std::list<ossimGpt> groundGcpCoordinates ;
548 std::list<ossimDpt> imageGcpCoordinates ;
550 const char* lon_str = kwl.
find(
"first_line_first_pixel_lon");
551 double lon = atof(lon_str);
552 const char* lat_str = kwl.
find(
"first_line_first_pixel_lat");
553 double lat = atof(lat_str);
554 if (lon > 180.0) lon -= 360.0;
557 groundGcpCoordinates.push_back(groundGCP1) ;
558 imageGcpCoordinates.push_back(imageGCP1) ;
560 lon_str = kwl.
find(
"first_line_last_pixel_lon");
562 lat_str = kwl.
find(
"first_line_last_pixel_lat");
564 if (lon > 180.0) lon -= 360.0;
567 groundGcpCoordinates.push_back(groundGCP2) ;
568 imageGcpCoordinates.push_back(imageGCP2) ;
570 lon_str = kwl.
find(
"last_line_last_pixel_lon");
572 lat_str = kwl.
find(
"last_line_last_pixel_lat");
574 if (lon > 180.0) lon -= 360.0;
577 groundGcpCoordinates.push_back(groundGCP3) ;
578 imageGcpCoordinates.push_back(imageGCP3) ;
580 lon_str = kwl.
find(
"last_line_first_pixel_lon");
582 lat_str = kwl.
find(
"last_line_first_pixel_lat");
584 if (lon > 180.0) lon -= 360.0;
587 groundGcpCoordinates.push_back(groundGCP4) ;
588 imageGcpCoordinates.push_back(imageGCP4) ;
602 string::size_type loc = filename.
find(
"PRI");
603 if (loc != string::npos)
616 double t1 = atof(kwl.
find(
"zero_dop_range_time_f_pixel")) * 1e-3;
617 double t2 = atof(kwl.
find(
"zero_dop_range_time_c_pixel")) * 1e-3;
618 double t3 = atof(kwl.
find(
"zero_dop_range_time_l_pixel")) * 1e-3;
623 double x2 = atof(kwl.
find(
"sc_pix")) - 1.0;
624 double x3 = 2.0 * (x2 + 1.0) - 1.0 ;
627 theSRGRCoeffset[0][1] = ((t2 - t1) / (x2 * x2) + (t1 - t3) / (x3 * x3)) / ((1.0 / x2) - (1.0 / x3));
636 char ersFileName[16];
639 if (candidate.bad() || candidate.eof())
643 candidate.read(ersFileName, 16);
644 if (candidate.bad() || candidate.eof())
652 if ((ersString.
find(
"ERS") == 0) &&
653 (ersString.
find(
".SAR.") == 4) &&
654 (ersString.
find(
"LEAD") == 12))
This class represent an ephemeris in Geographic coordinates system.
void set_month(int month)
void set_sightDirection(SightDirection sight)
This class represents a date and time in the civil format.
static ossimString upcase(const ossimString &aString)
ossimFilename & setFile(const ossimString &f)
RTTI_DEF1(ossimAlosPalsarModel, "ossimAlosPalsarModel", ossimGeometricSarSensorModel)
Represents serializable keyword/value map.
std::basic_ifstream< char > ifstream
Class for char input file streams.
const char * find(const char *key) const
This class handles the referential point.
void set_lin_direction(int dir)
void set_second(int second)
double get_nRangeLook() const
This class handles the sensor parameters.
void set_pix_line(double pix_line)
static const char * TYPE_KW
void set_pix_col(double pix_col)
bool _isProductGeoreferenced
True iff the product is ground range.
void set_semiMinorAxis(double value)
void set_second(double second)
This class represents an ephemeris.
void set_decimal(double decimal)
void set_semiMajorAxis(double value)
double get_second() const
void set_nRangeLook(double look)
virtual std::ostream & print(std::ostream &out) const
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
ossimFilename fileNoExtension() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
void set_nAzimuthLook(double look)
virtual bool optimizeModel(const std::list< ossimGpt > &groundCoordinates, const std::list< ossimDpt > &imageCoordinates)
This function optimizes the model according to a list of Ground Control Points.
void set_ephemeris(Ephemeris *ephemeris)
void set_col_direction(int dir)
This class represents a date.
float distance(double lat1, double lon1, double lat2, double lon2, int units)
void set_distance(double distance)
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)