35 RTTI_DEF1(ossimEnvisatAsarModel,
"ossimEnvisatAsarModel", ossimGeometricSarSensorModel);
38 static ossimTrace traceDebug(
"ossimEnvisatAsarModel:debug");
43 _EnvisatAsarData(NULL)
71 double GR, GR0, relativeGroundRange, slantRange;
79 relativeGroundRange = GR-GR0;
80 slantRange = coefset[1]
81 + coefset[2]*relativeGroundRange
82 + coefset[3]*pow(relativeGroundRange,2)
83 + coefset[4]*pow(relativeGroundRange,3)
84 + coefset[5]*pow(relativeGroundRange,4);
98 <<
"Attempting to open file " << file << std::endl;
126 if (mph_rec.is_valid())
161 const char* prefix)
const 272 kwl.
add(prefix,
"UL_lat", (
double)(GG_rec->
get_lats())[0],
true );
273 kwl.
add(prefix,
"UL_lon", (
double)(GG_rec->
get_longs())[0],
true );
276 kwl.
add(prefix,
"UR_lat", (
double)(GG_rec->
get_lats())[10],
true );
277 kwl.
add(prefix,
"UR_lon", (
double)(GG_rec->
get_longs())[10],
true );
288 kwl.
add(prefix,
"LL_lat", (
double)(GG_rec->
get_lats())[0],
true );
289 kwl.
add(prefix,
"LL_lon", (
double)(GG_rec->
get_longs())[0],
true );
292 kwl.
add(prefix,
"LR_lat", (
double)(GG_rec->
get_lats())[10],
true );
293 kwl.
add(prefix,
"LR_lon", (
double)(GG_rec->
get_longs())[10],
true );
305 if(SRGRParameters != NULL)
309 for (
int i=0;i<n_srgr;i++)
313 sprintf(name,
"srgr_update_day%i",i);
316 sprintf(name,
"srgr_update_sec%i",i);
319 sprintf(name,
"srgr_update_microsec%i",i);
322 sprintf(name,
"srgr_coef%iA",i);
325 sprintf(name,
"srgr_coef%iB",i);
327 sprintf(name,
"srgr_coef%iC",i);
329 sprintf(name,
"srgr_coef%iD",i);
331 sprintf(name,
"srgr_coef%iE",i);
333 sprintf(name,
"srgr_coef%iF",i);
338 kwl.
add(prefix,
"n_srgr" , n_srgr,
true);
356 std::ios_base::fmtflags f = out.flags();
358 out << setprecision(15) << setiosflags(ios::fixed)
359 <<
"\nossimEnvisatAsarModel data members:\n" 361 <<
"_n_srgr: " <<
_n_srgr <<
"\n";
374 const double CLUM = 2.99792458e+8;
375 const char* wave_length_str = kwl.
find(prefix,
"wave_length");
376 double wave_length = CLUM / atof(wave_length_str);
377 const char* fr_str = kwl.
find(prefix,
"range_sampling_rate");
378 double fr = atof(fr_str);
385 const char* fa_str = kwl.
find(prefix,
"prf");
390 const char* fa_str = kwl.
find(prefix,
"line_time_interval");
391 fa = 1.0/atof(fa_str);
395 const char* time_dir_pix =
"INCREASE";
396 const char* time_dir_lin =
"INCREASE";
405 if(strcmp(time_dir_pix,
"INCREASE") == 0)
414 if(strcmp(time_dir_lin,
"INCREASE") == 0)
440 for (
int i=1;i<=neph;i++)
449 sprintf(name,
"state_vector_time_%i_day",i);
450 long day = (long) atof(kwl.
find(prefix,name));
451 sprintf(name,
"state_vector_time_%i_sec",i);
452 unsigned long sec = (
unsigned long) atof(kwl.
find(prefix,name));
453 sprintf(name,
"state_vector_time_%i_microsec",i);
454 unsigned long microsec = (
unsigned long) atof(kwl.
find(prefix,name));
460 sprintf(name,
"x_pos_%i",i);
461 pos[0] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-2;
462 sprintf(name,
"y_pos_%i",i);
463 pos[1] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-2;
464 sprintf(name,
"z_pos_%i",i);
465 pos[2] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-2;
469 sprintf(name,
"x_vel_%i",i);
470 vel[0] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-5;
471 sprintf(name,
"y_vel_%i",i);
472 vel[1] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-5;
473 sprintf(name,
"z_vel_%i",i);
474 vel[2] = (double) atoi(kwl.
find(prefix,name)) * 1.0e-5;
478 ephemeris[i-1] = eph;
491 for (
int i=0;i<neph;i++)
510 double sc_pix = atof(kwl.
find(prefix,
"samp_num")) - 1.0;
512 double sc_lin = atof(kwl.
find(prefix,
"line_num")) - 1.0;
516 double c = 2.99792458e+8;
517 double distance = atof(kwl.
find(prefix,
"slant_range_time")) * (c/2.0) * 1.0e-9;
522 long day_ref = (long)atof(kwl.
find(prefix,
"first_zero_doppler_time_day"));
523 unsigned long sec_ref = (
unsigned long)atof(kwl.
find(prefix,
"first_zero_doppler_time_sec"));
524 unsigned long microsec_ref = (
unsigned long)atof(kwl.
find(prefix,
"first_zero_doppler_time_microsec"));
526 MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref);
532 if (ephemeris == NULL)
return false ;
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 ;
549 double h = atof(kwl.
find(
"avg_scene_height"));
552 double line = atof(kwl.
find(
"UL_line")) - 1;
553 double col = atof(kwl.
find(
"UL_col")) - 1;
554 double lon = atof(kwl.
find(
"UL_lon")) * 1e-6;
555 double lat = atof(kwl.
find(
"UL_lat")) * 1e-6;
556 if (lon > 180.0) lon -= 360.0;
559 groundGcpCoordinates.push_back(groundGCP1) ;
560 imageGcpCoordinates.push_back(imageGCP1) ;
562 line = atof(kwl.
find(
"UR_line")) - 1;
563 col = atof(kwl.
find(
"UR_col")) - 1;
564 lon = atof(kwl.
find(
"UR_lon")) * 1e-6;
565 lat = atof(kwl.
find(
"UR_lat")) * 1e-6;
566 if (lon > 180.0) lon -= 360.0;
569 groundGcpCoordinates.push_back(groundGCP2) ;
570 imageGcpCoordinates.push_back(imageGCP2) ;
572 line = atof(kwl.
find(
"LR_line")) - 1;
573 col = atof(kwl.
find(
"LR_col")) - 1;
574 lon = atof(kwl.
find(
"LR_lon")) * 1e-6;
575 lat = atof(kwl.
find(
"LR_lat")) * 1e-6;
576 if (lon > 180.0) lon -= 360.0;
579 groundGcpCoordinates.push_back(groundGCP3) ;
580 imageGcpCoordinates.push_back(imageGCP3) ;
582 line = atof(kwl.
find(
"LL_line")) - 1;
583 col = atof(kwl.
find(
"LL_col")) - 1;
584 lon = atof(kwl.
find(
"LL_lon")) * 1e-6;
585 lat = atof(kwl.
find(
"LL_lat")) * 1e-6;
586 if (lon > 180.0) lon -= 360.0;
589 groundGcpCoordinates.push_back(groundGCP4) ;
590 imageGcpCoordinates.push_back(imageGCP4) ;
613 sprintf(name,
"srgr_update_day%i",i);
614 long day_ref = (long)atof(kwl.
find(prefix,name));
615 sprintf(name,
"srgr_update_sec%i",i);
616 unsigned long sec_ref = (
unsigned long)atof(kwl.
find(prefix,name));
617 sprintf(name,
"srgr_update_microsec%i",i);
618 unsigned long microsec_ref = (
unsigned long)atof(kwl.
find(prefix,name));
619 MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref);
623 std::vector<double> srgr_set;
625 sprintf(name,
"srgr_coef%iA",i);
626 const char* srgr_coef_strA = kwl.
find(prefix,name);
627 srgr_set.push_back(atof(srgr_coef_strA));
628 sprintf(name,
"srgr_coef%iB",i);
629 const char* srgr_coef_strB = kwl.
find(prefix,name);
630 srgr_set.push_back(atof(srgr_coef_strB));
631 sprintf(name,
"srgr_coef%iC",i);
632 const char* srgr_coef_strC = kwl.
find(prefix,name);
633 srgr_set.push_back(atof(srgr_coef_strC));
634 sprintf(name,
"srgr_coef%iD",i);
635 const char* srgr_coef_strD = kwl.
find(prefix,name);
636 srgr_set.push_back(atof(srgr_coef_strD));
637 sprintf(name,
"srgr_coef%iE",i);
638 const char* srgr_coef_strE = kwl.
find(prefix,name);
639 srgr_set.push_back(atof(srgr_coef_strE)*1e-10);
640 sprintf(name,
"srgr_coef%iF",i);
641 const char* srgr_coef_strF = kwl.
find(prefix,name);
642 srgr_set.push_back(atof(srgr_coef_strF)*1e-10);
656 std::vector<double> delays;
662 delays.push_back( fabs(delay) );
666 double min_delay = delays[0] ;
669 if (delays[i]<min_delay) {
671 min_delay = delays[i] ;
This class represent an ephemeris in Geographic coordinates system.
unsigned int get_num_samples_per_line()
num_samples_per_line
This class is able to read the SAR sph record of the ASAR file.
float get_ground_range_origin()
input_std_dev_flag
virtual ossimString getClassName() const
Method to return the class name.
unsigned int get_state_vector_time_3_sec()
state_vector_time_3 sec
This class represents a date and time in the civil format.
MainProcessingParameters * get_MainProcessingParameters()
virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced.
int get_state_vector_time_3_day()
state_vector_time_3 day
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
RTTI_DEF1(ossimAlosPalsarModel, "ossimAlosPalsarModel", ossimGeometricSarSensorModel)
Represents serializable keyword/value map.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Ephemeris * get_ephemeris()
unsigned int get_state_vector_time_4_microsec()
state_vector_time_4 microsec
const char * find(const char *key) const
unsigned int get_state_vector_time_4_sec()
state_vector_time_1 sec
int get_first_zero_doppler_time_day()
first_zero_doppler_time day
unsigned int get_first_zero_doppler_time_microsec()
first_zero_doppler_time micro sec
This class handles the referential point.
void set_lin_direction(int dir)
int get_state_vector_time_5_day()
state_vector_time_5 day
GeolocationGrid * get_GeolocationGrid(int num_ds=0)
unsigned int get_num_output_lines()
num_output_lines
This class represents an MJD date (Modified Julian date)
virtual std::ostream & print(std::ostream &out) const
unsigned int * get_samp_numbers()
samp_numbvers
std::vector< double > FindSRGRSetNumber(JSDDateTime date) const
Finds the SRGR data set which update time is the closest to the center scene time.
unsigned int get_state_vector_time_2_sec()
state_vector_time_2 sec
This class handles the sensor parameters.
virtual double getSlantRangeFromGeoreferenced(double col) const
This function associates an image column number to a slant range when the image is georeferenced (gro...
float * get_slant_range_times()
slant_range_times
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.
unsigned int get_state_vector_time_2_microsec()
state_vector_time_1 microsec
int _n_srgr
Slant Range to Ground Range (SRGR) number of coefficients sets.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int get_state_vector_time_1_sec()
state_vector_time_1 sec
This class represents an ephemeris.
std::string get_line_time_interval()
line_time_interval
int get_state_vector_time_1_day()
state_vector_time_1 day
virtual ~ossimEnvisatAsarModel()
Destructor.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
double _pixel_spacing
Pixel spacing.
bool open(const ossimFilename &file)
Method to intantial model from a file.
This class is able to read the ASAR MainProcessingParameters record.
This class is able to read the Envisat file structure.
double get_second() const
bool get_srgr_flag()
srgr_flag
unsigned int get_state_vector_time_5_sec()
state_vector_time_5 sec
float get_avg_scene_height_ellpsoid()
avg_scene_height_ellpsoid
std::string get_range_spacing()
range_spacing
TYPE_DATA EnvisatAsarData * _EnvisatAsarData
List of metadata contained in the Data file.
std::vector< std::vector< double > > _srgr_coefset
SRGR coefficient sets.
unsigned int get_first_zero_doppler_time_microsec()
first_zero_doppler_time micro sec
int get_state_vector_time_2_day()
state_vector_time_2 day
This class is able to read the ASAR mph record of the leader file.
virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Reference Point from a projection keywordlist.
int get_state_vector_time_4_day()
state_vector_time_4 day
unsigned int get_state_vector_time_1_microsec()
state_vector_time_1 microsec
unsigned int get_first_zero_doppler_time_sec()
first_zero_doppler_time second
unsigned int get_state_vector_time_5_microsec()
state_vector_time_5 microsec
unsigned int get_state_vector_time_3_microsec()
state_vector_time_3 microsec
unsigned int get_line_num()
line_num
int get_col_direction() const
virtual std::ostream & print(std::ostream &out) const
ossimDrect theImageClipRect
PlatformPosition * _platformPosition
Handle the position of the platform.
This class is able to read the ASAR SRGRConversionParameters record.
virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Sensor Params from a projection keywordlist.
float get_prf()
prf (i.e prf_values[0])
double get_decimal() const
SRGRConversionParameters * get_SRGRConversionParameters(int pos=0)
std::vector< JSDDateTime > _srgr_update
SRGR coefficient sets update times.
virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix)
Initializes the Platform Position from a projection keywordlist.
virtual ossimObject * dup() const
Returns pointer to a new instance, copy of this.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
float * get_srgr_coef()
input_gaps_flag
int get_first_zero_doppler_time_day()
first_zero_doppler_time day
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.
float get_range_samp_rate()
range_samp_rate
void set_ephemeris(Ephemeris *ephemeris)
void set_col_direction(int dir)
This class represents a date.
unsigned int get_first_zero_doppler_time_sec()
first_zero_doppler_time second
float distance(double lat1, double lon1, double lat2, double lon2, int units)
This class is able to read the ASAR GeolocationGrid record.
void set_distance(double distance)
float get_radar_freq()
radar_freq
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
int get_num_ds(EnvisatAsarRecord *record)
ossimEnvisatAsarModel()
Constructor.