32 static ossimTrace traceDebug(
"ossimAlosPalsarModel:debug");
40 RTTI_DEF1(ossimAlosPalsarModel,
"ossimAlosPalsarModel", ossimGeometricSarSensorModel);
44 theAlosPalsarLeader(NULL),
45 theAlosPalsarData(NULL)
75 std::cout <<
"WARNING: getSlantRangeFromGeoreferenced not implemented for AlosPalsar" << std::endl;
81 const char* wave_length_str = kwl.
find(prefix,
"wave_length");
82 double wave_length = atof(wave_length_str);
83 const char* fr_str = kwl.
find(prefix,
"fr");
84 double fr = atof(fr_str) * 1e6;
85 const char* fa_str = kwl.
find(prefix,
"fa");
86 double fa = atof(fa_str);
96 const char* ellip_maj_str = kwl.
find(prefix,
"ellip_maj");
97 double ellip_maj = atof(ellip_maj_str) * 1000.0;
98 const char* ellip_min_str = kwl.
find(prefix,
"ellip_min");
99 double ellip_min = atof(ellip_min_str) * 1000.0;
101 const char* dopcen_str = kwl.
find(prefix,
"dopcen_range[0]");
102 double dopcen = atof(dopcen_str);
103 const char* dopcenLinear_str = kwl.
find(prefix,
"dopcen_range[1]");
104 double dopcenLinear = atof(dopcenLinear_str);
141 double nlooks_az = atof(kwl.
find(prefix,
"nlooks_az"));
143 double n_rnglok = atof(kwl.
find(prefix,
"n_rnglok"));
161 static const char MODULE[] =
"ossimAlosPalsarModel::open";
166 << MODULE <<
" entered...\n" 167 <<
"file: " << file <<
"\n";
200 << leaFilename <<
" is AlosPalsar leader file..." 202 <<
"Begin reading Leader file" << std::endl;
214 <<
"End reading Leader file" << std::endl;
224 << datFilename <<
" is AlosPalsar data file..." 226 <<
"Begin reading Data file header" << std::endl;
238 <<
"End reading Data file header" << std::endl;
257 << MODULE <<
" exit status = " << (result ?
"true" :
"false\n")
267 const char* prefix)
const 269 static const char MODULE[] =
"ossimAlosPalsarModel::saveState";
282 std::cout <<
"Error: AlosPalsarLeader is NULL" << std::endl;
292 std::cout <<
"Error: AlosPalsarData is NULL" << std::endl;
301 << MODULE <<
" exit status = " << (result ?
"true" :
"false\n")
310 static const char MODULE[] =
"ossimAlosPalsarModel::loadState";
317 const char* lookup = 0;
341 <<
"\nCan't init platform position \n";
354 <<
"\nCan't init sensor parameters \n";
368 <<
"\nCan't init ref point \n";
401 const char* eph_year_str = kwl.
find(prefix,
"eph_year");
402 int eph_year = atoi(eph_year_str);
403 const char* eph_month_str = kwl.
find(prefix,
"eph_month");
404 int eph_month = atoi(eph_month_str);
405 const char* eph_day_str = kwl.
find(prefix,
"eph_day");
406 int eph_day = atoi(eph_day_str);
407 const char* eph_sec_str = kwl.
find(prefix,
"eph_sec");
408 double eph_sec = atof(eph_sec_str);
413 ref_civil_date.
set_day(eph_day);
415 ref_civil_date.
set_decimal(eph_sec - (
double)((
int)eph_sec));
422 const char* eph_int_str = kwl.
find(prefix,
"eph_int");
423 double eph_int = atof(eph_int_str);
427 const char* neph_str = kwl.
find(prefix,
"neph");
428 int neph = atoi(neph_str);
435 for (
int i = 0; i < neph; i++)
442 sprintf(name,
"eph%i_posX", i);
443 const char* px_str = kwl.
find(prefix, name);
444 pos[0] = atof(px_str);
446 sprintf(name,
"eph%i_posY", i);
447 const char* py_str = kwl.
find(prefix, name);
448 pos[1] = atof(py_str);
450 sprintf(name,
"eph%i_posZ", i);
451 const char* pz_str = kwl.
find(prefix, name);
452 pos[2] = atof(pz_str);
455 sprintf(name,
"eph%i_velX", i);
456 const char* vx_str = kwl.
find(prefix, name);
457 vit[0] = atof(vx_str);
459 sprintf(name,
"eph%i_velY", i);
460 const char* vy_str = kwl.
find(prefix, name);
461 vit[1] = atof(vy_str);
463 sprintf(name,
"eph%i_velZ", i);
464 const char* vz_str = kwl.
find(prefix, name);
465 vit[2] = atof(vz_str);
491 for (
int i = 0; i < neph; i++)
502 const char* sc_lin_str = kwl.
find(prefix,
"sc_lin");
503 double sc_lin = atof(sc_lin_str);
505 const char* sc_pix_str = kwl.
find(prefix,
"sc_pix");
506 double sc_pix = atof(sc_pix_str);
508 const char* inp_sctim_str = kwl.
find(prefix,
"inp_sctim");
523 for (
int i = 0; i < 4; i++)
525 year_str[i] = inp_sctim_str[i];
530 for (
int i = 4; i < 6; i++)
532 month_str[i-4] = inp_sctim_str[i];
537 for (
int i = 6; i < 8; i++)
539 day_str[i-6] = inp_sctim_str[i];
544 for (
int i = 8; i < 10; i++)
546 hour_str[i-8] = inp_sctim_str[i];
551 for (
int i = 10; i < 12; i++)
553 min_str[i-10] = inp_sctim_str[i];
558 for (
int i = 12; i < 14; i++)
560 sec_str[i-12] = inp_sctim_str[i];
565 for (
int i = 14; i < 17; i++)
567 mili_str[i-14] = inp_sctim_str[i];
571 int year = atoi(year_str);
572 int month = atoi(month_str);
573 int day = atoi(day_str);
574 int hour = atoi(hour_str);
575 int min = atoi(min_str);
576 int sec = atoi(sec_str);
577 double mili = atof(mili_str);
580 CivilDateTime date(year, month, day, hour * 3600 +
min * 60 + sec, mili / 1000.0);
585 if (ephemeris == NULL)
return false ;
595 const double c = 2.99792458e+8;
597 const char* slantRange = kwl.
find(prefix,
"slant_range_to_1st_data_sample");
603 const char* nbCol_str = kwl.
find(prefix,
"num_pix_in_line");
604 const char* nbLin_str = kwl.
find(prefix,
"num_lines");
673 char alosFileName[16];
676 if (candidate.bad() || candidate.eof())
680 candidate.read(alosFileName, 16);
681 if (candidate.bad() || candidate.eof())
689 if ((ersString.
find(
"AL1 ") == 0) &&
690 (ersString.
find(
"PSR") == 4) &&
691 (ersString.
find(
"SARL") == 8))
715 if ((prefix == imgPrefix) ||
716 (prefix == trlPrefix) ||
717 (prefix == volPrefix))
736 char alosFileName[16];
739 if (candidate.bad() || candidate.eof())
743 candidate.read(alosFileName, 16);
744 if (candidate.bad() || candidate.eof())
752 if ((ersString.
find(
"AL1 ") == 0) &&
753 (ersString.
find(
"PSR") == 4) &&
754 (ersString.
find(
"IMOP") == 8))
776 if ((prefix == leaPrefix) ||
777 (prefix == trlPrefix) ||
778 (prefix == volPrefix))
This class represent an ephemeris in Geographic coordinates system.
virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Sensor Params from a projection keywordlist.
void set_month(int month)
AlosPalsarLeader * theAlosPalsarLeader
List of metadata contained in the Leader file.
virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Reference Point from a projection keywordlist.
void set_sightDirection(SightDirection sight)
This class represents a date and time in the civil format.
static ossimString upcase(const ossimString &aString)
AlosPalsarData * theAlosPalsarData
List of metadata contained in the Data file.
virtual ossimFilename findAlosPalsarLeader(const ossimFilename &file) const
virtual bool isAlosPalsarData(const ossimFilename &file) const
void set_dopcen(double value)
This class is able to read the Leader file of the AlosPalsar file structure.
ossimFilename & setFile(const ossimString &f)
RTTI_DEF1(ossimAlosPalsarModel, "ossimAlosPalsarModel", ossimGeometricSarSensorModel)
Represents serializable keyword/value map.
void set_dopcenLinear(double value)
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
virtual double getSlantRangeFromGeoreferenced(double col) const
This function associates an image column number to a slant range when the image is georeferenced (gro...
This class handles the sensor parameters.
void set_pix_line(double pix_line)
virtual ossimFilename findAlosPalsarData(const ossimFilename &file) const
static const char * TYPE_KW
virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Platform Position from a projection keywordlist.
void set_pix_col(double pix_col)
bool _isProductGeoreferenced
True iff the product is ground range.
void set_semiMinorAxis(double value)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
void set_second(double second)
virtual ossimObject * dup() const
Returns pointer to a new instance, copy of this.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
This class represents an ephemeris.
void set_decimal(double decimal)
virtual ossimString getClassName() const
Method to return the class name.
std::string::size_type size() const
This class is able to read the Leader file of the AlosPalsar file structure.
ossimAlosPalsarModel()
Constructor.
void set_semiMajorAxis(double value)
double get_second() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
virtual ~ossimAlosPalsarModel()
Destructor.
void set_nRangeLook(double look)
bool open(const ossimFilename &file)
Method to instantiate model from the leader file.
virtual std::ostream & print(std::ostream &out) const
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Slant Range for each Ground Range data sets : theNumberSRGR,theSRGRCoeffset,_srgr_update,thePixelSpacing,_isProductGeoreferenced.
ossimFilename fileNoExtension() const
std::string & replace(std::string::size_type pos, std::string::size_type n, const std::string &s)
Replaces a substring of *this with the string s.
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)
std::string substr(std::string::size_type pos=0, std::string::size_type n=std::string::npos) const
Equivalent to basic_string(*this, pos, n).
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
virtual bool isAlosPalsarLeader(const ossimFilename &file) const
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)