diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.cpp index 820d15987ddb300ab34ce982fed5fe45e367a57c..6feaa33bfadd534377ed9b3c04561c70ceff9b86 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.cpp @@ -24,34 +24,34 @@ ErsSarDataSetSummary::~ErsSarDataSetSummary() std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) { - os<<"seq_num:"<<data._seq_num<<std::endl; + os<<"seq_num:"<<data._seq_num<<std::endl; - os<<"sar_chn:"<<data._sar_chn<<std::endl; + os<<"sar_chn:"<<data._sar_chn<<std::endl; - os<<"scene_id:"<<data._scene_id.c_str()<<std::endl; + os<<"scene_id:"<<data._scene_id.c_str()<<std::endl; - os<<"scene_des:"<<data._scene_des.c_str()<<std::endl; + os<<"scene_des:"<<data._scene_des.c_str()<<std::endl; - os<<"inp_sctim:"<<data._inp_sctim.c_str()<<std::endl; + os<<"inp_sctim:"<<data._inp_sctim.c_str()<<std::endl; - os<<"asc_des:"<<data._asc_des.c_str()<<std::endl; + os<<"asc_des:"<<data._asc_des.c_str()<<std::endl; - os<<"pro_lat:"<<data._pro_lat<<std::endl; + os<<"pro_lat:"<<data._pro_lat<<std::endl; os<<"pro_long:"<<data._pro_long<<std::endl; os<<"pro_head:"<<data._pro_head<<std::endl; - os<<"ellip_des:"<<data._ellip_des.c_str()<<std::endl; + os<<"ellip_des:"<<data._ellip_des.c_str()<<std::endl; - os<<"ellip_maj:"<<data._ellip_maj<<std::endl; + os<<"ellip_maj:"<<data._ellip_maj<<std::endl; - os<<"ellip_min:"<<data._ellip_min<<std::endl; - os<<"earth_mass:"<<data._earth_mass<<std::endl; + os<<"ellip_min:"<<data._ellip_min<<std::endl; + os<<"earth_mass:"<<data._earth_mass<<std::endl; os<<"grav_const:"<<data._grav_const<<std::endl; os<<"ellip_j[0]:"<<data._ellip_j[0]<<std::endl; - os<<"ellip_j[1]:"<<data._ellip_j[1]<<std::endl; - os<<"ellip_j[2]:"<<data._ellip_j[2]<<std::endl; + os<<"ellip_j[1]:"<<data._ellip_j[1]<<std::endl; + os<<"ellip_j[2]:"<<data._ellip_j[2]<<std::endl; os<<"terrain_h:"<<data._terrain_h<<std::endl; os<<"sc_lin:"<<data._sc_lin<<std::endl; os<<"sc_pix:"<<data._sc_pix<<std::endl; @@ -62,7 +62,7 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"sensor_id:"<<data._sensor_id.c_str()<<std::endl; os<<"orbit_num:"<<data._orbit_num.c_str()<<std::endl; - os<<"plat_lat:"<<data._plat_lat<<std::endl; + os<<"plat_lat:"<<data._plat_lat<<std::endl; os<<"plat_long:"<<data._plat_long<<std::endl; @@ -75,23 +75,23 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"wave_length:"<<data._wave_length<<std::endl; - os<<"motion_comp:"<<data._motion_comp.c_str()<<std::endl; + os<<"motion_comp:"<<data._motion_comp.c_str()<<std::endl; - os<<"pulse_code:"<<data._pulse_code.c_str()<<std::endl; + os<<"pulse_code:"<<data._pulse_code.c_str()<<std::endl; - for (int i=0;i<5;i++) - { - os<<"ampl_coef["<<i<<"]:"<<data._ampl_coef[i]<<std::endl; - } + for (int i=0;i<5;i++) + { + os<<"ampl_coef["<<i<<"]:"<<data._ampl_coef[i]<<std::endl; + } for (int i=0;i<5;i++) - { - os<<"phas_coef["<<i<<"]:"<<data._phas_coef[i]<<std::endl; - } + { + os<<"phas_coef["<<i<<"]:"<<data._phas_coef[i]<<std::endl; + } - os<<"chirp_ext_ind:"<<data._chirp_ext_ind<<std::endl; + os<<"chirp_ext_ind:"<<data._chirp_ext_ind<<std::endl; - os<<"fr:"<<data._fr<<std::endl; + os<<"fr:"<<data._fr<<std::endl; os<<"rng_gate:"<<data._rng_gate<<std::endl; @@ -101,7 +101,7 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"rngcmp_f:"<<data._rngcmp_f.c_str()<<std::endl; - os<<"gn_polar:"<<data._gn_polar <<std::endl; + os<<"gn_polar:"<<data._gn_polar <<std::endl; os<<"gn_cross:"<<data._gn_cross <<std::endl; @@ -119,7 +119,7 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"fa:"<<data._fa<<std::endl; - os<<"sat_bintim:"<<data._sat_bintim.c_str()<<std::endl; + os<<"sat_bintim:"<<data._sat_bintim.c_str()<<std::endl; os<<"sat_clktim:"<<data._sat_clktim.c_str()<<std::endl; @@ -157,25 +157,25 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"azi_res:" << data._azi_res << std::endl; - os<<"alt_dopcen[0]:"<<data._alt_dopcen[0]<<std::endl; - os<<"alt_dopcen[1]:"<<data._alt_dopcen[1]<<std::endl; - os<<"alt_dopcen[2]:"<<data._alt_dopcen[2]<<std::endl; + os<<"alt_dopcen[0]:"<<data._alt_dopcen[0]<<std::endl; + os<<"alt_dopcen[1]:"<<data._alt_dopcen[1]<<std::endl; + os<<"alt_dopcen[2]:"<<data._alt_dopcen[2]<<std::endl; os<<"crt_dopcen[0]:"<<data._crt_dopcen[0]<<std::endl; - os<<"crt_dopcen[1]:"<<data._crt_dopcen[1]<<std::endl; - os<<"crt_dopcen[2]:"<<data._crt_dopcen[2]<<std::endl; + os<<"crt_dopcen[1]:"<<data._crt_dopcen[1]<<std::endl; + os<<"crt_dopcen[2]:"<<data._crt_dopcen[2]<<std::endl; os<<"time_dir_pix:"<<data._time_dir_pix.c_str()<<std::endl; - os<<"time_dir_lin:"<<data._time_dir_lin.c_str()<<std::endl; + os<<"time_dir_lin:"<<data._time_dir_lin.c_str()<<std::endl; os<<"alt_rate[0]:"<<data._alt_rate[0]<<std::endl; - os<<"alt_rate[1]:"<<data._alt_rate[1]<<std::endl; - os<<"alt_rate[2]:"<<data._alt_rate[2]<<std::endl; + os<<"alt_rate[1]:"<<data._alt_rate[1]<<std::endl; + os<<"alt_rate[2]:"<<data._alt_rate[2]<<std::endl; os<<"crt_rate[0]:"<<data._crt_rate[0]<<std::endl; - os<<"crt_rate[1]:"<<data._crt_rate[1]<<std::endl; - os<<"crt_rate[2]:"<<data._crt_rate[2]<<std::endl; + os<<"crt_rate[1]:"<<data._crt_rate[1]<<std::endl; + os<<"crt_rate[2]:"<<data._crt_rate[2]<<std::endl; os<<"clutter_lock:"<<data._line_cont.c_str()<<std::endl; @@ -189,377 +189,377 @@ std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data) os<<"rngcmp_desg:"<<data._rngcmp_desg.c_str()<<std::endl; - os<<"zero_dop_range_time_f_pixel:"<<data._zero_dop_range_time_f_pixel<<std::endl; + os<<"zero_dop_range_time_f_pixel:"<<data._zero_dop_range_time_f_pixel<<std::endl; - os<<"zero_dop_range_time_c_pixel:"<<data._zero_dop_range_time_c_pixel<<std::endl; + os<<"zero_dop_range_time_c_pixel:"<<data._zero_dop_range_time_c_pixel<<std::endl; - os<<"zero_dop_range_time_l_pixel:"<<data._zero_dop_range_time_l_pixel<<std::endl; + os<<"zero_dop_range_time_l_pixel:"<<data._zero_dop_range_time_l_pixel<<std::endl; - os<<"zero_dop_az_time_f_pixel :"<<data._zero_dop_az_time_f_pixel.c_str()<<std::endl; + os<<"zero_dop_az_time_f_pixel :"<<data._zero_dop_az_time_f_pixel.c_str()<<std::endl; - os<<" zero_dop_az_time_c_pixel:"<<data._zero_dop_az_time_c_pixel.c_str()<<std::endl; + os<<" zero_dop_az_time_c_pixel:"<<data._zero_dop_az_time_c_pixel.c_str()<<std::endl; - os<<" zero_dop_az_time_l_pixel:"<<data._zero_dop_az_time_l_pixel.c_str()<<std::endl; + os<<" zero_dop_az_time_l_pixel:"<<data._zero_dop_az_time_l_pixel.c_str()<<std::endl; - return os; + return os; } std::istream& operator>>(std::istream& is, ErsSarDataSetSummary& data) { - char buf16[17]; - buf16[16]='\0'; - char buf32[33]; - buf32[32] = '\0'; - char buf8[9]; - buf8[8] = '\0'; - char buf4[5]; - buf4[4] = '\0'; + char buf16[17]; + buf16[16]='\0'; + char buf32[33]; + buf32[32] = '\0'; + char buf8[9]; + buf8[8] = '\0'; + char buf4[5]; + buf4[4] = '\0'; - is.read(buf4,4); - data._seq_num = atoi(buf4); + is.read(buf4,4); + data._seq_num = atoi(buf4); - is.read(buf4,4); - data._sar_chn = atoi(buf4); + is.read(buf4,4); + data._sar_chn = atoi(buf4); - is.read(buf16,16); - data._scene_id = buf16; + is.read(buf16,16); + data._scene_id = buf16; - is.read(buf32,32); - data._scene_des = buf32; + is.read(buf32,32); + data._scene_des = buf32; - is.read(buf32,32); - data._inp_sctim = buf32; + is.read(buf32,32); + data._inp_sctim = buf32; - is.read(buf16,16); - data._asc_des = buf16; + is.read(buf16,16); + data._asc_des = buf16; - is.read(buf16,16); - data._pro_lat = atof(buf16); + is.read(buf16,16); + data._pro_lat = atof(buf16); is.read(buf16,16); - data._pro_long = atof(buf16); + data._pro_long = atof(buf16); is.read(buf16,16); - data._pro_head = atof(buf16); + data._pro_head = atof(buf16); - is.read(buf16,16); - data._ellip_des = buf16; + is.read(buf16,16); + data._ellip_des = buf16; - is.read(buf16,16); - data._ellip_maj = atof(buf16); + is.read(buf16,16); + data._ellip_maj = atof(buf16); - is.read(buf16,16); - data._ellip_min = atof(buf16); + is.read(buf16,16); + data._ellip_min = atof(buf16); - is.read(buf16,16); - data._earth_mass = atof(buf16); + is.read(buf16,16); + data._earth_mass = atof(buf16); is.read(buf16,16); - data._grav_const = atof(buf16); + data._grav_const = atof(buf16); - is.read(buf16,16); - data._ellip_j[0] = atof(buf16); - is.read(buf16,16); - data._ellip_j[1] = atof(buf16); - is.read(buf16,16); - data._ellip_j[2] = atof(buf16); + is.read(buf16,16); + data._ellip_j[0] = atof(buf16); + is.read(buf16,16); + data._ellip_j[1] = atof(buf16); + is.read(buf16,16); + data._ellip_j[2] = atof(buf16); is.read(buf16,16); is.read(buf16,16); - data._terrain_h = atof(buf16); + data._terrain_h = atof(buf16); - is.read(buf8,8); - data._sc_lin = atoi(buf8); + is.read(buf8,8); + data._sc_lin = atoi(buf8); - is.read(buf8,8); - data._sc_pix = atoi(buf8); + is.read(buf8,8); + data._sc_pix = atoi(buf8); - is.read(buf16,16); - data._scene_len = atof(buf16); + is.read(buf16,16); + data._scene_len = atof(buf16); - is.read(buf16,16); - data._scene_wid = atof(buf16); + is.read(buf16,16); + data._scene_wid = atof(buf16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf4,4); - data._nchn = atoi(buf4); + is.read(buf4,4); + data._nchn = atoi(buf4); - is.read(buf4,4); + is.read(buf4,4); - is.read(buf16,16); - data._mission_id = buf16; + is.read(buf16,16); + data._mission_id = buf16; - is.read(buf32,32); - data._sensor_id = buf32; + is.read(buf32,32); + data._sensor_id = buf32; - is.read(buf8,8); - data._orbit_num = buf8; + is.read(buf8,8); + data._orbit_num = buf8; - is.read(buf8,8); - data._plat_lat = atof(buf8); + is.read(buf8,8); + data._plat_lat = atof(buf8); is.read(buf8,8); - data._plat_long = atof(buf8); + data._plat_long = atof(buf8); is.read(buf8,8); - data._plat_head = atof(buf8); + data._plat_head = atof(buf8); is.read(buf8,8); - data._clock_ang = atof(buf8); + data._clock_ang = atof(buf8); is.read(buf8,8); - data._incident_ang = atof(buf8); + data._incident_ang = atof(buf8); is.read(buf8,8); - is.read(buf16,16); - data._wave_length = atof(buf16); + is.read(buf16,16); + data._wave_length = atof(buf16); - is.read(buf8,2); - buf8[2] = '\0'; - data._motion_comp = buf8; + is.read(buf8,2); + buf8[2] = '\0'; + data._motion_comp = buf8; - is.read(buf16,16); - data._pulse_code = buf16; + is.read(buf16,16); + data._pulse_code = buf16; - for (int i=0;i<5;i++) - { - is.read(buf16,16); - data._ampl_coef[i] = atof(buf16); - } + for (int i=0;i<5;i++) + { + is.read(buf16,16); + data._ampl_coef[i] = atof(buf16); + } for (int i=0;i<5;i++) - { - is.read(buf16,16); - data._phas_coef[i] = atof(buf16); - } + { + is.read(buf16,16); + data._phas_coef[i] = atof(buf16); + } is.read(buf8,8); - data._chirp_ext_ind = atoi(buf8); + data._chirp_ext_ind = atoi(buf8); is.read(buf8,8); is.read(buf16,16); - data._fr = atof(buf16); + data._fr = atof(buf16); is.read(buf16,16); - data._rng_gate = atof(buf16); + data._rng_gate = atof(buf16); is.read(buf16,16); - data._rng_length = atof(buf16); + data._rng_length = atof(buf16); is.read(buf8,4); - buf8[4] = '\0'; - data._baseband_f = buf8; + buf8[4] = '\0'; + data._baseband_f = buf8; is.read(buf8,4); - buf8[4] = '\0'; - data._rngcmp_f = buf8; + buf8[4] = '\0'; + data._rngcmp_f = buf8; - is.read(buf16,16); - data._gn_polar = atof(buf16); + is.read(buf16,16); + data._gn_polar = atof(buf16); is.read(buf16,16); - data._gn_cross = atof(buf16); + data._gn_cross = atof(buf16); is.read(buf8,8); - data._chn_bits = atoi(buf8); + data._chn_bits = atoi(buf8); is.read(buf16,12); - buf16[12] = '\0'; - data._quant_desc = buf16; + buf16[12] = '\0'; + data._quant_desc = buf16; is.read(buf16,16); - data._i_bias = atof(buf16); + data._i_bias = atof(buf16); is.read(buf16,16); - data._q_bias = atof(buf16); + data._q_bias = atof(buf16); is.read(buf16,16); - data._iq_ratio = atof(buf16); + data._iq_ratio = atof(buf16); is.read(buf32,32); is.read(buf16,16); is.read(buf16,16); - data._mech_sight = atof(buf16); + data._mech_sight = atof(buf16); is.read(buf4,4); is.read(buf16,16); - data._fa = atof(buf16); + data._fa = atof(buf16); is.read(buf16,16); is.read(buf16,16); is.read(buf16,16); - data._sat_bintim = buf16; + data._sat_bintim = buf16; is.read(buf32,32); - data._sat_clktim = buf32; + data._sat_clktim = buf32; is.read(buf8,8); - data._sat_clkinc = buf8; + data._sat_clkinc = buf8; is.read(buf8,8); is.read(buf16,16); - data._fac_id = buf16; + data._fac_id = buf16; is.read(buf8,8); - data._sys_id = buf8; + data._sys_id = buf8; is.read(buf8,8); - data._ver_id = buf8; + data._ver_id = buf8; is.read(buf32,32); is.read(buf32,32); - data._prod_type = buf32; + data._prod_type = buf32; is.read(buf32,32); - data._algor_id = buf32; + data._algor_id = buf32; is.read(buf16,16); - data._n_azilok = atof(buf16); + data._n_azilok = atof(buf16); is.read(buf16,16); - data._n_rnglok = atof(buf16); + data._n_rnglok = atof(buf16); is.read(buf16,16); - data._bnd_azilok = atof(buf16); + data._bnd_azilok = atof(buf16); is.read(buf16,16); - data._bnd_rnglok = atof(buf16); + data._bnd_rnglok = atof(buf16); is.read(buf16,16); - data._bnd_azi = atof(buf16); + data._bnd_azi = atof(buf16); is.read(buf16,16); - data._bnd_rng = atof(buf16); + data._bnd_rng = atof(buf16); is.read(buf32,32); - data._azi_weight = buf32; + data._azi_weight = buf32; is.read(buf32,32); - data._rng_weight = buf32; + data._rng_weight = buf32; is.read(buf16,16); - data._data_inpsrc = buf16; + data._data_inpsrc = buf16; is.read(buf16,16); - data._rng_res = atof(buf16); + data._rng_res = atof(buf16); is.read(buf16,16); - data._azi_res = atof(buf16); + data._azi_res = atof(buf16); - is.read(buf32,32); + is.read(buf32,32); - is.read(buf16,16); - data._alt_dopcen[0] = atof(buf16); - is.read(buf16,16); - data._alt_dopcen[1] = atof(buf16); - is.read(buf16,16); - data._alt_dopcen[2] = atof(buf16); + is.read(buf16,16); + data._alt_dopcen[0] = atof(buf16); + is.read(buf16,16); + data._alt_dopcen[1] = atof(buf16); + is.read(buf16,16); + data._alt_dopcen[2] = atof(buf16); is.read(buf16,16); is.read(buf16,16); - data._crt_dopcen[0] = atof(buf16); - is.read(buf16,16); - data._crt_dopcen[1] = atof(buf16); - is.read(buf16,16); - data._crt_dopcen[2] = atof(buf16); + data._crt_dopcen[0] = atof(buf16); + is.read(buf16,16); + data._crt_dopcen[1] = atof(buf16); + is.read(buf16,16); + data._crt_dopcen[2] = atof(buf16); is.read(buf8,8); - data._time_dir_pix = buf8; + data._time_dir_pix = buf8; - is.read(buf8,8); - data._time_dir_lin = buf8; + is.read(buf8,8); + data._time_dir_lin = buf8; is.read(buf16,16); - data._alt_rate[0] = atof(buf16); - is.read(buf16,16); - data._alt_rate[1] = atof(buf16); - is.read(buf16,16); - data._alt_rate[2] = atof(buf16); + data._alt_rate[0] = atof(buf16); + is.read(buf16,16); + data._alt_rate[1] = atof(buf16); + is.read(buf16,16); + data._alt_rate[2] = atof(buf16); is.read(buf16,16); is.read(buf16,16); - data._crt_rate[0] = atof(buf16); - is.read(buf16,16); - data._crt_rate[1] = atof(buf16); - is.read(buf16,16); - data._crt_rate[2] = atof(buf16); + data._crt_rate[0] = atof(buf16); + is.read(buf16,16); + data._crt_rate[1] = atof(buf16); + is.read(buf16,16); + data._crt_rate[2] = atof(buf16); is.read(buf16,16); is.read(buf8,8); - data._line_cont = buf8; + data._line_cont = buf8; is.read(buf4,4); - data._clutter_lock = buf4; + data._clutter_lock = buf4; is.read(buf4,4); - data._auto_focus = buf4; + data._auto_focus = buf4; is.read(buf16,16); - data._line_spacing = atof(buf16); + data._line_spacing = atof(buf16); is.read(buf16,16); - data._pix_spacing = atof(buf16); + data._pix_spacing = atof(buf16); is.read(buf16,16); - data._rngcmp_desg = buf16; + data._rngcmp_desg = buf16; - is.read(buf32,32); + is.read(buf32,32); is.read(buf16,16); - data._zero_dop_range_time_f_pixel = atof(buf16); + data._zero_dop_range_time_f_pixel = atof(buf16); - is.read(buf16,16); - data._zero_dop_range_time_c_pixel = atof(buf16); + is.read(buf16,16); + data._zero_dop_range_time_c_pixel = atof(buf16); - is.read(buf16,16); - data._zero_dop_range_time_l_pixel = atof(buf16); + is.read(buf16,16); + data._zero_dop_range_time_l_pixel = atof(buf16); - is.read(buf32,24); - buf32[24] = '\0'; - data._zero_dop_az_time_f_pixel = buf32; + is.read(buf32,24); + buf32[24] = '\0'; + data._zero_dop_az_time_f_pixel = buf32; - is.read(buf32,24); - buf32[24] = '\0'; - data._zero_dop_az_time_c_pixel = buf32; + is.read(buf32,24); + buf32[24] = '\0'; + data._zero_dop_az_time_c_pixel = buf32; - is.read(buf32,24); - buf32[24] = '\0'; - data._zero_dop_az_time_l_pixel = buf32; + is.read(buf32,24); + buf32[24] = '\0'; + data._zero_dop_az_time_l_pixel = buf32; - return is; + return is; } ErsSarDataSetSummary::ErsSarDataSetSummary(const ErsSarDataSetSummary& rhs): - ErsSarRecord(rhs), - _seq_num(rhs._seq_num), + ErsSarRecord(rhs), + _seq_num(rhs._seq_num), _sar_chn(rhs._sar_chn), - _scene_id(rhs._scene_id), - _scene_des(rhs._scene_des), - _inp_sctim(rhs._inp_sctim), - _asc_des(rhs._asc_des), + _scene_id(rhs._scene_id), + _scene_des(rhs._scene_des), + _inp_sctim(rhs._inp_sctim), + _asc_des(rhs._asc_des), _pro_lat(rhs._pro_lat), _pro_long(rhs._pro_long), _pro_head(rhs._pro_head), - _ellip_des(rhs._ellip_des), + _ellip_des(rhs._ellip_des), _ellip_maj(rhs._ellip_maj), _ellip_min(rhs._ellip_min), - _earth_mass(rhs._earth_mass), + _earth_mass(rhs._earth_mass), _grav_const(rhs._grav_const), _terrain_h(rhs._terrain_h), _sc_lin(rhs._sc_lin), @@ -620,58 +620,58 @@ ErsSarDataSetSummary::ErsSarDataSetSummary(const ErsSarDataSetSummary& rhs): _line_spacing(rhs._line_spacing), _pix_spacing(rhs._pix_spacing), _rngcmp_desg(rhs._rngcmp_desg), - _zero_dop_range_time_f_pixel(rhs._zero_dop_range_time_f_pixel), - _zero_dop_range_time_c_pixel(rhs._zero_dop_range_time_c_pixel), - _zero_dop_range_time_l_pixel(rhs._zero_dop_range_time_l_pixel), - _zero_dop_az_time_f_pixel(rhs._zero_dop_az_time_f_pixel), - _zero_dop_az_time_c_pixel(rhs._zero_dop_az_time_c_pixel), - _zero_dop_az_time_l_pixel(rhs._zero_dop_az_time_l_pixel) + _zero_dop_range_time_f_pixel(rhs._zero_dop_range_time_f_pixel), + _zero_dop_range_time_c_pixel(rhs._zero_dop_range_time_c_pixel), + _zero_dop_range_time_l_pixel(rhs._zero_dop_range_time_l_pixel), + _zero_dop_az_time_f_pixel(rhs._zero_dop_az_time_f_pixel), + _zero_dop_az_time_c_pixel(rhs._zero_dop_az_time_c_pixel), + _zero_dop_az_time_l_pixel(rhs._zero_dop_az_time_l_pixel) { - _ellip_j[0] = rhs._ellip_j[0]; - _ellip_j[1] = rhs._ellip_j[1]; - _ellip_j[2] = rhs._ellip_j[2]; - _ampl_coef[0] = rhs._ampl_coef[0]; - _ampl_coef[1] = rhs._ampl_coef[1]; - _ampl_coef[2] = rhs._ampl_coef[2]; - _ampl_coef[3] = rhs._ampl_coef[3]; - _ampl_coef[4] = rhs._ampl_coef[4]; + _ellip_j[0] = rhs._ellip_j[0]; + _ellip_j[1] = rhs._ellip_j[1]; + _ellip_j[2] = rhs._ellip_j[2]; + _ampl_coef[0] = rhs._ampl_coef[0]; + _ampl_coef[1] = rhs._ampl_coef[1]; + _ampl_coef[2] = rhs._ampl_coef[2]; + _ampl_coef[3] = rhs._ampl_coef[3]; + _ampl_coef[4] = rhs._ampl_coef[4]; _phas_coef[0] = rhs._phas_coef[0]; - _phas_coef[1] = rhs._phas_coef[1]; - _phas_coef[2] = rhs._phas_coef[2]; - _phas_coef[3] = rhs._phas_coef[3]; - _phas_coef[4] = rhs._phas_coef[4]; + _phas_coef[1] = rhs._phas_coef[1]; + _phas_coef[2] = rhs._phas_coef[2]; + _phas_coef[3] = rhs._phas_coef[3]; + _phas_coef[4] = rhs._phas_coef[4]; _alt_dopcen[0] = rhs._alt_dopcen[0]; - _alt_dopcen[1] = rhs._alt_dopcen[1]; - _alt_dopcen[2] = rhs._alt_dopcen[2]; - - _crt_dopcen[0] = rhs._crt_dopcen[0]; - _crt_dopcen[1] = rhs._crt_dopcen[1]; - _crt_dopcen[2] = rhs._crt_dopcen[2]; - - _alt_rate[0] = rhs._alt_rate[0]; - _alt_rate[1] = rhs._alt_rate[1]; - _alt_rate[2] = rhs._alt_rate[2]; - _crt_rate[0] = rhs._crt_rate[0]; - _crt_rate[1] = rhs._crt_rate[1]; - _crt_rate[2] = rhs._crt_rate[2]; + _alt_dopcen[1] = rhs._alt_dopcen[1]; + _alt_dopcen[2] = rhs._alt_dopcen[2]; + + _crt_dopcen[0] = rhs._crt_dopcen[0]; + _crt_dopcen[1] = rhs._crt_dopcen[1]; + _crt_dopcen[2] = rhs._crt_dopcen[2]; + + _alt_rate[0] = rhs._alt_rate[0]; + _alt_rate[1] = rhs._alt_rate[1]; + _alt_rate[2] = rhs._alt_rate[2]; + _crt_rate[0] = rhs._crt_rate[0]; + _crt_rate[1] = rhs._crt_rate[1]; + _crt_rate[2] = rhs._crt_rate[2]; } ErsSarDataSetSummary& ErsSarDataSetSummary::operator=(const ErsSarDataSetSummary& rhs) { - _seq_num = rhs._seq_num; + _seq_num = rhs._seq_num; _sar_chn = rhs._sar_chn; - _scene_id = rhs._scene_id; - _scene_des = rhs._scene_des; - _inp_sctim = rhs._inp_sctim; - _asc_des = rhs._asc_des; + _scene_id = rhs._scene_id; + _scene_des = rhs._scene_des; + _inp_sctim = rhs._inp_sctim; + _asc_des = rhs._asc_des; _pro_lat = rhs._pro_lat; _pro_long = rhs._pro_long; _pro_head = rhs._pro_head; - _ellip_des = rhs._ellip_des; + _ellip_des = rhs._ellip_des; _ellip_maj = rhs._ellip_maj; _ellip_min = rhs._ellip_min; - _earth_mass = rhs._earth_mass; + _earth_mass = rhs._earth_mass; _grav_const = rhs._grav_const; _terrain_h = rhs._terrain_h; _sc_lin = rhs._sc_lin; @@ -733,43 +733,43 @@ ErsSarDataSetSummary& ErsSarDataSetSummary::operator=(const ErsSarDataSetSummary _pix_spacing = rhs._pix_spacing; _rngcmp_desg = rhs._rngcmp_desg; - _ellip_j[0] = rhs._ellip_j[0]; - _ellip_j[1] = rhs._ellip_j[1]; - _ellip_j[2] = rhs._ellip_j[2]; - _ampl_coef[0] = rhs._ampl_coef[0]; - _ampl_coef[1] = rhs._ampl_coef[1]; - _ampl_coef[2] = rhs._ampl_coef[2]; - _ampl_coef[3] = rhs._ampl_coef[3]; - _ampl_coef[4] = rhs._ampl_coef[4]; + _ellip_j[0] = rhs._ellip_j[0]; + _ellip_j[1] = rhs._ellip_j[1]; + _ellip_j[2] = rhs._ellip_j[2]; + _ampl_coef[0] = rhs._ampl_coef[0]; + _ampl_coef[1] = rhs._ampl_coef[1]; + _ampl_coef[2] = rhs._ampl_coef[2]; + _ampl_coef[3] = rhs._ampl_coef[3]; + _ampl_coef[4] = rhs._ampl_coef[4]; _phas_coef[0] = rhs._phas_coef[0]; - _phas_coef[1] = rhs._phas_coef[1]; - _phas_coef[2] = rhs._phas_coef[2]; - _phas_coef[3] = rhs._phas_coef[3]; - _phas_coef[4] = rhs._phas_coef[4]; + _phas_coef[1] = rhs._phas_coef[1]; + _phas_coef[2] = rhs._phas_coef[2]; + _phas_coef[3] = rhs._phas_coef[3]; + _phas_coef[4] = rhs._phas_coef[4]; _alt_dopcen[0] = rhs._alt_dopcen[0]; - _alt_dopcen[1] = rhs._alt_dopcen[1]; - _alt_dopcen[2] = rhs._alt_dopcen[2]; + _alt_dopcen[1] = rhs._alt_dopcen[1]; + _alt_dopcen[2] = rhs._alt_dopcen[2]; - _crt_dopcen[0] = rhs._crt_dopcen[0]; - _crt_dopcen[1] = rhs._crt_dopcen[1]; - _crt_dopcen[2] = rhs._crt_dopcen[2]; + _crt_dopcen[0] = rhs._crt_dopcen[0]; + _crt_dopcen[1] = rhs._crt_dopcen[1]; + _crt_dopcen[2] = rhs._crt_dopcen[2]; - _alt_rate[0] = rhs._alt_rate[0]; - _alt_rate[1] = rhs._alt_rate[1]; - _alt_rate[2] = rhs._alt_rate[2]; - _crt_rate[0] = rhs._crt_rate[0]; - _crt_rate[1] = rhs._crt_rate[1]; - _crt_rate[2] = rhs._crt_rate[2]; + _alt_rate[0] = rhs._alt_rate[0]; + _alt_rate[1] = rhs._alt_rate[1]; + _alt_rate[2] = rhs._alt_rate[2]; + _crt_rate[0] = rhs._crt_rate[0]; + _crt_rate[1] = rhs._crt_rate[1]; + _crt_rate[2] = rhs._crt_rate[2]; - _zero_dop_range_time_f_pixel = rhs._zero_dop_range_time_f_pixel; - _zero_dop_range_time_c_pixel = rhs._zero_dop_range_time_c_pixel; - _zero_dop_range_time_l_pixel = rhs._zero_dop_range_time_l_pixel; - _zero_dop_az_time_f_pixel = rhs._zero_dop_az_time_f_pixel; - _zero_dop_az_time_c_pixel = rhs._zero_dop_az_time_c_pixel; - _zero_dop_az_time_l_pixel = rhs._zero_dop_az_time_l_pixel; + _zero_dop_range_time_f_pixel = rhs._zero_dop_range_time_f_pixel; + _zero_dop_range_time_c_pixel = rhs._zero_dop_range_time_c_pixel; + _zero_dop_range_time_l_pixel = rhs._zero_dop_range_time_l_pixel; + _zero_dop_az_time_f_pixel = rhs._zero_dop_az_time_f_pixel; + _zero_dop_az_time_c_pixel = rhs._zero_dop_az_time_c_pixel; + _zero_dop_az_time_l_pixel = rhs._zero_dop_az_time_l_pixel; - return *this; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.h index a3d74c5171a68353e2b8783bd0360876a78a2899..3c643ce12e70e7c120ed40be87af59c83e85271f 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarDataSetSummary.h @@ -28,1039 +28,1039 @@ namespace ossimplugins class ErsSarDataSetSummary : public ErsSarRecord { public: - /** - * @brief Constructor - */ - ErsSarDataSetSummary(); + /** + * @brief Constructor + */ + ErsSarDataSetSummary(); - /** - * @brief Destructor - */ - ~ErsSarDataSetSummary(); + /** + * @brief Destructor + */ + ~ErsSarDataSetSummary(); - /** - * @brief This function write the ErsSarDataSetSummary in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data); + /** + * @brief This function write the ErsSarDataSetSummary in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarDataSetSummary& data); - /** - * @brief This function read a ErsSarDataSetSummary from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarDataSetSummary& data); + /** + * @brief This function read a ErsSarDataSetSummary from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarDataSetSummary& data); - /** - * @brief Copy constructor - */ - ErsSarDataSetSummary(const ErsSarDataSetSummary& rhs); + /** + * @brief Copy constructor + */ + ErsSarDataSetSummary(const ErsSarDataSetSummary& rhs); - /** - * @brief Copy operator - */ - ErsSarDataSetSummary& operator=(const ErsSarDataSetSummary& rhs); + /** + * @brief Copy operator + */ + ErsSarDataSetSummary& operator=(const ErsSarDataSetSummary& rhs); - /** - * @brief This function is able to create a new instance of the class - */ - ErsSarRecord* Instanciate() - { - return new ErsSarDataSetSummary(); - }; + /** + * @brief This function is able to create a new instance of the class + */ + ErsSarRecord* Instanciate() + { + return new ErsSarDataSetSummary(); + }; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - ErsSarRecord* Clone() - { - return new ErsSarDataSetSummary(*this); - }; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + ErsSarRecord* Clone() + { + return new ErsSarDataSetSummary(*this); + }; - /** - * @brief Read the class data from a stream - */ - void Read(std::istream& is) - { - is>>*this; - }; + /** + * @brief Read the class data from a stream + */ + void Read(std::istream& is) + { + is>>*this; + }; - /** - * @brief Write the class to a stream - */ - void Write(std::ostream& os) - { - os<<*this; - }; + /** + * @brief Write the class to a stream + */ + void Write(std::ostream& os) + { + os<<*this; + }; - /** - * @brief Sequence number - */ - int get_seq_num() - { - return _seq_num; - }; - /** - * @brief SAR channel indicator - */ - int get_sar_chn() - { - return _sar_chn; - }; - /** - * @brief Scene identifier - */ - std::string get_scene_id() - { - return _scene_id; - }; - /** - * @brief Scene designator - */ - std::string get_scene_des() - { - return _scene_des; - }; - /** - * @brief Input scene centre time - */ - std::string get_inp_sctim() - { - return _inp_sctim; - }; - /** - * @brief Ascending/descending - */ - std::string get_asc_des() - { - return _asc_des; - }; - /** - * @brief Processed scene centre latitude - */ - double get_pro_lat() - { - return _pro_lat; - }; - /** - * @brief Processed scene centre longitude - */ - double get_pro_long() - { - return _pro_long; - }; - /** - * @brief Processed scene centre headng - */ - double get_pro_head() - { - return _pro_head; - }; - /** - * @brief Ellipsoid designator - */ - std::string get_ellip_des() - { - return _ellip_des; - }; - /** - * @brief Ellipsoid semi-major axis, km - */ - double get_ellip_maj() - { - return _ellip_maj; - }; - /** - * @brief Ellipsoid semi_minor axis, km - */ - double get_ellip_min() - { - return _ellip_min; - }; - /** - * @brief Earth's mass - */ + /** + * @brief Sequence number + */ + int get_seq_num() + { + return _seq_num; + }; + /** + * @brief SAR channel indicator + */ + int get_sar_chn() + { + return _sar_chn; + }; + /** + * @brief Scene identifier + */ + std::string get_scene_id() + { + return _scene_id; + }; + /** + * @brief Scene designator + */ + std::string get_scene_des() + { + return _scene_des; + }; + /** + * @brief Input scene centre time + */ + std::string get_inp_sctim() + { + return _inp_sctim; + }; + /** + * @brief Ascending/descending + */ + std::string get_asc_des() + { + return _asc_des; + }; + /** + * @brief Processed scene centre latitude + */ + double get_pro_lat() + { + return _pro_lat; + }; + /** + * @brief Processed scene centre longitude + */ + double get_pro_long() + { + return _pro_long; + }; + /** + * @brief Processed scene centre headng + */ + double get_pro_head() + { + return _pro_head; + }; + /** + * @brief Ellipsoid designator + */ + std::string get_ellip_des() + { + return _ellip_des; + }; + /** + * @brief Ellipsoid semi-major axis, km + */ + double get_ellip_maj() + { + return _ellip_maj; + }; + /** + * @brief Ellipsoid semi_minor axis, km + */ + double get_ellip_min() + { + return _ellip_min; + }; + /** + * @brief Earth's mass + */ double get_earth_mass() - { - return _earth_mass; - }; + { + return _earth_mass; + }; /** - * @brief Gravitational constant - */ + * @brief Gravitational constant + */ double get_grav_const() - { - return _grav_const; - }; + { + return _grav_const; + }; /** - * @brief Ellipsoid J2-4 parameters - */ + * @brief Ellipsoid J2-4 parameters + */ double* get_ellip_j() - { - return _ellip_j; - }; + { + return _ellip_j; + }; /** - * @brief Average terrain height, km - */ + * @brief Average terrain height, km + */ double get_terrain_h() - { - return _terrain_h; - }; + { + return _terrain_h; + }; /** - * @brief Scene centre line number - */ + * @brief Scene centre line number + */ int get_sc_lin() - { - return _sc_lin; - }; + { + return _sc_lin; + }; /** - * @brief Scene centre pixel number - */ + * @brief Scene centre pixel number + */ int get_sc_pix() - { - return _sc_pix; - }; + { + return _sc_pix; + }; /** - * @brief Scene length, km - */ + * @brief Scene length, km + */ double get_scene_len() - { - return _scene_len; - }; + { + return _scene_len; + }; /** - * @brief Scene width, km - */ + * @brief Scene width, km + */ double get_scene_wid() - { - return _scene_wid; - }; + { + return _scene_wid; + }; /** - * @brief Number of SAR channels - */ + * @brief Number of SAR channels + */ double get_nchn() - { - return _nchn; - }; + { + return _nchn; + }; /** - * @brief Mission identifier - */ - std::string get_mission_id() - { - return _mission_id; - }; - /** - * @brief Sensor identifier - */ - std::string get_sensor_id() - { - return _sensor_id; - }; - /** - * @brief Orbit number - */ - std::string get_orbit_num() - { - return _orbit_num; - }; - /** - * @brief Platform geodetic latitude - */ + * @brief Mission identifier + */ + std::string get_mission_id() + { + return _mission_id; + }; + /** + * @brief Sensor identifier + */ + std::string get_sensor_id() + { + return _sensor_id; + }; + /** + * @brief Orbit number + */ + std::string get_orbit_num() + { + return _orbit_num; + }; + /** + * @brief Platform geodetic latitude + */ double get_plat_lat() - { - return _plat_lat; - }; + { + return _plat_lat; + }; /** - * @brief Platform geodetic longitude - */ + * @brief Platform geodetic longitude + */ double get_plat_long() - { - return _plat_long; - }; + { + return _plat_long; + }; /** - * @brief Platform heading - */ + * @brief Platform heading + */ double get_plat_head() - { - return _plat_head; - }; + { + return _plat_head; + }; /** - * @brief Sensor clock angle - */ + * @brief Sensor clock angle + */ double get_clock_ang() - { - return _clock_ang; - }; + { + return _clock_ang; + }; /** - * @brief Incidence angle - */ + * @brief Incidence angle + */ double get_incident_ang() - { - return _incident_ang; - }; + { + return _incident_ang; + }; /** - * @brief Radar wave length - */ + * @brief Radar wave length + */ double get_wave_length() - { - return _wave_length; - }; - /** - * @brief Motion compensation indicator - */ - std::string get_motion_comp() - { - return _motion_comp; - }; - /** - * @brief Range pulse code specifier - */ + { + return _wave_length; + }; + /** + * @brief Motion compensation indicator + */ + std::string get_motion_comp() + { + return _motion_comp; + }; + /** + * @brief Range pulse code specifier + */ std::string get_pulse_code() - { - return _pulse_code; - }; + { + return _pulse_code; + }; /** - * @brief Range chirp coefficients - */ + * @brief Range chirp coefficients + */ double* get_ampl_coef() - { - return _ampl_coef; - }; + { + return _ampl_coef; + }; /** - * @brief Range phase coefficients - */ + * @brief Range phase coefficients + */ double* get_phas_coef() - { - return _phas_coef; - }; + { + return _phas_coef; + }; /** - * @brief Chirp extraction index - */ + * @brief Chirp extraction index + */ int get_chirp_ext_ind() - { - return _chirp_ext_ind; - }; + { + return _chirp_ext_ind; + }; /** - * @brief Range sampling rate - */ + * @brief Range sampling rate + */ double get_fr() - { - return _fr; - }; + { + return _fr; + }; /** - * @brief Range gate start time - */ + * @brief Range gate start time + */ double get_rng_gate() - { - return _rng_gate; - }; + { + return _rng_gate; + }; /** - * @brief Range pulse length - */ + * @brief Range pulse length + */ double get_rng_length() - { - return _rng_length; - }; - /** - * @brief Baseband conversion flag - */ - std::string get_baseband_f() - { - return _baseband_f; - }; - /** - * @brief Range compressed flag - */ + { + return _rng_length; + }; + /** + * @brief Baseband conversion flag + */ + std::string get_baseband_f() + { + return _baseband_f; + }; + /** + * @brief Range compressed flag + */ std::string get_rngcmp_f() - { - return _rngcmp_f; - }; + { + return _rngcmp_f; + }; /** - * @brief Like polarized gain - */ + * @brief Like polarized gain + */ double get_gn_polar() - { - return _gn_polar; - }; + { + return _gn_polar; + }; /** - * @brief Cross polarized gain - */ + * @brief Cross polarized gain + */ double get_gn_cross() - { - return _gn_cross; - }; + { + return _gn_cross; + }; /** - * @brief Number of bits per channel - */ + * @brief Number of bits per channel + */ int get_chn_bits() - { - return _chn_bits; - }; + { + return _chn_bits; + }; /** - * @brief Quantization descriptor - */ + * @brief Quantization descriptor + */ std::string get_quant_desc() - { - return _quant_desc; - }; + { + return _quant_desc; + }; /** - * @brief I channel DC bias - */ + * @brief I channel DC bias + */ double get_i_bias() - { - return _i_bias; - }; + { + return _i_bias; + }; /** - * @brief Q channel DC bias - */ + * @brief Q channel DC bias + */ double get_q_bias() - { - return _q_bias; - }; + { + return _q_bias; + }; /** - * @brief I/Q channel ratio - */ + * @brief I/Q channel ratio + */ double get_iq_ratio() - { - return _iq_ratio; - }; + { + return _iq_ratio; + }; /** - * @brief Mechanical boresight - */ + * @brief Mechanical boresight + */ double get_mech_sight() - { - return _mech_sight; - }; + { + return _mech_sight; + }; /** - * @brief Nominal PRF, Hz - */ + * @brief Nominal PRF, Hz + */ double get_fa() - { - return _fa; - }; + { + return _fa; + }; /** - * @brief Satellite binary time - */ + * @brief Satellite binary time + */ std::string get_sat_bintim() - { - return _sat_bintim; - }; + { + return _sat_bintim; + }; /** - * @brief Satellite clock time - */ + * @brief Satellite clock time + */ std::string get_sat_clktim() - { - return _sat_clktim; - }; + { + return _sat_clktim; + }; /** - * @brief Satellite clock increment - */ + * @brief Satellite clock increment + */ std::string get_sat_clkinc() - { - return _sat_clkinc; - }; + { + return _sat_clkinc; + }; /** - * @brief Processing facility identifier - */ + * @brief Processing facility identifier + */ std::string get_fac_id() - { - return _fac_id; - }; + { + return _fac_id; + }; /** - * @brief Processing system identifier - */ + * @brief Processing system identifier + */ std::string get_sys_id() - { - return _sys_id; - }; + { + return _sys_id; + }; /** - * @brief Processing version identifier - */ + * @brief Processing version identifier + */ std::string get_ver_id() - { - return _ver_id; - }; + { + return _ver_id; + }; /** - * @brief Product type specifier - */ + * @brief Product type specifier + */ std::string get_prod_type() - { - return _prod_type; - }; + { + return _prod_type; + }; /** - * @brief Processing algorithm identifier - */ + * @brief Processing algorithm identifier + */ std::string get_algor_id() - { - return _algor_id; - }; + { + return _algor_id; + }; /** - * @brief Number of azimuth looks - */ + * @brief Number of azimuth looks + */ double get_n_azilok() - { - return _n_azilok; - }; + { + return _n_azilok; + }; /** - * @brief Number of range looks - */ + * @brief Number of range looks + */ double get_n_rnglok() - { - return _n_rnglok; - }; + { + return _n_rnglok; + }; /** - * @brief Bandwidth per look in azimuth,Hz - */ + * @brief Bandwidth per look in azimuth,Hz + */ double get_bnd_azilok() - { - return _bnd_azilok; - }; + { + return _bnd_azilok; + }; /** - * @brief Bandwidth per look in range,Hz - */ + * @brief Bandwidth per look in range,Hz + */ double get_bnd_rnglok() - { - return _bnd_rnglok; - }; + { + return _bnd_rnglok; + }; /** - * @brief Total azimuth look bandwidth - */ + * @brief Total azimuth look bandwidth + */ double get_bnd_azi() - { - return _bnd_azi; - }; + { + return _bnd_azi; + }; /** - * @brief Total range look bandwidth - */ + * @brief Total range look bandwidth + */ double get_bnd_rng() - { - return _bnd_rng; - }; + { + return _bnd_rng; + }; /** - * @brief Azimuth weighting designator - */ + * @brief Azimuth weighting designator + */ std::string get_azi_weight() - { - return _azi_weight; - }; + { + return _azi_weight; + }; /** - * @brief Range weighting designator - */ + * @brief Range weighting designator + */ std::string get_rng_weight() - { - return _rng_weight; - }; + { + return _rng_weight; + }; /** - * @brief Data input source - */ + * @brief Data input source + */ std::string get_data_inpsrc() - { - return _data_inpsrc; - }; + { + return _data_inpsrc; + }; /** - * @brief Range resolution, meter - */ + * @brief Range resolution, meter + */ double get_rng_res() - { - return _rng_res; - }; + { + return _rng_res; + }; /** - * @brief Azimuth resolution, meter - */ + * @brief Azimuth resolution, meter + */ double get_azi_res() - { - return _azi_res; - }; + { + return _azi_res; + }; /** - * @brief Along track Doppler frequency terms - */ + * @brief Along track Doppler frequency terms + */ double* get_alt_dopcen() - { - return _alt_dopcen; - }; + { + return _alt_dopcen; + }; /** - * @brief Cross track Doppler frequency terms - */ + * @brief Cross track Doppler frequency terms + */ double* get_crt_dopcen() - { - return _crt_dopcen; - }; + { + return _crt_dopcen; + }; /** - * @brief Pixel time direction indicator - */ + * @brief Pixel time direction indicator + */ std::string get_time_dir_pix() - { - return _time_dir_pix; - }; + { + return _time_dir_pix; + }; /** - * @brief Line time direction indicator - */ + * @brief Line time direction indicator + */ std::string get_time_dir_lin() - { - return _time_dir_lin; - }; + { + return _time_dir_lin; + }; /** - * @brief Along track Doppler rate term - */ + * @brief Along track Doppler rate term + */ double* get_alt_rate() - { - return _alt_rate; - }; + { + return _alt_rate; + }; /** - * @brief Cross track Doppler rate term - */ + * @brief Cross track Doppler rate term + */ double* get_crt_rate() - { - return _crt_rate; - }; + { + return _crt_rate; + }; /** - * @brief Line content indicator - */ + * @brief Line content indicator + */ std::string get_line_cont() - { - return _line_cont; - }; + { + return _line_cont; + }; /** - * @brief Clutter lock applied flag - */ + * @brief Clutter lock applied flag + */ std::string get_clutter_lock() - { - return _clutter_lock; - }; + { + return _clutter_lock; + }; /** - * @brief Auto-focus applied flag - */ + * @brief Auto-focus applied flag + */ std::string get_auto_focus() - { - return _auto_focus; - }; + { + return _auto_focus; + }; /** - * @brief Line spacing, meters - */ + * @brief Line spacing, meters + */ double get_line_spacing() - { - return _line_spacing; - }; + { + return _line_spacing; + }; /** - * @brief Pixel spacing, meters - */ + * @brief Pixel spacing, meters + */ double get_pix_spacing() - { - return _pix_spacing; - }; + { + return _pix_spacing; + }; /** - * @brief Range compression designator - */ + * @brief Range compression designator + */ std::string get_rngcmp_desg() - { - return _rngcmp_desg; - }; - /** - * @brief zero doppler range time (two way) of first pixel - */ - double get_zero_dop_range_time_f_pixel() - { - return _zero_dop_range_time_f_pixel; - } - /** - * @brief zero doppler range time (two way) of mid pixel - */ - double get_zero_dop_range_time_c_pixel() - { - return _zero_dop_range_time_c_pixel; - } - /** - * @brief zero doppler range time (two way) of last pixel - */ - double get_zero_dop_range_time_l_pixel() - { - return _zero_dop_range_time_l_pixel; - } - /** - * @brief zero doppler azimut time (UTC) of first pixel - */ - std::string get_zero_dop_az_time_f_pixel() - { - return _zero_dop_az_time_f_pixel; - } - /** - * @brief zero doppler azimut time (UTC) of mid pixel - */ - std::string get_zero_dop_az_time_c_pixel() - { - return _zero_dop_az_time_c_pixel; - } - /** - * @brief zero doppler azimut time (UTC) of last pixel - */ - std::string get_zero_dop_az_time_l_pixel() - { - return _zero_dop_az_time_l_pixel; - } + { + return _rngcmp_desg; + }; + /** + * @brief zero doppler range time (two way) of first pixel + */ + double get_zero_dop_range_time_f_pixel() + { + return _zero_dop_range_time_f_pixel; + } + /** + * @brief zero doppler range time (two way) of mid pixel + */ + double get_zero_dop_range_time_c_pixel() + { + return _zero_dop_range_time_c_pixel; + } + /** + * @brief zero doppler range time (two way) of last pixel + */ + double get_zero_dop_range_time_l_pixel() + { + return _zero_dop_range_time_l_pixel; + } + /** + * @brief zero doppler azimut time (UTC) of first pixel + */ + std::string get_zero_dop_az_time_f_pixel() + { + return _zero_dop_az_time_f_pixel; + } + /** + * @brief zero doppler azimut time (UTC) of mid pixel + */ + std::string get_zero_dop_az_time_c_pixel() + { + return _zero_dop_az_time_c_pixel; + } + /** + * @brief zero doppler azimut time (UTC) of last pixel + */ + std::string get_zero_dop_az_time_l_pixel() + { + return _zero_dop_az_time_l_pixel; + } protected: - /** - * @brief Sequence number - */ - int _seq_num; - /** - * @brief SAR channel indicator - */ - int _sar_chn; - /** - * @brief Scene identifier - */ - std::string _scene_id; - /** - * @brief Scene designator - */ - std::string _scene_des; - /** - * @brief Input scene centre time - */ - std::string _inp_sctim; - /** - * @brief Ascending/descending - */ - std::string _asc_des; - /** - * @brief Processed scene centre latitude - */ - double _pro_lat; - /** - * @brief Processed scene centre longitude - */ - double _pro_long; - /** - * @brief Processed scene centre headng - */ - double _pro_head; - /** - * @brief Ellipsoid designator - */ - std::string _ellip_des; - /** - * @brief Ellipsoid semi-major axis, km - */ - double _ellip_maj; - /** - * @brief Ellipsoid semi_minor axis, km - */ - double _ellip_min; - /** - * @brief Earth's mass - */ + /** + * @brief Sequence number + */ + int _seq_num; + /** + * @brief SAR channel indicator + */ + int _sar_chn; + /** + * @brief Scene identifier + */ + std::string _scene_id; + /** + * @brief Scene designator + */ + std::string _scene_des; + /** + * @brief Input scene centre time + */ + std::string _inp_sctim; + /** + * @brief Ascending/descending + */ + std::string _asc_des; + /** + * @brief Processed scene centre latitude + */ + double _pro_lat; + /** + * @brief Processed scene centre longitude + */ + double _pro_long; + /** + * @brief Processed scene centre headng + */ + double _pro_head; + /** + * @brief Ellipsoid designator + */ + std::string _ellip_des; + /** + * @brief Ellipsoid semi-major axis, km + */ + double _ellip_maj; + /** + * @brief Ellipsoid semi_minor axis, km + */ + double _ellip_min; + /** + * @brief Earth's mass + */ double _earth_mass; /** - * @brief Gravitational constant - */ + * @brief Gravitational constant + */ double _grav_const; /** - * @brief Ellipsoid J2-4 parameters - */ + * @brief Ellipsoid J2-4 parameters + */ double _ellip_j[3]; /** - * @brief Average terrain height, km - */ + * @brief Average terrain height, km + */ double _terrain_h; /** - * @brief Scene centre line number - */ + * @brief Scene centre line number + */ int _sc_lin; /** - * @brief Scene centre pixel number - */ + * @brief Scene centre pixel number + */ int _sc_pix; /** - * @brief Scene length, km - */ + * @brief Scene length, km + */ double _scene_len; /** - * @brief Scene width, km - */ + * @brief Scene width, km + */ double _scene_wid; /** - * @brief Number of SAR channels - */ + * @brief Number of SAR channels + */ double _nchn; /** - * @brief Mission identifier - */ - std::string _mission_id; + * @brief Mission identifier + */ + std::string _mission_id; /** - * @brief Sensor identifier - */ - std::string _sensor_id; + * @brief Sensor identifier + */ + std::string _sensor_id; /** - * @brief Orbit number - */ - std::string _orbit_num; + * @brief Orbit number + */ + std::string _orbit_num; /** - * @brief Platform geodetic latitude - */ + * @brief Platform geodetic latitude + */ double _plat_lat; /** - * @brief Platform geodetic longitude - */ + * @brief Platform geodetic longitude + */ double _plat_long; /** - * @brief Platform heading - */ + * @brief Platform heading + */ double _plat_head; /** - * @brief Sensor clock angle - */ + * @brief Sensor clock angle + */ double _clock_ang; /** - * @brief Incidence angle - */ + * @brief Incidence angle + */ double _incident_ang; /** - * @brief Radar wave length - */ + * @brief Radar wave length + */ double _wave_length; /** - * @brief Motion compensation indicator - */ - std::string _motion_comp; + * @brief Motion compensation indicator + */ + std::string _motion_comp; /** - * @brief Range pulse code specifier - */ + * @brief Range pulse code specifier + */ std::string _pulse_code; /** - * @brief Range chirp coefficients - */ + * @brief Range chirp coefficients + */ double _ampl_coef[5]; /** - * @brief Range phase coefficients - */ + * @brief Range phase coefficients + */ double _phas_coef[5]; /** - * @brief Chirp extraction index - */ + * @brief Chirp extraction index + */ int _chirp_ext_ind; /** - * @brief Range sampling rate - */ + * @brief Range sampling rate + */ double _fr; /** - * @brief Range gate start time - */ + * @brief Range gate start time + */ double _rng_gate; /** - * @brief Range pulse length - */ + * @brief Range pulse length + */ double _rng_length; /** - * @brief Baseband conversion flag - */ - std::string _baseband_f; + * @brief Baseband conversion flag + */ + std::string _baseband_f; /** - * @brief Range compressed flag - */ + * @brief Range compressed flag + */ std::string _rngcmp_f; /** - * @brief Like polarized gain - */ + * @brief Like polarized gain + */ double _gn_polar; /** - * @brief Cross polarized gain - */ + * @brief Cross polarized gain + */ double _gn_cross; /** - * @brief Number of bits per channel - */ + * @brief Number of bits per channel + */ int _chn_bits; /** - * @brief Quantization descriptor - */ + * @brief Quantization descriptor + */ std::string _quant_desc; /** - * @brief I channel DC bias - */ + * @brief I channel DC bias + */ double _i_bias; /** - * @brief Q channel DC bias - */ + * @brief Q channel DC bias + */ double _q_bias; /** - * @brief I/Q channel ratio - */ + * @brief I/Q channel ratio + */ double _iq_ratio; /** - * @brief Mechanical boresight - */ + * @brief Mechanical boresight + */ double _mech_sight; /** - * @brief Nominal PRF, Hz - */ + * @brief Nominal PRF, Hz + */ double _fa; /** - * @brief Satellite binary time - */ + * @brief Satellite binary time + */ std::string _sat_bintim; /** - * @brief Satellite clock time - */ + * @brief Satellite clock time + */ std::string _sat_clktim; /** - * @brief Satellite clock increment - */ + * @brief Satellite clock increment + */ std::string _sat_clkinc; /** - * @brief Processing facility identifier - */ + * @brief Processing facility identifier + */ std::string _fac_id; /** - * @brief Processing system identifier - */ + * @brief Processing system identifier + */ std::string _sys_id; /** - * @brief Processing version identifier - */ + * @brief Processing version identifier + */ std::string _ver_id; /** - * @brief Product type specifier - */ + * @brief Product type specifier + */ std::string _prod_type; /** - * @brief Processing algorithm identifier - */ + * @brief Processing algorithm identifier + */ std::string _algor_id; /** - * @brief Number of azimuth looks - */ + * @brief Number of azimuth looks + */ double _n_azilok; /** - * @brief Number of range looks - */ + * @brief Number of range looks + */ double _n_rnglok; /** - * @brief Bandwidth per look in azimuth,Hz - */ + * @brief Bandwidth per look in azimuth,Hz + */ double _bnd_azilok; /** - * @brief Bandwidth per look in range,Hz - */ + * @brief Bandwidth per look in range,Hz + */ double _bnd_rnglok; /** - * @brief Total azimuth look bandwidth - */ + * @brief Total azimuth look bandwidth + */ double _bnd_azi; /** - * @brief Total range look bandwidth - */ + * @brief Total range look bandwidth + */ double _bnd_rng; /** - * @brief Azimuth weighting designator - */ + * @brief Azimuth weighting designator + */ std::string _azi_weight; /** - * @brief Range weighting designator - */ + * @brief Range weighting designator + */ std::string _rng_weight; /** - * @brief Data input source - */ + * @brief Data input source + */ std::string _data_inpsrc; /** - * @brief Range resolution, meter - */ + * @brief Range resolution, meter + */ double _rng_res; /** - * @brief Azimuth resolution, meter - */ + * @brief Azimuth resolution, meter + */ double _azi_res; /** - * @brief Along track Doppler frequency terms - */ + * @brief Along track Doppler frequency terms + */ double _alt_dopcen[3]; /** - * @brief Cross track Doppler frequency terms - */ + * @brief Cross track Doppler frequency terms + */ double _crt_dopcen[3]; /** - * @brief Pixel time direction indicator - */ + * @brief Pixel time direction indicator + */ std::string _time_dir_pix; /** - * @brief Line time direction indicator - */ + * @brief Line time direction indicator + */ std::string _time_dir_lin; /** - * @brief Along track Doppler rate term - */ + * @brief Along track Doppler rate term + */ double _alt_rate[3]; /** - * @brief Cross track Doppler rate term - */ + * @brief Cross track Doppler rate term + */ double _crt_rate[3]; /** - * @brief Line content indicator - */ + * @brief Line content indicator + */ std::string _line_cont; /** - * @brief Clutter lock applied flag - */ + * @brief Clutter lock applied flag + */ std::string _clutter_lock; /** - * @brief Auto-focus applied flag - */ + * @brief Auto-focus applied flag + */ std::string _auto_focus; /** - * @brief Line spacing, meters - */ + * @brief Line spacing, meters + */ double _line_spacing; /** - * @brief Pixel spacing, meters - */ + * @brief Pixel spacing, meters + */ double _pix_spacing; /** - * @brief Range compression designator - */ + * @brief Range compression designator + */ std::string _rngcmp_desg; - /** - * @brief zero doppler range time (two way) of first pixel - */ - double _zero_dop_range_time_f_pixel; - /** - * @brief zero doppler range time (two way) of mid pixel - */ - double _zero_dop_range_time_c_pixel; - /** - * @brief zero doppler range time (two way) of last pixel - */ - double _zero_dop_range_time_l_pixel ; - /** - * @brief zero doppler azimut time (UTC) of first pixel - */ - std::string _zero_dop_az_time_f_pixel ; - /** - * @brief zero doppler azimut time (UTC) of mid pixel - */ - std::string _zero_dop_az_time_c_pixel; - /** - * @brief zero doppler azimut time (UTC) of last pixel - */ - std::string _zero_dop_az_time_l_pixel; + /** + * @brief zero doppler range time (two way) of first pixel + */ + double _zero_dop_range_time_f_pixel; + /** + * @brief zero doppler range time (two way) of mid pixel + */ + double _zero_dop_range_time_c_pixel; + /** + * @brief zero doppler range time (two way) of last pixel + */ + double _zero_dop_range_time_l_pixel ; + /** + * @brief zero doppler azimut time (UTC) of first pixel + */ + std::string _zero_dop_az_time_f_pixel ; + /** + * @brief zero doppler azimut time (UTC) of mid pixel + */ + std::string _zero_dop_az_time_c_pixel; + /** + * @brief zero doppler azimut time (UTC) of last pixel + */ + std::string _zero_dop_az_time_l_pixel; private: diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.cpp index 8dc5e5d6e3a5a3544a51618988bc57497d2fb452..db332649b4181817a5bf37a9f378b6fd6164d9c3 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.cpp @@ -24,1143 +24,1143 @@ ErsSarFacilityData::~ErsSarFacilityData() std::ostream& operator<<(std::ostream& os, const ErsSarFacilityData& data) { - os<<"last_release_qc_date:"<<data._last_release_qc_date.c_str()<<std::endl; + os<<"last_release_qc_date:"<<data._last_release_qc_date.c_str()<<std::endl; - os<<"last_release_cal_date:"<<data._last_release_cal_date.c_str()<<std::endl; + os<<"last_release_cal_date:"<<data._last_release_cal_date.c_str()<<std::endl; - os<<"qa_summary_flag:"<<data._qa_summary_flag<<std::endl; + os<<"qa_summary_flag:"<<data._qa_summary_flag<<std::endl; - os<<"prf_code_change_flag:"<<data._prf_code_change_flag<<std::endl; + os<<"prf_code_change_flag:"<<data._prf_code_change_flag<<std::endl; - os<<"sampling_win_change_flag:"<<data._sampling_win_change_flag<<std::endl; + os<<"sampling_win_change_flag:"<<data._sampling_win_change_flag<<std::endl; - os<<"cal_gain_change_flag:"<<data._cal_gain_change_flag<<std::endl; + os<<"cal_gain_change_flag:"<<data._cal_gain_change_flag<<std::endl; - os<<"quirp_qu_flag:"<<data._quirp_qu_flag<<std::endl; + os<<"quirp_qu_flag:"<<data._quirp_qu_flag<<std::endl; - os<<"inp_data_stat_flag:"<<data._inp_data_stat_flag<<std::endl; + os<<"inp_data_stat_flag:"<<data._inp_data_stat_flag<<std::endl; - os<<"dopp_cent_conf_meas_flag:"<<data._dopp_cent_conf_meas_flag<<std::endl; + os<<"dopp_cent_conf_meas_flag:"<<data._dopp_cent_conf_meas_flag<<std::endl; - os<<"dopp_cent_val_flag:"<<data._dopp_cent_val_flag<<std::endl; + os<<"dopp_cent_val_flag:"<<data._dopp_cent_val_flag<<std::endl; - os<<"dopp_ambig_conf_meas_flag:"<<data._dopp_ambig_conf_meas_flag<<std::endl; + os<<"dopp_ambig_conf_meas_flag:"<<data._dopp_ambig_conf_meas_flag<<std::endl; - os<<"outp_data_mean_flag:"<<data._outp_data_mean_flag<<std::endl; + os<<"outp_data_mean_flag:"<<data._outp_data_mean_flag<<std::endl; - os<<"OGOB_flag:"<<data._OGOB_flag<<std::endl; + os<<"OGOB_flag:"<<data._OGOB_flag<<std::endl; - os<<"PRF_changes:"<<data._PRF_changes<<std::endl; + os<<"PRF_changes:"<<data._PRF_changes<<std::endl; - os<<"sampling_win_changes:"<<data._sampling_win_changes<<std::endl; + os<<"sampling_win_changes:"<<data._sampling_win_changes<<std::endl; - os<<"cal_gain_changes:"<<data._cal_gain_changes<<std::endl; + os<<"cal_gain_changes:"<<data._cal_gain_changes<<std::endl; - os<<"missing_lines:"<<data._missing_lines<<std::endl; + os<<"missing_lines:"<<data._missing_lines<<std::endl; - os<<"rec_gain_changes:"<<data._rec_gain_changes<<std::endl; + os<<"rec_gain_changes:"<<data._rec_gain_changes<<std::endl; - os<<"pulse_width_of_ACF_3db:"<<data._pulse_width_of_ACF_3db<<std::endl; + os<<"pulse_width_of_ACF_3db:"<<data._pulse_width_of_ACF_3db<<std::endl; - os<<"first_side_lobe_lev_of_ACF:"<<data._first_side_lobe_lev_of_ACF<<std::endl; + os<<"first_side_lobe_lev_of_ACF:"<<data._first_side_lobe_lev_of_ACF<<std::endl; - os<<"ISLR_of_ACF:"<<data._ISLR_of_ACF<<std::endl; + os<<"ISLR_of_ACF:"<<data._ISLR_of_ACF<<std::endl; - os<<"dopp_cent_conf_meas:"<<data._dopp_cent_conf_meas<<std::endl; + os<<"dopp_cent_conf_meas:"<<data._dopp_cent_conf_meas<<std::endl; - os<<"dopp_ambig_conf_meas:"<<data._dopp_ambig_conf_meas<<std::endl; + os<<"dopp_ambig_conf_meas:"<<data._dopp_ambig_conf_meas<<std::endl; - os<<"inp_data_I_mean:"<<data._inp_data_I_mean<<std::endl; + os<<"inp_data_I_mean:"<<data._inp_data_I_mean<<std::endl; - os<<"inp_data_Q_mean:"<<data._inp_data_Q_mean<<std::endl; + os<<"inp_data_Q_mean:"<<data._inp_data_Q_mean<<std::endl; - os<<"inp_data_I_stddev:"<<data._inp_data_I_stddev<<std::endl; + os<<"inp_data_I_stddev:"<<data._inp_data_I_stddev<<std::endl; - os<<"inp_data_Q_stddev:"<<data._inp_data_Q_stddev<<std::endl; + os<<"inp_data_Q_stddev:"<<data._inp_data_Q_stddev<<std::endl; - os<<"cal_sys_gain:"<<data._cal_sys_gain<<std::endl; + os<<"cal_sys_gain:"<<data._cal_sys_gain<<std::endl; - os<<"first_rec_gain_read:"<<data._first_rec_gain_read<<std::endl; + os<<"first_rec_gain_read:"<<data._first_rec_gain_read<<std::endl; - os<<"dopp_ambig_num:"<<data._dopp_ambig_num<<std::endl; + os<<"dopp_ambig_num:"<<data._dopp_ambig_num<<std::endl; - os<<"I_channel_bias_correction:"<<data._I_channel_bias_correction<<std::endl; + os<<"I_channel_bias_correction:"<<data._I_channel_bias_correction<<std::endl; - os<<"Q_channel_bias_correction:"<<data._Q_channel_bias_correction<<std::endl; + os<<"Q_channel_bias_correction:"<<data._Q_channel_bias_correction<<std::endl; - os<<"I_channel_gain_correction:"<<data._I_channel_gain_correction<<std::endl; + os<<"I_channel_gain_correction:"<<data._I_channel_gain_correction<<std::endl; - os<<"Q_channel_gain_correction:"<<data._Q_channel_gain_correction<<std::endl; + os<<"Q_channel_gain_correction:"<<data._Q_channel_gain_correction<<std::endl; - os<<"Q_channel_I_Q_correction:"<<data._Q_channel_I_Q_correction<<std::endl; + os<<"Q_channel_I_Q_correction:"<<data._Q_channel_I_Q_correction<<std::endl; - os<<"noise_power:"<<data._noise_power<<std::endl; + os<<"noise_power:"<<data._noise_power<<std::endl; - os<<"int_cal_utc:"<<data._int_cal_utc<<std::endl; + os<<"int_cal_utc:"<<data._int_cal_utc<<std::endl; - os<<"num_valid_cal_pulses:"<<data._num_valid_cal_pulses<<std::endl; + os<<"num_valid_cal_pulses:"<<data._num_valid_cal_pulses<<std::endl; - os<<"num_valid_noise_pulses:"<<data._num_valid_noise_pulses<<std::endl; + os<<"num_valid_noise_pulses:"<<data._num_valid_noise_pulses<<std::endl; - os<<"num_valid_replicas:"<<data._num_valid_replicas<<std::endl; + os<<"num_valid_replicas:"<<data._num_valid_replicas<<std::endl; - os<<"first_replica_sample:"<<data._first_replica_sample<<std::endl; + os<<"first_replica_sample:"<<data._first_replica_sample<<std::endl; - os<<"mean_cal_pulse_power:"<<data._mean_cal_pulse_power<<std::endl; + os<<"mean_cal_pulse_power:"<<data._mean_cal_pulse_power<<std::endl; - os<<"mean_noise_power:"<<data._mean_noise_power<<std::endl; + os<<"mean_noise_power:"<<data._mean_noise_power<<std::endl; - os<<"range_comp_norm_fact:"<<data._range_comp_norm_fact<<std::endl; + os<<"range_comp_norm_fact:"<<data._range_comp_norm_fact<<std::endl; - os<<"replica_power:"<<data._replica_power<<std::endl; + os<<"replica_power:"<<data._replica_power<<std::endl; - os<<"first_range_pixel_mid_az_inc:"<<data._first_range_pixel_mid_az_inc<<std::endl; + os<<"first_range_pixel_mid_az_inc:"<<data._first_range_pixel_mid_az_inc<<std::endl; - os<<"center_range_pix_mid_az_inc:"<<data._center_range_pix_mid_az_inc<<std::endl; + os<<"center_range_pix_mid_az_inc:"<<data._center_range_pix_mid_az_inc<<std::endl; - os<<"last_range_pix_mid_az_inc:"<<data._last_range_pix_mid_az_inc<<std::endl; + os<<"last_range_pix_mid_az_inc:"<<data._last_range_pix_mid_az_inc<<std::endl; - os<<"norm_ref_range_ro:"<<data._norm_ref_range_ro<<std::endl; + os<<"norm_ref_range_ro:"<<data._norm_ref_range_ro<<std::endl; - os<<"antenna_elev_flag:"<<data._antenna_elev_flag<<std::endl; + os<<"antenna_elev_flag:"<<data._antenna_elev_flag<<std::endl; - os<<"abs_cal_const_K:"<<data._abs_cal_const_K<<std::endl; + os<<"abs_cal_const_K:"<<data._abs_cal_const_K<<std::endl; - os<<"upp_bound_K:"<<data._upp_bound_K<<std::endl; + os<<"upp_bound_K:"<<data._upp_bound_K<<std::endl; - os<<"low_bound_K:"<<data._low_bound_K<<std::endl; + os<<"low_bound_K:"<<data._low_bound_K<<std::endl; - os<<"proc_noise_scale_fact:"<<data._proc_noise_scale_fact<<std::endl; + os<<"proc_noise_scale_fact:"<<data._proc_noise_scale_fact<<std::endl; - os<<"K_gen_date:"<<data._K_gen_date.c_str()<<std::endl; + os<<"K_gen_date:"<<data._K_gen_date.c_str()<<std::endl; - os<<"K_vers_num:"<<data._K_vers_num.c_str()<<std::endl; + os<<"K_vers_num:"<<data._K_vers_num.c_str()<<std::endl; - os<<"num_duplic_input_lines:"<<data._num_duplic_input_lines<<std::endl; + os<<"num_duplic_input_lines:"<<data._num_duplic_input_lines<<std::endl; - os<<"estim_bit_error_rate:"<<data._estim_bit_error_rate<<std::endl; + os<<"estim_bit_error_rate:"<<data._estim_bit_error_rate<<std::endl; - os<<"out_image_mean:"<<data._out_image_mean<<std::endl; + os<<"out_image_mean:"<<data._out_image_mean<<std::endl; - os<<"out_image_std_dev:"<<data._out_image_std_dev<<std::endl; + os<<"out_image_std_dev:"<<data._out_image_std_dev<<std::endl; - os<<"out_image_max_value:"<<data._out_image_max_value<<std::endl; + os<<"out_image_max_value:"<<data._out_image_max_value<<std::endl; - os<<"time_raw_data_first_input:"<<data._time_raw_data_first_input.c_str()<<std::endl; + os<<"time_raw_data_first_input:"<<data._time_raw_data_first_input.c_str()<<std::endl; - os<<"time_asc_node_state_vectors:"<<data._time_asc_node_state_vectors.c_str()<<std::endl; + os<<"time_asc_node_state_vectors:"<<data._time_asc_node_state_vectors.c_str()<<std::endl; - os<<"asc_node_pos_X_comp:"<<data._asc_node_pos_X_comp.c_str()<<std::endl; + os<<"asc_node_pos_X_comp:"<<data._asc_node_pos_X_comp.c_str()<<std::endl; - os<<"asc_node_pos_Y_comp:"<<data._asc_node_pos_Y_comp.c_str()<<std::endl; + os<<"asc_node_pos_Y_comp:"<<data._asc_node_pos_Y_comp.c_str()<<std::endl; - os<<"asc_node_pos_Z_comp:"<<data._asc_node_pos_Z_comp.c_str()<<std::endl; + os<<"asc_node_pos_Z_comp:"<<data._asc_node_pos_Z_comp.c_str()<<std::endl; - os<<"asc_node_vel_X_comp:"<<data._asc_node_vel_X_comp.c_str()<<std::endl; + os<<"asc_node_vel_X_comp:"<<data._asc_node_vel_X_comp.c_str()<<std::endl; - os<<"asc_node_vel_Y_comp:"<<data._asc_node_vel_Y_comp.c_str()<<std::endl; + os<<"asc_node_vel_Y_comp:"<<data._asc_node_vel_Y_comp.c_str()<<std::endl; - os<<"asc_node_vel_Z_comp:"<<data._asc_node_vel_Z_comp.c_str()<<std::endl; + os<<"asc_node_vel_Z_comp:"<<data._asc_node_vel_Z_comp.c_str()<<std::endl; - os<<"out_pixel_bit_length:"<<data._out_pixel_bit_length<<std::endl; + os<<"out_pixel_bit_length:"<<data._out_pixel_bit_length<<std::endl; - os<<"proc_gain_param_1:"<<data._proc_gain_param_1<<std::endl; + os<<"proc_gain_param_1:"<<data._proc_gain_param_1<<std::endl; - os<<"proc_gain_param_2:"<<data._proc_gain_param_2<<std::endl; + os<<"proc_gain_param_2:"<<data._proc_gain_param_2<<std::endl; - os<<"proc_gain_param_3:"<<data._proc_gain_param_3<<std::endl; + os<<"proc_gain_param_3:"<<data._proc_gain_param_3<<std::endl; - os<<"peak_loc_cross_correl_fun:"<<data._peak_loc_cross_correl_fun<<std::endl; + os<<"peak_loc_cross_correl_fun:"<<data._peak_loc_cross_correl_fun<<std::endl; - os<<"3_dB_width_CCF:"<<data._3_dB_width_CCF<<std::endl; + os<<"3_dB_width_CCF:"<<data._3_dB_width_CCF<<std::endl; - os<<"first_side_lobe_level:"<<data._first_side_lobe_level<<std::endl; + os<<"first_side_lobe_level:"<<data._first_side_lobe_level<<std::endl; - os<<"ISLR_CCF_between_last:"<<data._ISLR_CCF_between_last<<std::endl; + os<<"ISLR_CCF_between_last:"<<data._ISLR_CCF_between_last<<std::endl; - os<<"peak_loc_CCF_betw_last:"<<data._peak_loc_CCF_betw_last<<std::endl; + os<<"peak_loc_CCF_betw_last:"<<data._peak_loc_CCF_betw_last<<std::endl; - os<<"Roll_Tilt_Mode_flag:"<<data._Roll_Tilt_Mode_flag<<std::endl; + os<<"Roll_Tilt_Mode_flag:"<<data._Roll_Tilt_Mode_flag<<std::endl; - os<<"raw_data_correction_flag:"<<data._raw_data_correction_flag<<std::endl; + os<<"raw_data_correction_flag:"<<data._raw_data_correction_flag<<std::endl; - os<<"look_detecion_flag:"<<data._look_detecion_flag<<std::endl; + os<<"look_detecion_flag:"<<data._look_detecion_flag<<std::endl; - os<<"doppler_ambiguity_estimat_flag:"<<data._doppler_ambiguity_estimat_flag<<std::endl; + os<<"doppler_ambiguity_estimat_flag:"<<data._doppler_ambiguity_estimat_flag<<std::endl; - os<<"azimuth_baseband_convers_flag:"<<data._azimuth_baseband_convers_flag<<std::endl; + os<<"azimuth_baseband_convers_flag:"<<data._azimuth_baseband_convers_flag<<std::endl; - os<<"samples_per_line_used:"<<data._samples_per_line_used<<std::endl; + os<<"samples_per_line_used:"<<data._samples_per_line_used<<std::endl; - os<<"range_lines_skip_factor:"<<data._range_lines_skip_factor<<std::endl; + os<<"range_lines_skip_factor:"<<data._range_lines_skip_factor<<std::endl; - os<<"time_of_inp_state_vectors:"<<data._time_of_inp_state_vectors.c_str()<<std::endl; + os<<"time_of_inp_state_vectors:"<<data._time_of_inp_state_vectors.c_str()<<std::endl; - os<<"inp_state_vect_pos_X_comp:"<<data._inp_state_vect_pos_X_comp.c_str()<<std::endl; + os<<"inp_state_vect_pos_X_comp:"<<data._inp_state_vect_pos_X_comp.c_str()<<std::endl; - os<<"inp_state_vect_pos_Y_comp:"<<data._inp_state_vect_pos_Y_comp.c_str()<<std::endl; + os<<"inp_state_vect_pos_Y_comp:"<<data._inp_state_vect_pos_Y_comp.c_str()<<std::endl; - os<<"inp_state_vect_pos_Z_comp:"<<data._inp_state_vect_pos_Z_comp.c_str()<<std::endl; + os<<"inp_state_vect_pos_Z_comp:"<<data._inp_state_vect_pos_Z_comp.c_str()<<std::endl; - os<<"inp_state_vect_vel_Vx_comp:"<<data._inp_state_vect_vel_Vx_comp.c_str()<<std::endl; + os<<"inp_state_vect_vel_Vx_comp:"<<data._inp_state_vect_vel_Vx_comp.c_str()<<std::endl; - os<<"inp_state_vect_vel_Vy_comp:"<<data._inp_state_vect_vel_Vy_comp.c_str()<<std::endl; + os<<"inp_state_vect_vel_Vy_comp:"<<data._inp_state_vect_vel_Vy_comp.c_str()<<std::endl; - os<<"inp_state_vect_vel_Vz_comp:"<<data._inp_state_vect_vel_Vz_comp.c_str()<<std::endl; + os<<"inp_state_vect_vel_Vz_comp:"<<data._inp_state_vect_vel_Vz_comp.c_str()<<std::endl; - os<<"inp_state_vector_type_flag:"<<data._inp_state_vector_type_flag<<std::endl; + os<<"inp_state_vector_type_flag:"<<data._inp_state_vector_type_flag<<std::endl; - os<<"win_coeff_for_range_match:"<<data._win_coeff_for_range_match<<std::endl; + os<<"win_coeff_for_range_match:"<<data._win_coeff_for_range_match<<std::endl; - os<<"win_coeff_for_azi_match:"<<data._win_coeff_for_azi_match<<std::endl; + os<<"win_coeff_for_azi_match:"<<data._win_coeff_for_azi_match<<std::endl; - os<<"update_period_range_match:"<<data._update_period_range_match<<std::endl; + os<<"update_period_range_match:"<<data._update_period_range_match<<std::endl; - os<<"look_scalar_gain_1:"<<data._look_scalar_gain_1<<std::endl; + os<<"look_scalar_gain_1:"<<data._look_scalar_gain_1<<std::endl; - os<<"look_scalar_gain_2:"<<data._look_scalar_gain_2<<std::endl; + os<<"look_scalar_gain_2:"<<data._look_scalar_gain_2<<std::endl; - os<<"look_scalar_gain_3:"<<data._look_scalar_gain_3<<std::endl; + os<<"look_scalar_gain_3:"<<data._look_scalar_gain_3<<std::endl; - os<<"look_scalar_gain_4:"<<data._look_scalar_gain_4<<std::endl; + os<<"look_scalar_gain_4:"<<data._look_scalar_gain_4<<std::endl; - os<<"look_scalar_gain_5:"<<data._look_scalar_gain_5<<std::endl; + os<<"look_scalar_gain_5:"<<data._look_scalar_gain_5<<std::endl; - os<<"look_scalar_gain_6:"<<data._look_scalar_gain_6<<std::endl; + os<<"look_scalar_gain_6:"<<data._look_scalar_gain_6<<std::endl; - os<<"look_scalar_gain_7:"<<data._look_scalar_gain_7<<std::endl; + os<<"look_scalar_gain_7:"<<data._look_scalar_gain_7<<std::endl; - os<<"look_scalar_gain_8:"<<data._look_scalar_gain_8<<std::endl; + os<<"look_scalar_gain_8:"<<data._look_scalar_gain_8<<std::endl; - os<<"samp_window_start_time_bias:"<<data._samp_window_start_time_bias<<std::endl; + os<<"samp_window_start_time_bias:"<<data._samp_window_start_time_bias<<std::endl; - os<<"doppler_centroid_cubic_coeff:"<<data._doppler_centroid_cubic_coeff<<std::endl; + os<<"doppler_centroid_cubic_coeff:"<<data._doppler_centroid_cubic_coeff<<std::endl; - os<<"PRF_code_first_range_line:"<<data._PRF_code_first_range_line<<std::endl; + os<<"PRF_code_first_range_line:"<<data._PRF_code_first_range_line<<std::endl; - os<<"PRF_code_last_range_line:"<<data._PRF_code_last_range_line<<std::endl; + os<<"PRF_code_last_range_line:"<<data._PRF_code_last_range_line<<std::endl; - os<<"samp_win_start_first:"<<data._samp_win_start_first<<std::endl; + os<<"samp_win_start_first:"<<data._samp_win_start_first<<std::endl; - os<<"samp_win_start_last:"<<data._samp_win_start_last<<std::endl; + os<<"samp_win_start_last:"<<data._samp_win_start_last<<std::endl; - os<<"cal_syst_gain_last_proc:"<<data._cal_syst_gain_last_proc<<std::endl; + os<<"cal_syst_gain_last_proc:"<<data._cal_syst_gain_last_proc<<std::endl; - os<<"receiver_gain_last_proc:"<<data._receiver_gain_last_proc<<std::endl; + os<<"receiver_gain_last_proc:"<<data._receiver_gain_last_proc<<std::endl; - os<<"first_processed_range_sample:"<<data._first_processed_range_sample<<std::endl; + os<<"first_processed_range_sample:"<<data._first_processed_range_sample<<std::endl; - os<<"azimuth_FFT_IFFT_ratio:"<<data._azimuth_FFT_IFFT_ratio<<std::endl; + os<<"azimuth_FFT_IFFT_ratio:"<<data._azimuth_FFT_IFFT_ratio<<std::endl; - os<<"num_azimuth_blocks_proc:"<<data._num_azimuth_blocks_proc<<std::endl; + os<<"num_azimuth_blocks_proc:"<<data._num_azimuth_blocks_proc<<std::endl; - os<<"num_input_raw_data_lines:"<<data._num_input_raw_data_lines<<std::endl; + os<<"num_input_raw_data_lines:"<<data._num_input_raw_data_lines<<std::endl; - os<<"initial_doppler_ambiguity_num:"<<data._initial_doppler_ambiguity_num<<std::endl; + os<<"initial_doppler_ambiguity_num:"<<data._initial_doppler_ambiguity_num<<std::endl; - os<<"thresh_no_1_flag:"<<data._thresh_no_1_flag<<std::endl; + os<<"thresh_no_1_flag:"<<data._thresh_no_1_flag<<std::endl; - os<<"thresh_no_2_flag:"<<data._thresh_no_2_flag<<std::endl; + os<<"thresh_no_2_flag:"<<data._thresh_no_2_flag<<std::endl; - os<<"thresh_no_3_flag:"<<data._thresh_no_3_flag<<std::endl; + os<<"thresh_no_3_flag:"<<data._thresh_no_3_flag<<std::endl; - os<<"thresh_no_4_flag:"<<data._thresh_no_4_flag<<std::endl; + os<<"thresh_no_4_flag:"<<data._thresh_no_4_flag<<std::endl; - os<<"thresh_no_5_flag:"<<data._thresh_no_5_flag<<std::endl; + os<<"thresh_no_5_flag:"<<data._thresh_no_5_flag<<std::endl; - os<<"thresh_no_6_flag:"<<data._thresh_no_6_flag<<std::endl; + os<<"thresh_no_6_flag:"<<data._thresh_no_6_flag<<std::endl; - os<<"thresh_no_7_flag:"<<data._thresh_no_7_flag<<std::endl; + os<<"thresh_no_7_flag:"<<data._thresh_no_7_flag<<std::endl; - os<<"thresh_no_8_flag:"<<data._thresh_no_8_flag<<std::endl; + os<<"thresh_no_8_flag:"<<data._thresh_no_8_flag<<std::endl; - os<<"thresh_no_9_flag:"<<data._thresh_no_9_flag<<std::endl; + os<<"thresh_no_9_flag:"<<data._thresh_no_9_flag<<std::endl; - os<<"thresh_no_10_flag:"<<data._thresh_no_10_flag<<std::endl; + os<<"thresh_no_10_flag:"<<data._thresh_no_10_flag<<std::endl; - os<<"thresh_no_11_flag:"<<data._thresh_no_11_flag<<std::endl; + os<<"thresh_no_11_flag:"<<data._thresh_no_11_flag<<std::endl; - os<<"sat_binary_time_of_first:"<<data._sat_binary_time_of_first<<std::endl; + os<<"sat_binary_time_of_first:"<<data._sat_binary_time_of_first<<std::endl; - os<<"num_valid_pixels_per_range:"<<data._num_valid_pixels_per_range<<std::endl; + os<<"num_valid_pixels_per_range:"<<data._num_valid_pixels_per_range<<std::endl; - os<<"num_range_samp_discarded:"<<data._num_range_samp_discarded<<std::endl; + os<<"num_range_samp_discarded:"<<data._num_range_samp_discarded<<std::endl; - os<<"I_gain_imb_lower_bound:"<<data._I_gain_imb_lower_bound<<std::endl; + os<<"I_gain_imb_lower_bound:"<<data._I_gain_imb_lower_bound<<std::endl; - os<<"I_gain_imb_upper_bound:"<<data._I_gain_imb_upper_bound<<std::endl; + os<<"I_gain_imb_upper_bound:"<<data._I_gain_imb_upper_bound<<std::endl; - os<<"I_Q_quad_depar_lower_bound:"<<data._I_Q_quad_depar_lower_bound<<std::endl; + os<<"I_Q_quad_depar_lower_bound:"<<data._I_Q_quad_depar_lower_bound<<std::endl; - os<<"I_Q_quad_depar_upper_bound:"<<data._I_Q_quad_depar_upper_bound<<std::endl; + os<<"I_Q_quad_depar_upper_bound:"<<data._I_Q_quad_depar_upper_bound<<std::endl; - os<<"3_dB_look_bandwidth:"<<data._3_dB_look_bandwidth<<std::endl; + os<<"3_dB_look_bandwidth:"<<data._3_dB_look_bandwidth<<std::endl; - os<<"3_dB_look_proc_dopp_bandw:"<<data._3_dB_look_proc_dopp_bandw<<std::endl; + os<<"3_dB_look_proc_dopp_bandw:"<<data._3_dB_look_proc_dopp_bandw<<std::endl; - os<<"range_spread_loss_comp_flag:"<<data._range_spread_loss_comp_flag<<std::endl; + os<<"range_spread_loss_comp_flag:"<<data._range_spread_loss_comp_flag<<std::endl; - os<<"datation_flag:"<<data._datation_flag<<std::endl; + os<<"datation_flag:"<<data._datation_flag<<std::endl; - os<<"max_error_range_line_timing:"<<data._max_error_range_line_timing<<std::endl; + os<<"max_error_range_line_timing:"<<data._max_error_range_line_timing<<std::endl; - os<<"form_num_range_line_used:"<<data._form_num_range_line_used<<std::endl; + os<<"form_num_range_line_used:"<<data._form_num_range_line_used<<std::endl; - os<<"autom_look_scal_gain_flag:"<<data._autom_look_scal_gain_flag<<std::endl; + os<<"autom_look_scal_gain_flag:"<<data._autom_look_scal_gain_flag<<std::endl; - os<<"max_value_look_scalar_gain:"<<data._max_value_look_scalar_gain<<std::endl; + os<<"max_value_look_scalar_gain:"<<data._max_value_look_scalar_gain<<std::endl; - os<<"replica_norm_method_flag:"<<data._replica_norm_method_flag<<std::endl; + os<<"replica_norm_method_flag:"<<data._replica_norm_method_flag<<std::endl; - os<<"coef_ground_range_1:"<<data._coef_ground_range_1<<std::endl; + os<<"coef_ground_range_1:"<<data._coef_ground_range_1<<std::endl; - os<<"coef_ground_range_2:"<<data._coef_ground_range_2<<std::endl; + os<<"coef_ground_range_2:"<<data._coef_ground_range_2<<std::endl; - os<<"coef_ground_range_3:"<<data._coef_ground_range_3<<std::endl; + os<<"coef_ground_range_3:"<<data._coef_ground_range_3<<std::endl; - os<<"coef_ground_range_4:"<<data._coef_ground_range_4<<std::endl; + os<<"coef_ground_range_4:"<<data._coef_ground_range_4<<std::endl; - os<<"coef_ant_elev_1:"<<data._coef_ant_elev_1<<std::endl; + os<<"coef_ant_elev_1:"<<data._coef_ant_elev_1<<std::endl; - os<<"coef_ant_elev_2:"<<data._coef_ant_elev_2<<std::endl; + os<<"coef_ant_elev_2:"<<data._coef_ant_elev_2<<std::endl; - os<<"coef_ant_elev_3:"<<data._coef_ant_elev_3<<std::endl; + os<<"coef_ant_elev_3:"<<data._coef_ant_elev_3<<std::endl; - os<<"coef_ant_elev_4:"<<data._coef_ant_elev_4<<std::endl; + os<<"coef_ant_elev_4:"<<data._coef_ant_elev_4<<std::endl; - os<<"coef_ant_elev_5:"<<data._coef_ant_elev_5<<std::endl; + os<<"coef_ant_elev_5:"<<data._coef_ant_elev_5<<std::endl; - os<<"range_time_origin_ant:"<<data._range_time_origin_ant<<std::endl; + os<<"range_time_origin_ant:"<<data._range_time_origin_ant<<std::endl; - return os; + return os; } std::istream& operator>>(std::istream& is, ErsSarFacilityData& data) { - char buf64[65]; - buf64[64] = '\0'; - char buf32[33]; - buf32[32] = '\0'; - char buf24[25]; - buf24[24]='\0'; - char buf22[23]; - buf22[22]='\0'; - char buf20[21]; - buf20[20]='\0'; - char buf16[17]; - buf16[16]='\0'; - char buf12[13]; - buf12[12] = '\0'; - char buf7[8]; - buf7[7] = '\0'; - char buf8[9]; - buf8[8] = '\0'; - char buf6[7]; - buf6[6] = '\0'; - char buf4[5]; - buf4[4] = '\0'; - char buf2[3]; - buf2[2] = '\0'; - char buf1[2]; - buf1[1] = '\0'; + char buf64[65]; + buf64[64] = '\0'; + char buf32[33]; + buf32[32] = '\0'; + char buf24[25]; + buf24[24]='\0'; + char buf22[23]; + buf22[22]='\0'; + char buf20[21]; + buf20[20]='\0'; + char buf16[17]; + buf16[16]='\0'; + char buf12[13]; + buf12[12] = '\0'; + char buf7[8]; + buf7[7] = '\0'; + char buf8[9]; + buf8[8] = '\0'; + char buf6[7]; + buf6[6] = '\0'; + char buf4[5]; + buf4[4] = '\0'; + char buf2[3]; + buf2[2] = '\0'; + char buf1[2]; + buf1[1] = '\0'; - is.read(buf64,64); - data._name_of_facil_rec = buf64; + is.read(buf64,64); + data._name_of_facil_rec = buf64; - is.read(buf6,6); - data._last_release_qc_date = buf6; + is.read(buf6,6); + data._last_release_qc_date = buf6; - is.read(buf2,2); + is.read(buf2,2); - is.read(buf6,6); - data._last_release_cal_date = buf6; + is.read(buf6,6); + data._last_release_cal_date = buf6; - is.read(buf4,4); - data._qa_summary_flag = atoi(buf4); + is.read(buf4,4); + data._qa_summary_flag = atoi(buf4); - is.read(buf4,4); - data._prf_code_change_flag = atoi(buf4); + is.read(buf4,4); + data._prf_code_change_flag = atoi(buf4); - is.read(buf4,4); - data._sampling_win_change_flag = atoi(buf4); + is.read(buf4,4); + data._sampling_win_change_flag = atoi(buf4); - is.read(buf4,4); - data._cal_gain_change_flag = atoi(buf4); + is.read(buf4,4); + data._cal_gain_change_flag = atoi(buf4); - is.read(buf4,4); - data._quirp_qu_flag = atoi(buf4); + is.read(buf4,4); + data._quirp_qu_flag = atoi(buf4); - is.read(buf4,4); - data._inp_data_stat_flag = atoi(buf4); + is.read(buf4,4); + data._inp_data_stat_flag = atoi(buf4); - is.read(buf4,4); - data._dopp_cent_conf_meas_flag = atoi(buf4); + is.read(buf4,4); + data._dopp_cent_conf_meas_flag = atoi(buf4); - is.read(buf4,4); - data._dopp_cent_val_flag = atoi(buf4); + is.read(buf4,4); + data._dopp_cent_val_flag = atoi(buf4); - is.read(buf4,4); - data._dopp_ambig_conf_meas_flag = atoi(buf4); + is.read(buf4,4); + data._dopp_ambig_conf_meas_flag = atoi(buf4); - is.read(buf4,4); - data._outp_data_mean_flag = atoi(buf4); + is.read(buf4,4); + data._outp_data_mean_flag = atoi(buf4); - is.read(buf4,4); - data._OGOB_flag = atoi(buf4); + is.read(buf4,4); + data._OGOB_flag = atoi(buf4); - is.read(buf4,4); - data._PRF_changes = atoi(buf4); + is.read(buf4,4); + data._PRF_changes = atoi(buf4); - is.read(buf4,4); - data._sampling_win_changes = atoi(buf4); + is.read(buf4,4); + data._sampling_win_changes = atoi(buf4); - is.read(buf4,4); - data._cal_gain_changes = atoi(buf4); + is.read(buf4,4); + data._cal_gain_changes = atoi(buf4); - is.read(buf4,4); - data._missing_lines = atoi(buf4); + is.read(buf4,4); + data._missing_lines = atoi(buf4); - is.read(buf4,4); - data._rec_gain_changes = atoi(buf4); + is.read(buf4,4); + data._rec_gain_changes = atoi(buf4); - is.read(buf16,16); - data._pulse_width_of_ACF_3db = atof(buf16); + is.read(buf16,16); + data._pulse_width_of_ACF_3db = atof(buf16); - is.read(buf16,16); - data._first_side_lobe_lev_of_ACF = atof(buf16); + is.read(buf16,16); + data._first_side_lobe_lev_of_ACF = atof(buf16); - is.read(buf16,16); - data._ISLR_of_ACF = atof(buf16); + is.read(buf16,16); + data._ISLR_of_ACF = atof(buf16); - is.read(buf16,16); - data._dopp_cent_conf_meas = atof(buf16); + is.read(buf16,16); + data._dopp_cent_conf_meas = atof(buf16); - is.read(buf16,16); - data._dopp_ambig_conf_meas = atof(buf16); + is.read(buf16,16); + data._dopp_ambig_conf_meas = atof(buf16); - is.read(buf16,16); - data._inp_data_I_mean = atof(buf16); + is.read(buf16,16); + data._inp_data_I_mean = atof(buf16); - is.read(buf16,16); - data._inp_data_Q_mean = atof(buf16); + is.read(buf16,16); + data._inp_data_Q_mean = atof(buf16); - is.read(buf16,16); - data._inp_data_I_stddev = atof(buf16); + is.read(buf16,16); + data._inp_data_I_stddev = atof(buf16); - is.read(buf16,16); - data._inp_data_Q_stddev = atof(buf16); + is.read(buf16,16); + data._inp_data_Q_stddev = atof(buf16); - is.read(buf16,16); - data._cal_sys_gain = atof(buf16); + is.read(buf16,16); + data._cal_sys_gain = atof(buf16); - is.read(buf16,16); - data._first_rec_gain_read = atof(buf16); + is.read(buf16,16); + data._first_rec_gain_read = atof(buf16); - is.read(buf16,16); - data._dopp_ambig_num = atof(buf16); + is.read(buf16,16); + data._dopp_ambig_num = atof(buf16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf16,16); - data._I_channel_bias_correction = atof(buf16); + is.read(buf16,16); + data._I_channel_bias_correction = atof(buf16); - is.read(buf16,16); - data._Q_channel_bias_correction = atof(buf16); + is.read(buf16,16); + data._Q_channel_bias_correction = atof(buf16); - is.read(buf16,16); - data._I_channel_gain_correction = atof(buf16); + is.read(buf16,16); + data._I_channel_gain_correction = atof(buf16); - is.read(buf16,16); - data._Q_channel_gain_correction = atof(buf16); + is.read(buf16,16); + data._Q_channel_gain_correction = atof(buf16); - is.read(buf16,16); - data._Q_channel_I_Q_correction = atof(buf16); + is.read(buf16,16); + data._Q_channel_I_Q_correction = atof(buf16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf16,16); - data._noise_power = atof(buf16); + is.read(buf16,16); + data._noise_power = atof(buf16); - is.read(buf16,16); - data._int_cal_utc = atoi(buf16); + is.read(buf16,16); + data._int_cal_utc = atoi(buf16); - is.read(buf4,4); - data._num_valid_cal_pulses = atoi(buf4); + is.read(buf4,4); + data._num_valid_cal_pulses = atoi(buf4); - is.read(buf4,4); - data._num_valid_noise_pulses = atoi(buf4); + is.read(buf4,4); + data._num_valid_noise_pulses = atoi(buf4); - is.read(buf4,4); - data._num_valid_replicas = atoi(buf4); + is.read(buf4,4); + data._num_valid_replicas = atoi(buf4); - is.read(buf16,16); - data._first_replica_sample = atof(buf16); + is.read(buf16,16); + data._first_replica_sample = atof(buf16); - is.read(buf16,16); - data._mean_cal_pulse_power = atof(buf16); + is.read(buf16,16); + data._mean_cal_pulse_power = atof(buf16); - is.read(buf16,16); - data._mean_noise_power = atof(buf16); + is.read(buf16,16); + data._mean_noise_power = atof(buf16); - is.read(buf16,16); - data._range_comp_norm_fact = atof(buf16); + is.read(buf16,16); + data._range_comp_norm_fact = atof(buf16); - is.read(buf16,16); - data._replica_power = atof(buf16); + is.read(buf16,16); + data._replica_power = atof(buf16); - is.read(buf16,16); - data._first_range_pixel_mid_az_inc = atof(buf16); + is.read(buf16,16); + data._first_range_pixel_mid_az_inc = atof(buf16); - is.read(buf16,16); - data._center_range_pix_mid_az_inc = atof(buf16); + is.read(buf16,16); + data._center_range_pix_mid_az_inc = atof(buf16); - is.read(buf16,16); - data._last_range_pix_mid_az_inc = atof(buf16); + is.read(buf16,16); + data._last_range_pix_mid_az_inc = atof(buf16); - is.read(buf16,16); - data._norm_ref_range_ro = atof(buf16); + is.read(buf16,16); + data._norm_ref_range_ro = atof(buf16); - is.read(buf12,12); + is.read(buf12,12); - is.read(buf4,4); - data._antenna_elev_flag = atoi(buf4); + is.read(buf4,4); + data._antenna_elev_flag = atoi(buf4); - is.read(buf16,16); - data._abs_cal_const_K = atof(buf16); + is.read(buf16,16); + data._abs_cal_const_K = atof(buf16); - is.read(buf16,16); - data._upp_bound_K = atof(buf16); + is.read(buf16,16); + data._upp_bound_K = atof(buf16); - is.read(buf16,16); - data._low_bound_K = atof(buf16); + is.read(buf16,16); + data._low_bound_K = atof(buf16); - is.read(buf16,16); - data._proc_noise_scale_fact = atof(buf16); + is.read(buf16,16); + data._proc_noise_scale_fact = atof(buf16); - is.read(buf6,6); - data._K_gen_date = buf6; + is.read(buf6,6); + data._K_gen_date = buf6; - is.read(buf4,4); - data._K_vers_num = buf4; + is.read(buf4,4); + data._K_vers_num = buf4; - is.read(buf4,4); - data._num_duplic_input_lines = atoi(buf4); + is.read(buf4,4); + data._num_duplic_input_lines = atoi(buf4); - is.read(buf16,16); - data._estim_bit_error_rate = atof(buf16); + is.read(buf16,16); + data._estim_bit_error_rate = atof(buf16); - is.read(buf12,12); + is.read(buf12,12); - is.read(buf16,16); - data._out_image_mean = atof(buf16); + is.read(buf16,16); + data._out_image_mean = atof(buf16); - is.read(buf16,16); - data._out_image_std_dev = atof(buf16); + is.read(buf16,16); + data._out_image_std_dev = atof(buf16); - is.read(buf16,16); - data._out_image_max_value = atof(buf16); + is.read(buf16,16); + data._out_image_max_value = atof(buf16); - is.read(buf24,24); - data._time_raw_data_first_input = buf24; + is.read(buf24,24); + data._time_raw_data_first_input = buf24; - is.read(buf24,24); - data._time_asc_node_state_vectors = buf24; + is.read(buf24,24); + data._time_asc_node_state_vectors = buf24; - is.read(buf22,22); - data._asc_node_pos_X_comp = buf22; + is.read(buf22,22); + data._asc_node_pos_X_comp = buf22; - is.read(buf22,22); - data._asc_node_pos_Y_comp = buf22; + is.read(buf22,22); + data._asc_node_pos_Y_comp = buf22; - is.read(buf22,22); - data._asc_node_pos_Z_comp = buf22; + is.read(buf22,22); + data._asc_node_pos_Z_comp = buf22; - is.read(buf22,22); - data._asc_node_vel_X_comp = buf22; + is.read(buf22,22); + data._asc_node_vel_X_comp = buf22; - is.read(buf22,22); - data._asc_node_vel_Y_comp = buf22; + is.read(buf22,22); + data._asc_node_vel_Y_comp = buf22; - is.read(buf22,22); - data._asc_node_vel_Z_comp = buf22; + is.read(buf22,22); + data._asc_node_vel_Z_comp = buf22; - is.read(buf4,4); - data._out_pixel_bit_length = atoi(buf4); + is.read(buf4,4); + data._out_pixel_bit_length = atoi(buf4); - is.read(buf16,16); - data._proc_gain_param_1 = atof(buf16); + is.read(buf16,16); + data._proc_gain_param_1 = atof(buf16); - is.read(buf16,16); - data._proc_gain_param_2 = atof(buf16); + is.read(buf16,16); + data._proc_gain_param_2 = atof(buf16); - is.read(buf16,16); - data._proc_gain_param_3 = atof(buf16); + is.read(buf16,16); + data._proc_gain_param_3 = atof(buf16); - is.read(buf4,4); - data._peak_loc_cross_correl_fun = atoi(buf4); + is.read(buf4,4); + data._peak_loc_cross_correl_fun = atoi(buf4); - is.read(buf16,16); - data._3_dB_width_CCF = atof(buf16); + is.read(buf16,16); + data._3_dB_width_CCF = atof(buf16); - is.read(buf16,16); - data._first_side_lobe_level = atof(buf16); + is.read(buf16,16); + data._first_side_lobe_level = atof(buf16); - is.read(buf16,16); - data._ISLR_CCF_between_last = atof(buf16); + is.read(buf16,16); + data._ISLR_CCF_between_last = atof(buf16); - is.read(buf4,4); - data._peak_loc_CCF_betw_last = atoi(buf4); + is.read(buf4,4); + data._peak_loc_CCF_betw_last = atoi(buf4); - is.read(buf4,4); - data._Roll_Tilt_Mode_flag = atoi(buf4); + is.read(buf4,4); + data._Roll_Tilt_Mode_flag = atoi(buf4); - is.read(buf4,4); - data._raw_data_correction_flag = atoi(buf4); + is.read(buf4,4); + data._raw_data_correction_flag = atoi(buf4); - is.read(buf4,4); - data._look_detecion_flag = atoi(buf4); + is.read(buf4,4); + data._look_detecion_flag = atoi(buf4); - is.read(buf4,4); - data._doppler_ambiguity_estimat_flag = atoi(buf4); + is.read(buf4,4); + data._doppler_ambiguity_estimat_flag = atoi(buf4); - is.read(buf4,4); - data._azimuth_baseband_convers_flag = atoi(buf4); + is.read(buf4,4); + data._azimuth_baseband_convers_flag = atoi(buf4); - is.read(buf4,4); - data._samples_per_line_used = atoi(buf4); + is.read(buf4,4); + data._samples_per_line_used = atoi(buf4); - is.read(buf4,4); - data._range_lines_skip_factor = atoi(buf4); + is.read(buf4,4); + data._range_lines_skip_factor = atoi(buf4); - is.read(buf24,24); - data._time_of_inp_state_vectors = buf24; + is.read(buf24,24); + data._time_of_inp_state_vectors = buf24; - is.read(buf22,22); - data._inp_state_vect_pos_X_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_pos_X_comp = buf22; - is.read(buf22,22); - data._inp_state_vect_pos_Y_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_pos_Y_comp = buf22; - is.read(buf22,22); - data._inp_state_vect_pos_Z_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_pos_Z_comp = buf22; - is.read(buf22,22); - data._inp_state_vect_vel_Vx_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_vel_Vx_comp = buf22; - is.read(buf22,22); - data._inp_state_vect_vel_Vy_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_vel_Vy_comp = buf22; - is.read(buf22,22); - data._inp_state_vect_vel_Vz_comp = buf22; + is.read(buf22,22); + data._inp_state_vect_vel_Vz_comp = buf22; - is.read(buf4,4); - data._inp_state_vector_type_flag = atoi(buf4); + is.read(buf4,4); + data._inp_state_vector_type_flag = atoi(buf4); - is.read(buf16,16); - data._win_coeff_for_range_match = atof(buf16); + is.read(buf16,16); + data._win_coeff_for_range_match = atof(buf16); - is.read(buf16,16); - data._win_coeff_for_azi_match = atof(buf16); + is.read(buf16,16); + data._win_coeff_for_azi_match = atof(buf16); - is.read(buf4,4); - data._update_period_range_match = atoi(buf4); + is.read(buf4,4); + data._update_period_range_match = atoi(buf4); - is.read(buf16,16); - data._look_scalar_gain_1 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_1 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_2 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_2 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_3 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_3 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_4 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_4 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_5 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_5 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_6 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_6 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_7 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_7 = atof(buf16); - is.read(buf16,16); - data._look_scalar_gain_8 = atof(buf16); + is.read(buf16,16); + data._look_scalar_gain_8 = atof(buf16); - is.read(buf4,4); - data._samp_window_start_time_bias = atoi(buf4); + is.read(buf4,4); + data._samp_window_start_time_bias = atoi(buf4); - is.read(buf22,22); - data._doppler_centroid_cubic_coeff = atof(buf22); + is.read(buf22,22); + data._doppler_centroid_cubic_coeff = atof(buf22); - is.read(buf4,4); - data._PRF_code_first_range_line = atoi(buf4); + is.read(buf4,4); + data._PRF_code_first_range_line = atoi(buf4); - is.read(buf4,4); - data._PRF_code_last_range_line = atoi(buf4); + is.read(buf4,4); + data._PRF_code_last_range_line = atoi(buf4); - is.read(buf4,4); - data._samp_win_start_first = atoi(buf4); + is.read(buf4,4); + data._samp_win_start_first = atoi(buf4); - is.read(buf4,4); - data._samp_win_start_last = atoi(buf4); + is.read(buf4,4); + data._samp_win_start_last = atoi(buf4); - is.read(buf4,4); - data._cal_syst_gain_last_proc = atoi(buf4); + is.read(buf4,4); + data._cal_syst_gain_last_proc = atoi(buf4); - is.read(buf4,4); - data._receiver_gain_last_proc = atoi(buf4); + is.read(buf4,4); + data._receiver_gain_last_proc = atoi(buf4); - is.read(buf4,4); - data._first_processed_range_sample = atoi(buf4); + is.read(buf4,4); + data._first_processed_range_sample = atoi(buf4); - is.read(buf4,4); - data._azimuth_FFT_IFFT_ratio = atoi(buf4); + is.read(buf4,4); + data._azimuth_FFT_IFFT_ratio = atoi(buf4); - is.read(buf4,4); - data._num_azimuth_blocks_proc = atoi(buf4); + is.read(buf4,4); + data._num_azimuth_blocks_proc = atoi(buf4); - is.read(buf8,8); - data._num_input_raw_data_lines = atol(buf8); + is.read(buf8,8); + data._num_input_raw_data_lines = atol(buf8); - is.read(buf4,4); - data._initial_doppler_ambiguity_num = atoi(buf4); + is.read(buf4,4); + data._initial_doppler_ambiguity_num = atoi(buf4); - is.read(buf16,16); - data._thresh_no_1_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_1_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_2_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_2_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_3_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_3_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_4_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_4_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_5_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_5_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_6_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_6_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_7_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_7_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_8_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_8_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_9_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_9_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_10_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_10_flag = atof(buf16); - is.read(buf16,16); - data._thresh_no_11_flag = atof(buf16); + is.read(buf16,16); + data._thresh_no_11_flag = atof(buf16); - is.read(buf16,16); - data._sat_binary_time_of_first = atol(buf16); + is.read(buf16,16); + data._sat_binary_time_of_first = atol(buf16); - is.read(buf4,4); - data._num_valid_pixels_per_range = atoi(buf4); + is.read(buf4,4); + data._num_valid_pixels_per_range = atoi(buf4); - is.read(buf4,4); - data._num_range_samp_discarded = atoi(buf4); + is.read(buf4,4); + data._num_range_samp_discarded = atoi(buf4); - is.read(buf16,16); - data._I_gain_imb_lower_bound = atof(buf16); + is.read(buf16,16); + data._I_gain_imb_lower_bound = atof(buf16); - is.read(buf16,16); - data._I_gain_imb_upper_bound = atof(buf16); + is.read(buf16,16); + data._I_gain_imb_upper_bound = atof(buf16); - is.read(buf16,16); - data._I_Q_quad_depar_lower_bound = atof(buf16); + is.read(buf16,16); + data._I_Q_quad_depar_lower_bound = atof(buf16); - is.read(buf16,16); - data._I_Q_quad_depar_upper_bound = atof(buf16); + is.read(buf16,16); + data._I_Q_quad_depar_upper_bound = atof(buf16); - is.read(buf16,16); - data._3_dB_look_bandwidth = atof(buf16); + is.read(buf16,16); + data._3_dB_look_bandwidth = atof(buf16); - is.read(buf16,16); - data._3_dB_look_proc_dopp_bandw = atof(buf16); + is.read(buf16,16); + data._3_dB_look_proc_dopp_bandw = atof(buf16); - is.read(buf4,4); - data._range_spread_loss_comp_flag = atoi(buf4); + is.read(buf4,4); + data._range_spread_loss_comp_flag = atoi(buf4); - is.read(buf1,1); - data._datation_flag = atoi(buf1); + is.read(buf1,1); + data._datation_flag = atoi(buf1); - is.read(buf7,7); - data._max_error_range_line_timing = atoi(buf7); + is.read(buf7,7); + data._max_error_range_line_timing = atoi(buf7); - is.read(buf7,7); - data._form_num_range_line_used = atoi(buf7); + is.read(buf7,7); + data._form_num_range_line_used = atoi(buf7); - is.read(buf1,1); - data._autom_look_scal_gain_flag = atoi(buf1); + is.read(buf1,1); + data._autom_look_scal_gain_flag = atoi(buf1); - is.read(buf4,4); - data._max_value_look_scalar_gain = atoi(buf4); + is.read(buf4,4); + data._max_value_look_scalar_gain = atoi(buf4); - is.read(buf4,4); - data._replica_norm_method_flag = atoi(buf4); + is.read(buf4,4); + data._replica_norm_method_flag = atoi(buf4); - is.read(buf20,20); - data._coef_ground_range_1 = atof(buf20); + is.read(buf20,20); + data._coef_ground_range_1 = atof(buf20); - is.read(buf20,20); - data._coef_ground_range_2 = atof(buf20); + is.read(buf20,20); + data._coef_ground_range_2 = atof(buf20); - is.read(buf20,20); - data._coef_ground_range_3 = atof(buf20); + is.read(buf20,20); + data._coef_ground_range_3 = atof(buf20); - is.read(buf20,20); - data._coef_ground_range_4 = atof(buf20); + is.read(buf20,20); + data._coef_ground_range_4 = atof(buf20); - is.read(buf20,20); - data._coef_ant_elev_1 = atof(buf20); + is.read(buf20,20); + data._coef_ant_elev_1 = atof(buf20); - is.read(buf20,20); - data._coef_ant_elev_2 = atof(buf20); + is.read(buf20,20); + data._coef_ant_elev_2 = atof(buf20); - is.read(buf20,20); - data._coef_ant_elev_3 = atof(buf20); + is.read(buf20,20); + data._coef_ant_elev_3 = atof(buf20); - is.read(buf20,20); - data._coef_ant_elev_4 = atof(buf20); + is.read(buf20,20); + data._coef_ant_elev_4 = atof(buf20); - is.read(buf20,20); - data._coef_ant_elev_5 = atof(buf20); + is.read(buf20,20); + data._coef_ant_elev_5 = atof(buf20); - is.read(buf16,16); - data._range_time_origin_ant = atof(buf16); + is.read(buf16,16); + data._range_time_origin_ant = atof(buf16); - char buf10238[10238]; - is.read(buf10238,10238); - return is; + char buf10238[10238]; + is.read(buf10238,10238); + return is; } ErsSarFacilityData::ErsSarFacilityData(const ErsSarFacilityData& rhs): - ErsSarRecord(rhs), - _last_release_qc_date(rhs._last_release_qc_date), - _last_release_cal_date(rhs._last_release_cal_date), - _qa_summary_flag(rhs._qa_summary_flag), - _prf_code_change_flag(rhs._prf_code_change_flag), - _sampling_win_change_flag(rhs._sampling_win_change_flag), - _cal_gain_change_flag(rhs._cal_gain_change_flag), - _quirp_qu_flag(rhs._quirp_qu_flag), - _inp_data_stat_flag(rhs._inp_data_stat_flag), - _dopp_cent_conf_meas_flag(rhs._dopp_cent_conf_meas_flag), - _dopp_cent_val_flag(rhs._dopp_cent_val_flag), - _dopp_ambig_conf_meas_flag(rhs._dopp_ambig_conf_meas_flag), - _outp_data_mean_flag(rhs._outp_data_mean_flag), - _OGOB_flag(rhs._OGOB_flag), - _PRF_changes(rhs._PRF_changes), - _sampling_win_changes(rhs._sampling_win_changes), - _cal_gain_changes(rhs._cal_gain_changes), - _missing_lines(rhs._missing_lines), - _rec_gain_changes(rhs._rec_gain_changes), - _pulse_width_of_ACF_3db(rhs._pulse_width_of_ACF_3db), - _first_side_lobe_lev_of_ACF(rhs._first_side_lobe_lev_of_ACF), - _ISLR_of_ACF(rhs._ISLR_of_ACF), - _dopp_cent_conf_meas(rhs._dopp_cent_conf_meas), - _dopp_ambig_conf_meas(rhs._dopp_ambig_conf_meas), - _inp_data_I_mean(rhs._inp_data_I_mean), - _inp_data_Q_mean(rhs._inp_data_Q_mean), - _inp_data_I_stddev(rhs._inp_data_I_stddev), - _inp_data_Q_stddev(rhs._inp_data_Q_stddev), - _cal_sys_gain(rhs._cal_sys_gain), - _first_rec_gain_read(rhs._first_rec_gain_read), - _dopp_ambig_num(rhs._dopp_ambig_num), - _I_channel_bias_correction(rhs._I_channel_bias_correction), - _Q_channel_bias_correction(rhs._Q_channel_bias_correction), - _I_channel_gain_correction(rhs._I_channel_gain_correction), - _Q_channel_gain_correction(rhs._Q_channel_gain_correction), - _Q_channel_I_Q_correction(rhs._Q_channel_I_Q_correction), - _noise_power(rhs._noise_power), - _int_cal_utc(rhs._int_cal_utc), - _num_valid_cal_pulses(rhs._num_valid_cal_pulses), - _num_valid_noise_pulses(rhs._num_valid_noise_pulses), - _num_valid_replicas(rhs._num_valid_replicas), - _first_replica_sample(rhs._first_replica_sample), - _mean_cal_pulse_power(rhs._mean_cal_pulse_power), - _mean_noise_power(rhs._mean_noise_power), - _range_comp_norm_fact(rhs._range_comp_norm_fact), - _replica_power(rhs._replica_power), - _first_range_pixel_mid_az_inc(rhs._first_range_pixel_mid_az_inc), - _center_range_pix_mid_az_inc(rhs._center_range_pix_mid_az_inc), - _last_range_pix_mid_az_inc(rhs._last_range_pix_mid_az_inc), - _norm_ref_range_ro(rhs._norm_ref_range_ro), - _antenna_elev_flag(rhs._antenna_elev_flag), - _abs_cal_const_K(rhs._abs_cal_const_K), - _upp_bound_K(rhs._upp_bound_K), - _low_bound_K(rhs._low_bound_K), - _proc_noise_scale_fact(rhs._proc_noise_scale_fact), - _K_gen_date(rhs._K_gen_date), - _K_vers_num(rhs._K_vers_num), - _num_duplic_input_lines(rhs._num_duplic_input_lines), - _estim_bit_error_rate(rhs._estim_bit_error_rate), - _out_image_mean(rhs._out_image_mean), - _out_image_std_dev(rhs._out_image_std_dev), - _out_image_max_value(rhs._out_image_max_value), - _time_raw_data_first_input(rhs._time_raw_data_first_input), - _time_asc_node_state_vectors(rhs._time_asc_node_state_vectors), - _asc_node_pos_X_comp(rhs._asc_node_pos_X_comp), - _asc_node_pos_Y_comp(rhs._asc_node_pos_Y_comp), - _asc_node_pos_Z_comp(rhs._asc_node_pos_Z_comp), - _asc_node_vel_X_comp(rhs._asc_node_vel_X_comp), - _asc_node_vel_Y_comp(rhs._asc_node_vel_Y_comp), - _asc_node_vel_Z_comp(rhs._asc_node_vel_Z_comp), - _out_pixel_bit_length(rhs._out_pixel_bit_length), - _proc_gain_param_1(rhs._proc_gain_param_1), - _proc_gain_param_2(rhs._proc_gain_param_2), - _proc_gain_param_3(rhs._proc_gain_param_3), - _peak_loc_cross_correl_fun(rhs._peak_loc_cross_correl_fun), - _3_dB_width_CCF(rhs._3_dB_width_CCF), - _first_side_lobe_level(rhs._first_side_lobe_level), - _ISLR_CCF_between_last(rhs._ISLR_CCF_between_last), - _peak_loc_CCF_betw_last(rhs._peak_loc_CCF_betw_last), - _Roll_Tilt_Mode_flag(rhs._Roll_Tilt_Mode_flag), - _raw_data_correction_flag(rhs._raw_data_correction_flag), - _look_detecion_flag(rhs._look_detecion_flag), - _doppler_ambiguity_estimat_flag(rhs._doppler_ambiguity_estimat_flag), - _azimuth_baseband_convers_flag(rhs._azimuth_baseband_convers_flag), - _samples_per_line_used(rhs._samples_per_line_used), - _range_lines_skip_factor(rhs._range_lines_skip_factor), - _time_of_inp_state_vectors(rhs._time_of_inp_state_vectors), - _inp_state_vect_pos_X_comp(rhs._inp_state_vect_pos_X_comp), - _inp_state_vect_pos_Y_comp(rhs._inp_state_vect_pos_Y_comp), - _inp_state_vect_pos_Z_comp(rhs._inp_state_vect_pos_Z_comp), - _inp_state_vect_vel_Vx_comp(rhs._inp_state_vect_vel_Vx_comp), - _inp_state_vect_vel_Vy_comp(rhs._inp_state_vect_vel_Vy_comp), - _inp_state_vect_vel_Vz_comp(rhs._inp_state_vect_vel_Vz_comp), - _inp_state_vector_type_flag(rhs._inp_state_vector_type_flag), - _win_coeff_for_range_match(rhs._win_coeff_for_range_match), - _win_coeff_for_azi_match(rhs._win_coeff_for_azi_match), - _update_period_range_match(rhs._update_period_range_match), - _look_scalar_gain_1(rhs._look_scalar_gain_1), - _look_scalar_gain_2(rhs._look_scalar_gain_2), - _look_scalar_gain_3(rhs._look_scalar_gain_3), - _look_scalar_gain_4(rhs._look_scalar_gain_4), - _look_scalar_gain_5(rhs._look_scalar_gain_5), - _look_scalar_gain_6(rhs._look_scalar_gain_6), - _look_scalar_gain_7(rhs._look_scalar_gain_7), - _look_scalar_gain_8(rhs._look_scalar_gain_8), - _samp_window_start_time_bias(rhs._samp_window_start_time_bias), - _doppler_centroid_cubic_coeff(rhs._doppler_centroid_cubic_coeff), - _PRF_code_first_range_line(rhs._PRF_code_first_range_line), - _PRF_code_last_range_line(rhs._PRF_code_last_range_line), - _samp_win_start_first(rhs._samp_win_start_first), - _samp_win_start_last(rhs._samp_win_start_last), - _cal_syst_gain_last_proc(rhs._cal_syst_gain_last_proc), - _receiver_gain_last_proc(rhs._receiver_gain_last_proc), - _first_processed_range_sample(rhs._first_processed_range_sample), - _azimuth_FFT_IFFT_ratio(rhs._azimuth_FFT_IFFT_ratio), - _num_azimuth_blocks_proc(rhs._num_azimuth_blocks_proc), - _num_input_raw_data_lines(rhs._num_input_raw_data_lines), - _initial_doppler_ambiguity_num(rhs._initial_doppler_ambiguity_num), - _thresh_no_1_flag(rhs._thresh_no_1_flag), - _thresh_no_2_flag(rhs._thresh_no_2_flag), - _thresh_no_3_flag(rhs._thresh_no_3_flag), - _thresh_no_4_flag(rhs._thresh_no_4_flag), - _thresh_no_5_flag(rhs._thresh_no_5_flag), - _thresh_no_6_flag(rhs._thresh_no_6_flag), - _thresh_no_7_flag(rhs._thresh_no_7_flag), - _thresh_no_8_flag(rhs._thresh_no_8_flag), - _thresh_no_9_flag(rhs._thresh_no_9_flag), - _thresh_no_10_flag(rhs._thresh_no_10_flag), - _thresh_no_11_flag(rhs._thresh_no_11_flag), - _sat_binary_time_of_first(rhs._sat_binary_time_of_first), - _num_valid_pixels_per_range(rhs._num_valid_pixels_per_range), - _num_range_samp_discarded(rhs._num_range_samp_discarded), - _I_gain_imb_lower_bound(rhs._I_gain_imb_lower_bound), - _I_gain_imb_upper_bound(rhs._I_gain_imb_upper_bound), - _I_Q_quad_depar_lower_bound(rhs._I_Q_quad_depar_lower_bound), - _I_Q_quad_depar_upper_bound(rhs._I_Q_quad_depar_upper_bound), - _3_dB_look_bandwidth(rhs._3_dB_look_bandwidth), - _3_dB_look_proc_dopp_bandw(rhs._3_dB_look_proc_dopp_bandw), - _range_spread_loss_comp_flag(rhs._range_spread_loss_comp_flag), - _datation_flag(rhs._datation_flag), - _max_error_range_line_timing(rhs._max_error_range_line_timing), - _form_num_range_line_used(rhs._form_num_range_line_used), - _autom_look_scal_gain_flag(rhs._autom_look_scal_gain_flag), - _max_value_look_scalar_gain(rhs._max_value_look_scalar_gain), - _replica_norm_method_flag(rhs._replica_norm_method_flag), - _coef_ground_range_1(rhs._coef_ground_range_1), - _coef_ground_range_2(rhs._coef_ground_range_2), - _coef_ground_range_3(rhs._coef_ground_range_3), - _coef_ground_range_4(rhs._coef_ground_range_4), - _coef_ant_elev_1(rhs._coef_ant_elev_1), - _coef_ant_elev_2(rhs._coef_ant_elev_2), - _coef_ant_elev_3(rhs._coef_ant_elev_3), - _coef_ant_elev_4(rhs._coef_ant_elev_4), - _coef_ant_elev_5(rhs._coef_ant_elev_5), - _range_time_origin_ant(rhs._range_time_origin_ant) + ErsSarRecord(rhs), + _last_release_qc_date(rhs._last_release_qc_date), + _last_release_cal_date(rhs._last_release_cal_date), + _qa_summary_flag(rhs._qa_summary_flag), + _prf_code_change_flag(rhs._prf_code_change_flag), + _sampling_win_change_flag(rhs._sampling_win_change_flag), + _cal_gain_change_flag(rhs._cal_gain_change_flag), + _quirp_qu_flag(rhs._quirp_qu_flag), + _inp_data_stat_flag(rhs._inp_data_stat_flag), + _dopp_cent_conf_meas_flag(rhs._dopp_cent_conf_meas_flag), + _dopp_cent_val_flag(rhs._dopp_cent_val_flag), + _dopp_ambig_conf_meas_flag(rhs._dopp_ambig_conf_meas_flag), + _outp_data_mean_flag(rhs._outp_data_mean_flag), + _OGOB_flag(rhs._OGOB_flag), + _PRF_changes(rhs._PRF_changes), + _sampling_win_changes(rhs._sampling_win_changes), + _cal_gain_changes(rhs._cal_gain_changes), + _missing_lines(rhs._missing_lines), + _rec_gain_changes(rhs._rec_gain_changes), + _pulse_width_of_ACF_3db(rhs._pulse_width_of_ACF_3db), + _first_side_lobe_lev_of_ACF(rhs._first_side_lobe_lev_of_ACF), + _ISLR_of_ACF(rhs._ISLR_of_ACF), + _dopp_cent_conf_meas(rhs._dopp_cent_conf_meas), + _dopp_ambig_conf_meas(rhs._dopp_ambig_conf_meas), + _inp_data_I_mean(rhs._inp_data_I_mean), + _inp_data_Q_mean(rhs._inp_data_Q_mean), + _inp_data_I_stddev(rhs._inp_data_I_stddev), + _inp_data_Q_stddev(rhs._inp_data_Q_stddev), + _cal_sys_gain(rhs._cal_sys_gain), + _first_rec_gain_read(rhs._first_rec_gain_read), + _dopp_ambig_num(rhs._dopp_ambig_num), + _I_channel_bias_correction(rhs._I_channel_bias_correction), + _Q_channel_bias_correction(rhs._Q_channel_bias_correction), + _I_channel_gain_correction(rhs._I_channel_gain_correction), + _Q_channel_gain_correction(rhs._Q_channel_gain_correction), + _Q_channel_I_Q_correction(rhs._Q_channel_I_Q_correction), + _noise_power(rhs._noise_power), + _int_cal_utc(rhs._int_cal_utc), + _num_valid_cal_pulses(rhs._num_valid_cal_pulses), + _num_valid_noise_pulses(rhs._num_valid_noise_pulses), + _num_valid_replicas(rhs._num_valid_replicas), + _first_replica_sample(rhs._first_replica_sample), + _mean_cal_pulse_power(rhs._mean_cal_pulse_power), + _mean_noise_power(rhs._mean_noise_power), + _range_comp_norm_fact(rhs._range_comp_norm_fact), + _replica_power(rhs._replica_power), + _first_range_pixel_mid_az_inc(rhs._first_range_pixel_mid_az_inc), + _center_range_pix_mid_az_inc(rhs._center_range_pix_mid_az_inc), + _last_range_pix_mid_az_inc(rhs._last_range_pix_mid_az_inc), + _norm_ref_range_ro(rhs._norm_ref_range_ro), + _antenna_elev_flag(rhs._antenna_elev_flag), + _abs_cal_const_K(rhs._abs_cal_const_K), + _upp_bound_K(rhs._upp_bound_K), + _low_bound_K(rhs._low_bound_K), + _proc_noise_scale_fact(rhs._proc_noise_scale_fact), + _K_gen_date(rhs._K_gen_date), + _K_vers_num(rhs._K_vers_num), + _num_duplic_input_lines(rhs._num_duplic_input_lines), + _estim_bit_error_rate(rhs._estim_bit_error_rate), + _out_image_mean(rhs._out_image_mean), + _out_image_std_dev(rhs._out_image_std_dev), + _out_image_max_value(rhs._out_image_max_value), + _time_raw_data_first_input(rhs._time_raw_data_first_input), + _time_asc_node_state_vectors(rhs._time_asc_node_state_vectors), + _asc_node_pos_X_comp(rhs._asc_node_pos_X_comp), + _asc_node_pos_Y_comp(rhs._asc_node_pos_Y_comp), + _asc_node_pos_Z_comp(rhs._asc_node_pos_Z_comp), + _asc_node_vel_X_comp(rhs._asc_node_vel_X_comp), + _asc_node_vel_Y_comp(rhs._asc_node_vel_Y_comp), + _asc_node_vel_Z_comp(rhs._asc_node_vel_Z_comp), + _out_pixel_bit_length(rhs._out_pixel_bit_length), + _proc_gain_param_1(rhs._proc_gain_param_1), + _proc_gain_param_2(rhs._proc_gain_param_2), + _proc_gain_param_3(rhs._proc_gain_param_3), + _peak_loc_cross_correl_fun(rhs._peak_loc_cross_correl_fun), + _3_dB_width_CCF(rhs._3_dB_width_CCF), + _first_side_lobe_level(rhs._first_side_lobe_level), + _ISLR_CCF_between_last(rhs._ISLR_CCF_between_last), + _peak_loc_CCF_betw_last(rhs._peak_loc_CCF_betw_last), + _Roll_Tilt_Mode_flag(rhs._Roll_Tilt_Mode_flag), + _raw_data_correction_flag(rhs._raw_data_correction_flag), + _look_detecion_flag(rhs._look_detecion_flag), + _doppler_ambiguity_estimat_flag(rhs._doppler_ambiguity_estimat_flag), + _azimuth_baseband_convers_flag(rhs._azimuth_baseband_convers_flag), + _samples_per_line_used(rhs._samples_per_line_used), + _range_lines_skip_factor(rhs._range_lines_skip_factor), + _time_of_inp_state_vectors(rhs._time_of_inp_state_vectors), + _inp_state_vect_pos_X_comp(rhs._inp_state_vect_pos_X_comp), + _inp_state_vect_pos_Y_comp(rhs._inp_state_vect_pos_Y_comp), + _inp_state_vect_pos_Z_comp(rhs._inp_state_vect_pos_Z_comp), + _inp_state_vect_vel_Vx_comp(rhs._inp_state_vect_vel_Vx_comp), + _inp_state_vect_vel_Vy_comp(rhs._inp_state_vect_vel_Vy_comp), + _inp_state_vect_vel_Vz_comp(rhs._inp_state_vect_vel_Vz_comp), + _inp_state_vector_type_flag(rhs._inp_state_vector_type_flag), + _win_coeff_for_range_match(rhs._win_coeff_for_range_match), + _win_coeff_for_azi_match(rhs._win_coeff_for_azi_match), + _update_period_range_match(rhs._update_period_range_match), + _look_scalar_gain_1(rhs._look_scalar_gain_1), + _look_scalar_gain_2(rhs._look_scalar_gain_2), + _look_scalar_gain_3(rhs._look_scalar_gain_3), + _look_scalar_gain_4(rhs._look_scalar_gain_4), + _look_scalar_gain_5(rhs._look_scalar_gain_5), + _look_scalar_gain_6(rhs._look_scalar_gain_6), + _look_scalar_gain_7(rhs._look_scalar_gain_7), + _look_scalar_gain_8(rhs._look_scalar_gain_8), + _samp_window_start_time_bias(rhs._samp_window_start_time_bias), + _doppler_centroid_cubic_coeff(rhs._doppler_centroid_cubic_coeff), + _PRF_code_first_range_line(rhs._PRF_code_first_range_line), + _PRF_code_last_range_line(rhs._PRF_code_last_range_line), + _samp_win_start_first(rhs._samp_win_start_first), + _samp_win_start_last(rhs._samp_win_start_last), + _cal_syst_gain_last_proc(rhs._cal_syst_gain_last_proc), + _receiver_gain_last_proc(rhs._receiver_gain_last_proc), + _first_processed_range_sample(rhs._first_processed_range_sample), + _azimuth_FFT_IFFT_ratio(rhs._azimuth_FFT_IFFT_ratio), + _num_azimuth_blocks_proc(rhs._num_azimuth_blocks_proc), + _num_input_raw_data_lines(rhs._num_input_raw_data_lines), + _initial_doppler_ambiguity_num(rhs._initial_doppler_ambiguity_num), + _thresh_no_1_flag(rhs._thresh_no_1_flag), + _thresh_no_2_flag(rhs._thresh_no_2_flag), + _thresh_no_3_flag(rhs._thresh_no_3_flag), + _thresh_no_4_flag(rhs._thresh_no_4_flag), + _thresh_no_5_flag(rhs._thresh_no_5_flag), + _thresh_no_6_flag(rhs._thresh_no_6_flag), + _thresh_no_7_flag(rhs._thresh_no_7_flag), + _thresh_no_8_flag(rhs._thresh_no_8_flag), + _thresh_no_9_flag(rhs._thresh_no_9_flag), + _thresh_no_10_flag(rhs._thresh_no_10_flag), + _thresh_no_11_flag(rhs._thresh_no_11_flag), + _sat_binary_time_of_first(rhs._sat_binary_time_of_first), + _num_valid_pixels_per_range(rhs._num_valid_pixels_per_range), + _num_range_samp_discarded(rhs._num_range_samp_discarded), + _I_gain_imb_lower_bound(rhs._I_gain_imb_lower_bound), + _I_gain_imb_upper_bound(rhs._I_gain_imb_upper_bound), + _I_Q_quad_depar_lower_bound(rhs._I_Q_quad_depar_lower_bound), + _I_Q_quad_depar_upper_bound(rhs._I_Q_quad_depar_upper_bound), + _3_dB_look_bandwidth(rhs._3_dB_look_bandwidth), + _3_dB_look_proc_dopp_bandw(rhs._3_dB_look_proc_dopp_bandw), + _range_spread_loss_comp_flag(rhs._range_spread_loss_comp_flag), + _datation_flag(rhs._datation_flag), + _max_error_range_line_timing(rhs._max_error_range_line_timing), + _form_num_range_line_used(rhs._form_num_range_line_used), + _autom_look_scal_gain_flag(rhs._autom_look_scal_gain_flag), + _max_value_look_scalar_gain(rhs._max_value_look_scalar_gain), + _replica_norm_method_flag(rhs._replica_norm_method_flag), + _coef_ground_range_1(rhs._coef_ground_range_1), + _coef_ground_range_2(rhs._coef_ground_range_2), + _coef_ground_range_3(rhs._coef_ground_range_3), + _coef_ground_range_4(rhs._coef_ground_range_4), + _coef_ant_elev_1(rhs._coef_ant_elev_1), + _coef_ant_elev_2(rhs._coef_ant_elev_2), + _coef_ant_elev_3(rhs._coef_ant_elev_3), + _coef_ant_elev_4(rhs._coef_ant_elev_4), + _coef_ant_elev_5(rhs._coef_ant_elev_5), + _range_time_origin_ant(rhs._range_time_origin_ant) {} ErsSarFacilityData& ErsSarFacilityData::operator=(const ErsSarFacilityData& rhs) { - _last_release_qc_date = rhs._last_release_qc_date; - _last_release_cal_date = rhs._last_release_cal_date; - _qa_summary_flag = rhs._qa_summary_flag; - _prf_code_change_flag = rhs._prf_code_change_flag; - _sampling_win_change_flag = rhs._sampling_win_change_flag; - _cal_gain_change_flag = rhs._cal_gain_change_flag; - _quirp_qu_flag = rhs._quirp_qu_flag; - _inp_data_stat_flag = rhs._inp_data_stat_flag; - _dopp_cent_conf_meas_flag = rhs._dopp_cent_conf_meas_flag; - _dopp_cent_val_flag = rhs._dopp_cent_val_flag; - _dopp_ambig_conf_meas_flag = rhs._dopp_ambig_conf_meas_flag; - _outp_data_mean_flag = rhs._outp_data_mean_flag; - _OGOB_flag = rhs._OGOB_flag; - _PRF_changes = rhs._PRF_changes; - _sampling_win_changes = rhs._sampling_win_changes; - _cal_gain_changes = rhs._cal_gain_changes; - _missing_lines = rhs._missing_lines; - _rec_gain_changes = rhs._rec_gain_changes; - _pulse_width_of_ACF_3db = rhs._pulse_width_of_ACF_3db; - _first_side_lobe_lev_of_ACF = rhs._first_side_lobe_lev_of_ACF; - _ISLR_of_ACF = rhs._ISLR_of_ACF; - _dopp_cent_conf_meas = rhs._dopp_cent_conf_meas; - _dopp_ambig_conf_meas = rhs._dopp_ambig_conf_meas; - _inp_data_I_mean = rhs._inp_data_I_mean; - _inp_data_Q_mean = rhs._inp_data_Q_mean; - _inp_data_I_stddev = rhs._inp_data_I_stddev; - _inp_data_Q_stddev = rhs._inp_data_Q_stddev; - _cal_sys_gain = rhs._cal_sys_gain; - _first_rec_gain_read = rhs._first_rec_gain_read; - _dopp_ambig_num = rhs._dopp_ambig_num; - _I_channel_bias_correction = rhs._I_channel_bias_correction; - _Q_channel_bias_correction = rhs._Q_channel_bias_correction; - _I_channel_gain_correction = rhs._I_channel_gain_correction; - _Q_channel_gain_correction = rhs._Q_channel_gain_correction; - _Q_channel_I_Q_correction = rhs._Q_channel_I_Q_correction; - _noise_power = rhs._noise_power; - _int_cal_utc = rhs._int_cal_utc; - _num_valid_cal_pulses = rhs._num_valid_cal_pulses; - _num_valid_noise_pulses = rhs._num_valid_noise_pulses; - _num_valid_replicas = rhs._num_valid_replicas; - _first_replica_sample = rhs._first_replica_sample; - _mean_cal_pulse_power = rhs._mean_cal_pulse_power; - _mean_noise_power = rhs._mean_noise_power; - _range_comp_norm_fact = rhs._range_comp_norm_fact; - _replica_power = rhs._replica_power; - _first_range_pixel_mid_az_inc = rhs._first_range_pixel_mid_az_inc; - _center_range_pix_mid_az_inc = rhs._center_range_pix_mid_az_inc; - _last_range_pix_mid_az_inc = rhs._last_range_pix_mid_az_inc; - _norm_ref_range_ro = rhs._norm_ref_range_ro; - _antenna_elev_flag = rhs._antenna_elev_flag; - _abs_cal_const_K = rhs._abs_cal_const_K; - _upp_bound_K = rhs._upp_bound_K; - _low_bound_K = rhs._low_bound_K; - _proc_noise_scale_fact = rhs._proc_noise_scale_fact; - _K_gen_date = rhs._K_gen_date; - _K_vers_num = rhs._K_vers_num; - _num_duplic_input_lines = rhs._num_duplic_input_lines; - _estim_bit_error_rate = rhs._estim_bit_error_rate; - _out_image_mean = rhs._out_image_mean; - _out_image_std_dev = rhs._out_image_std_dev; - _out_image_max_value = rhs._out_image_max_value; - _time_raw_data_first_input = rhs._time_raw_data_first_input; - _time_asc_node_state_vectors = rhs._time_asc_node_state_vectors; - _asc_node_pos_X_comp = rhs._asc_node_pos_X_comp; - _asc_node_pos_Y_comp = rhs._asc_node_pos_Y_comp; - _asc_node_pos_Z_comp = rhs._asc_node_pos_Z_comp; - _asc_node_vel_X_comp = rhs._asc_node_vel_X_comp; - _asc_node_vel_Y_comp = rhs._asc_node_vel_Y_comp; - _asc_node_vel_Z_comp = rhs._asc_node_vel_Z_comp; - _out_pixel_bit_length = rhs._out_pixel_bit_length; - _proc_gain_param_1 = rhs._proc_gain_param_1; - _proc_gain_param_2 = rhs._proc_gain_param_2; - _proc_gain_param_3 = rhs._proc_gain_param_3; - _peak_loc_cross_correl_fun = rhs._peak_loc_cross_correl_fun; - _3_dB_width_CCF = rhs._3_dB_width_CCF; - _first_side_lobe_level = rhs._first_side_lobe_level; - _ISLR_CCF_between_last = rhs._ISLR_CCF_between_last; - _peak_loc_CCF_betw_last = rhs._peak_loc_CCF_betw_last; - _Roll_Tilt_Mode_flag = rhs._Roll_Tilt_Mode_flag; - _raw_data_correction_flag = rhs._raw_data_correction_flag; - _look_detecion_flag = rhs._look_detecion_flag; - _doppler_ambiguity_estimat_flag = rhs._doppler_ambiguity_estimat_flag; - _azimuth_baseband_convers_flag = rhs._azimuth_baseband_convers_flag; - _samples_per_line_used = rhs._samples_per_line_used; - _range_lines_skip_factor = rhs._range_lines_skip_factor; - _time_of_inp_state_vectors = rhs._time_of_inp_state_vectors; - _inp_state_vect_pos_X_comp = rhs._inp_state_vect_pos_X_comp; - _inp_state_vect_pos_Y_comp = rhs._inp_state_vect_pos_Y_comp; - _inp_state_vect_pos_Z_comp = rhs._inp_state_vect_pos_Z_comp; - _inp_state_vect_vel_Vx_comp = rhs._inp_state_vect_vel_Vx_comp; - _inp_state_vect_vel_Vy_comp = rhs._inp_state_vect_vel_Vy_comp; - _inp_state_vect_vel_Vz_comp = rhs._inp_state_vect_vel_Vz_comp; - _inp_state_vector_type_flag = rhs._inp_state_vector_type_flag; - _win_coeff_for_range_match = rhs._win_coeff_for_range_match; - _win_coeff_for_azi_match = rhs._win_coeff_for_azi_match; - _update_period_range_match = rhs._update_period_range_match; - _look_scalar_gain_1 = rhs._look_scalar_gain_1; - _look_scalar_gain_2 = rhs._look_scalar_gain_2; - _look_scalar_gain_3 = rhs._look_scalar_gain_3; - _look_scalar_gain_4 = rhs._look_scalar_gain_4; - _look_scalar_gain_5 = rhs._look_scalar_gain_5; - _look_scalar_gain_6 = rhs._look_scalar_gain_6; - _look_scalar_gain_7 = rhs._look_scalar_gain_7; - _look_scalar_gain_8 = rhs._look_scalar_gain_8; - _samp_window_start_time_bias = rhs._samp_window_start_time_bias; - _doppler_centroid_cubic_coeff = rhs._doppler_centroid_cubic_coeff; - _PRF_code_first_range_line = rhs._PRF_code_first_range_line; - _PRF_code_last_range_line = rhs._PRF_code_last_range_line; - _samp_win_start_first = rhs._samp_win_start_first; - _samp_win_start_last = rhs._samp_win_start_last; - _cal_syst_gain_last_proc = rhs._cal_syst_gain_last_proc; - _receiver_gain_last_proc = rhs._receiver_gain_last_proc; - _first_processed_range_sample = rhs._first_processed_range_sample; - _azimuth_FFT_IFFT_ratio = rhs._azimuth_FFT_IFFT_ratio; - _num_azimuth_blocks_proc = rhs._num_azimuth_blocks_proc; - _num_input_raw_data_lines = rhs._num_input_raw_data_lines; - _initial_doppler_ambiguity_num = rhs._initial_doppler_ambiguity_num; - _thresh_no_1_flag = rhs._thresh_no_1_flag; - _thresh_no_2_flag = rhs._thresh_no_2_flag; - _thresh_no_3_flag = rhs._thresh_no_3_flag; - _thresh_no_4_flag = rhs._thresh_no_4_flag; - _thresh_no_5_flag = rhs._thresh_no_5_flag; - _thresh_no_6_flag = rhs._thresh_no_6_flag; - _thresh_no_7_flag = rhs._thresh_no_7_flag; - _thresh_no_8_flag = rhs._thresh_no_8_flag; - _thresh_no_9_flag = rhs._thresh_no_9_flag; - _thresh_no_10_flag = rhs._thresh_no_10_flag; - _thresh_no_11_flag = rhs._thresh_no_11_flag; - _sat_binary_time_of_first = rhs._sat_binary_time_of_first; - _num_valid_pixels_per_range = rhs._num_valid_pixels_per_range; - _num_range_samp_discarded = rhs._num_range_samp_discarded; - _I_gain_imb_lower_bound = rhs._I_gain_imb_lower_bound; - _I_gain_imb_upper_bound = rhs._I_gain_imb_upper_bound; - _I_Q_quad_depar_lower_bound = rhs._I_Q_quad_depar_lower_bound; - _I_Q_quad_depar_upper_bound = rhs._I_Q_quad_depar_upper_bound; - _3_dB_look_bandwidth = rhs._3_dB_look_bandwidth; - _3_dB_look_proc_dopp_bandw = rhs._3_dB_look_proc_dopp_bandw; - _range_spread_loss_comp_flag = rhs._range_spread_loss_comp_flag; - _datation_flag = rhs._datation_flag; - _max_error_range_line_timing = rhs._max_error_range_line_timing; - _form_num_range_line_used = rhs._form_num_range_line_used; - _autom_look_scal_gain_flag = rhs._autom_look_scal_gain_flag; - _max_value_look_scalar_gain = rhs._max_value_look_scalar_gain; - _replica_norm_method_flag = rhs._replica_norm_method_flag; - _coef_ground_range_1 = rhs._coef_ground_range_1; - _coef_ground_range_2 = rhs._coef_ground_range_2; - _coef_ground_range_3 = rhs._coef_ground_range_3; - _coef_ground_range_4 = rhs._coef_ground_range_4; - _coef_ant_elev_1 = rhs._coef_ant_elev_1; - _coef_ant_elev_2 = rhs._coef_ant_elev_2; - _coef_ant_elev_3 = rhs._coef_ant_elev_3; - _coef_ant_elev_4 = rhs._coef_ant_elev_4; - _coef_ant_elev_5 = rhs._coef_ant_elev_5; - _range_time_origin_ant = rhs._range_time_origin_ant; - - return *this; + _last_release_qc_date = rhs._last_release_qc_date; + _last_release_cal_date = rhs._last_release_cal_date; + _qa_summary_flag = rhs._qa_summary_flag; + _prf_code_change_flag = rhs._prf_code_change_flag; + _sampling_win_change_flag = rhs._sampling_win_change_flag; + _cal_gain_change_flag = rhs._cal_gain_change_flag; + _quirp_qu_flag = rhs._quirp_qu_flag; + _inp_data_stat_flag = rhs._inp_data_stat_flag; + _dopp_cent_conf_meas_flag = rhs._dopp_cent_conf_meas_flag; + _dopp_cent_val_flag = rhs._dopp_cent_val_flag; + _dopp_ambig_conf_meas_flag = rhs._dopp_ambig_conf_meas_flag; + _outp_data_mean_flag = rhs._outp_data_mean_flag; + _OGOB_flag = rhs._OGOB_flag; + _PRF_changes = rhs._PRF_changes; + _sampling_win_changes = rhs._sampling_win_changes; + _cal_gain_changes = rhs._cal_gain_changes; + _missing_lines = rhs._missing_lines; + _rec_gain_changes = rhs._rec_gain_changes; + _pulse_width_of_ACF_3db = rhs._pulse_width_of_ACF_3db; + _first_side_lobe_lev_of_ACF = rhs._first_side_lobe_lev_of_ACF; + _ISLR_of_ACF = rhs._ISLR_of_ACF; + _dopp_cent_conf_meas = rhs._dopp_cent_conf_meas; + _dopp_ambig_conf_meas = rhs._dopp_ambig_conf_meas; + _inp_data_I_mean = rhs._inp_data_I_mean; + _inp_data_Q_mean = rhs._inp_data_Q_mean; + _inp_data_I_stddev = rhs._inp_data_I_stddev; + _inp_data_Q_stddev = rhs._inp_data_Q_stddev; + _cal_sys_gain = rhs._cal_sys_gain; + _first_rec_gain_read = rhs._first_rec_gain_read; + _dopp_ambig_num = rhs._dopp_ambig_num; + _I_channel_bias_correction = rhs._I_channel_bias_correction; + _Q_channel_bias_correction = rhs._Q_channel_bias_correction; + _I_channel_gain_correction = rhs._I_channel_gain_correction; + _Q_channel_gain_correction = rhs._Q_channel_gain_correction; + _Q_channel_I_Q_correction = rhs._Q_channel_I_Q_correction; + _noise_power = rhs._noise_power; + _int_cal_utc = rhs._int_cal_utc; + _num_valid_cal_pulses = rhs._num_valid_cal_pulses; + _num_valid_noise_pulses = rhs._num_valid_noise_pulses; + _num_valid_replicas = rhs._num_valid_replicas; + _first_replica_sample = rhs._first_replica_sample; + _mean_cal_pulse_power = rhs._mean_cal_pulse_power; + _mean_noise_power = rhs._mean_noise_power; + _range_comp_norm_fact = rhs._range_comp_norm_fact; + _replica_power = rhs._replica_power; + _first_range_pixel_mid_az_inc = rhs._first_range_pixel_mid_az_inc; + _center_range_pix_mid_az_inc = rhs._center_range_pix_mid_az_inc; + _last_range_pix_mid_az_inc = rhs._last_range_pix_mid_az_inc; + _norm_ref_range_ro = rhs._norm_ref_range_ro; + _antenna_elev_flag = rhs._antenna_elev_flag; + _abs_cal_const_K = rhs._abs_cal_const_K; + _upp_bound_K = rhs._upp_bound_K; + _low_bound_K = rhs._low_bound_K; + _proc_noise_scale_fact = rhs._proc_noise_scale_fact; + _K_gen_date = rhs._K_gen_date; + _K_vers_num = rhs._K_vers_num; + _num_duplic_input_lines = rhs._num_duplic_input_lines; + _estim_bit_error_rate = rhs._estim_bit_error_rate; + _out_image_mean = rhs._out_image_mean; + _out_image_std_dev = rhs._out_image_std_dev; + _out_image_max_value = rhs._out_image_max_value; + _time_raw_data_first_input = rhs._time_raw_data_first_input; + _time_asc_node_state_vectors = rhs._time_asc_node_state_vectors; + _asc_node_pos_X_comp = rhs._asc_node_pos_X_comp; + _asc_node_pos_Y_comp = rhs._asc_node_pos_Y_comp; + _asc_node_pos_Z_comp = rhs._asc_node_pos_Z_comp; + _asc_node_vel_X_comp = rhs._asc_node_vel_X_comp; + _asc_node_vel_Y_comp = rhs._asc_node_vel_Y_comp; + _asc_node_vel_Z_comp = rhs._asc_node_vel_Z_comp; + _out_pixel_bit_length = rhs._out_pixel_bit_length; + _proc_gain_param_1 = rhs._proc_gain_param_1; + _proc_gain_param_2 = rhs._proc_gain_param_2; + _proc_gain_param_3 = rhs._proc_gain_param_3; + _peak_loc_cross_correl_fun = rhs._peak_loc_cross_correl_fun; + _3_dB_width_CCF = rhs._3_dB_width_CCF; + _first_side_lobe_level = rhs._first_side_lobe_level; + _ISLR_CCF_between_last = rhs._ISLR_CCF_between_last; + _peak_loc_CCF_betw_last = rhs._peak_loc_CCF_betw_last; + _Roll_Tilt_Mode_flag = rhs._Roll_Tilt_Mode_flag; + _raw_data_correction_flag = rhs._raw_data_correction_flag; + _look_detecion_flag = rhs._look_detecion_flag; + _doppler_ambiguity_estimat_flag = rhs._doppler_ambiguity_estimat_flag; + _azimuth_baseband_convers_flag = rhs._azimuth_baseband_convers_flag; + _samples_per_line_used = rhs._samples_per_line_used; + _range_lines_skip_factor = rhs._range_lines_skip_factor; + _time_of_inp_state_vectors = rhs._time_of_inp_state_vectors; + _inp_state_vect_pos_X_comp = rhs._inp_state_vect_pos_X_comp; + _inp_state_vect_pos_Y_comp = rhs._inp_state_vect_pos_Y_comp; + _inp_state_vect_pos_Z_comp = rhs._inp_state_vect_pos_Z_comp; + _inp_state_vect_vel_Vx_comp = rhs._inp_state_vect_vel_Vx_comp; + _inp_state_vect_vel_Vy_comp = rhs._inp_state_vect_vel_Vy_comp; + _inp_state_vect_vel_Vz_comp = rhs._inp_state_vect_vel_Vz_comp; + _inp_state_vector_type_flag = rhs._inp_state_vector_type_flag; + _win_coeff_for_range_match = rhs._win_coeff_for_range_match; + _win_coeff_for_azi_match = rhs._win_coeff_for_azi_match; + _update_period_range_match = rhs._update_period_range_match; + _look_scalar_gain_1 = rhs._look_scalar_gain_1; + _look_scalar_gain_2 = rhs._look_scalar_gain_2; + _look_scalar_gain_3 = rhs._look_scalar_gain_3; + _look_scalar_gain_4 = rhs._look_scalar_gain_4; + _look_scalar_gain_5 = rhs._look_scalar_gain_5; + _look_scalar_gain_6 = rhs._look_scalar_gain_6; + _look_scalar_gain_7 = rhs._look_scalar_gain_7; + _look_scalar_gain_8 = rhs._look_scalar_gain_8; + _samp_window_start_time_bias = rhs._samp_window_start_time_bias; + _doppler_centroid_cubic_coeff = rhs._doppler_centroid_cubic_coeff; + _PRF_code_first_range_line = rhs._PRF_code_first_range_line; + _PRF_code_last_range_line = rhs._PRF_code_last_range_line; + _samp_win_start_first = rhs._samp_win_start_first; + _samp_win_start_last = rhs._samp_win_start_last; + _cal_syst_gain_last_proc = rhs._cal_syst_gain_last_proc; + _receiver_gain_last_proc = rhs._receiver_gain_last_proc; + _first_processed_range_sample = rhs._first_processed_range_sample; + _azimuth_FFT_IFFT_ratio = rhs._azimuth_FFT_IFFT_ratio; + _num_azimuth_blocks_proc = rhs._num_azimuth_blocks_proc; + _num_input_raw_data_lines = rhs._num_input_raw_data_lines; + _initial_doppler_ambiguity_num = rhs._initial_doppler_ambiguity_num; + _thresh_no_1_flag = rhs._thresh_no_1_flag; + _thresh_no_2_flag = rhs._thresh_no_2_flag; + _thresh_no_3_flag = rhs._thresh_no_3_flag; + _thresh_no_4_flag = rhs._thresh_no_4_flag; + _thresh_no_5_flag = rhs._thresh_no_5_flag; + _thresh_no_6_flag = rhs._thresh_no_6_flag; + _thresh_no_7_flag = rhs._thresh_no_7_flag; + _thresh_no_8_flag = rhs._thresh_no_8_flag; + _thresh_no_9_flag = rhs._thresh_no_9_flag; + _thresh_no_10_flag = rhs._thresh_no_10_flag; + _thresh_no_11_flag = rhs._thresh_no_11_flag; + _sat_binary_time_of_first = rhs._sat_binary_time_of_first; + _num_valid_pixels_per_range = rhs._num_valid_pixels_per_range; + _num_range_samp_discarded = rhs._num_range_samp_discarded; + _I_gain_imb_lower_bound = rhs._I_gain_imb_lower_bound; + _I_gain_imb_upper_bound = rhs._I_gain_imb_upper_bound; + _I_Q_quad_depar_lower_bound = rhs._I_Q_quad_depar_lower_bound; + _I_Q_quad_depar_upper_bound = rhs._I_Q_quad_depar_upper_bound; + _3_dB_look_bandwidth = rhs._3_dB_look_bandwidth; + _3_dB_look_proc_dopp_bandw = rhs._3_dB_look_proc_dopp_bandw; + _range_spread_loss_comp_flag = rhs._range_spread_loss_comp_flag; + _datation_flag = rhs._datation_flag; + _max_error_range_line_timing = rhs._max_error_range_line_timing; + _form_num_range_line_used = rhs._form_num_range_line_used; + _autom_look_scal_gain_flag = rhs._autom_look_scal_gain_flag; + _max_value_look_scalar_gain = rhs._max_value_look_scalar_gain; + _replica_norm_method_flag = rhs._replica_norm_method_flag; + _coef_ground_range_1 = rhs._coef_ground_range_1; + _coef_ground_range_2 = rhs._coef_ground_range_2; + _coef_ground_range_3 = rhs._coef_ground_range_3; + _coef_ground_range_4 = rhs._coef_ground_range_4; + _coef_ant_elev_1 = rhs._coef_ant_elev_1; + _coef_ant_elev_2 = rhs._coef_ant_elev_2; + _coef_ant_elev_3 = rhs._coef_ant_elev_3; + _coef_ant_elev_4 = rhs._coef_ant_elev_4; + _coef_ant_elev_5 = rhs._coef_ant_elev_5; + _range_time_origin_ant = rhs._range_time_origin_ant; + + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.h index 493cd3a265a333fec52a27e7fd27bb60f7675cb5..c37a4f3511e9c6cb127b7b388adb04dadbf04404 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFacilityData.h @@ -28,1778 +28,1778 @@ namespace ossimplugins class ErsSarFacilityData : public ErsSarRecord { public: - /** - * @brief Constructor - */ - ErsSarFacilityData(); + /** + * @brief Constructor + */ + ErsSarFacilityData(); - /** - * @brief Destructor - */ - ~ErsSarFacilityData(); + /** + * @brief Destructor + */ + ~ErsSarFacilityData(); - /** - * @brief This function write the ErsSarFacilityData in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarFacilityData& data); + /** + * @brief This function write the ErsSarFacilityData in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarFacilityData& data); - /** - * @brief This function read a ErsSarFacilityData from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarFacilityData& data); + /** + * @brief This function read a ErsSarFacilityData from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarFacilityData& data); - /** - * @brief Copy constructor - */ - ErsSarFacilityData(const ErsSarFacilityData& rhs); + /** + * @brief Copy constructor + */ + ErsSarFacilityData(const ErsSarFacilityData& rhs); - /** - * @brief Copy operator - */ - ErsSarFacilityData& operator=(const ErsSarFacilityData& rhs); + /** + * @brief Copy operator + */ + ErsSarFacilityData& operator=(const ErsSarFacilityData& rhs); - /** - * @brief This function is able to create a new instance of the class - */ - ErsSarRecord* Instanciate() - { - return new ErsSarFacilityData(); - }; + /** + * @brief This function is able to create a new instance of the class + */ + ErsSarRecord* Instanciate() + { + return new ErsSarFacilityData(); + }; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - ErsSarRecord* Clone() - { - return new ErsSarFacilityData(*this); - }; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + ErsSarRecord* Clone() + { + return new ErsSarFacilityData(*this); + }; - /** - * @brief Read the class data from a stream - */ - void Read(std::istream& is) - { - is>>*this; - }; + /** + * @brief Read the class data from a stream + */ + void Read(std::istream& is) + { + is>>*this; + }; - /** - * @brief Write the class to a stream - */ - void Write(std::ostream& os) - { - os<<*this; - }; + /** + * @brief Write the class to a stream + */ + void Write(std::ostream& os) + { + os<<*this; + }; - /** - * @brief name_of_facil_rec - */ - std::string get_name_of_facil_rec() - { - return _name_of_facil_rec; - }; + /** + * @brief name_of_facil_rec + */ + std::string get_name_of_facil_rec() + { + return _name_of_facil_rec; + }; - /** - * @brief last_release_qc_date - */ - std::string get_last_release_qc_date() - { - return _last_release_qc_date; - }; - /** - * @brief last_release_cal_date - */ - std::string get_last_release_cal_date() - { - return _last_release_cal_date; - }; - /** - * @brief qa_summary_flag - */ - int get_qa_summary_flag() - { - return _qa_summary_flag; - }; - /** - * @brief prf_code_change_flag - */ - int get_prf_code_change_flag() - { - return _prf_code_change_flag; - }; - /** - * @brief sampling_win_change_flag - */ - int get_sampling_win_change_flag() - { - return _sampling_win_change_flag; - }; - /** - * @brief cal_gain_change_flag - */ - int get_cal_gain_change_flag() - { - return _cal_gain_change_flag; - }; - /** - * @brief quirp_qu_flag - */ - int get_quirp_qu_flag() - { - return _quirp_qu_flag; - }; - /** - * @brief inp_data_stat_flag - */ - int get_inp_data_stat_flag() - { - return _inp_data_stat_flag; - }; - /** - * @brief dopp_cent_conf_meas_flag - */ - int get_dopp_cent_conf_meas_flag() - { - return _dopp_cent_conf_meas_flag; - }; - /** - * @brief dopp_cent_val_flag - */ - int get_dopp_cent_val_flag() - { - return _dopp_cent_val_flag; - }; - /** - * @brief dopp_ambig_conf_meas_flag - */ - int get_dopp_ambig_conf_meas_flag() - { - return _dopp_ambig_conf_meas_flag; - }; - /** - * @brief outp_data_mean_flag - */ - int get_outp_data_mean_flag() - { - return _outp_data_mean_flag; - }; - /** - * @brief OGOB_flag - */ - int get_OGOB_flag() - { - return _OGOB_flag; - }; - /** - * @brief PRF_changes - */ - int get_PRF_changes() - { - return _PRF_changes; - }; - /** - * @brief sampling_win_changes - */ - int get_sampling_win_changes() - { - return _sampling_win_changes; - }; - /** - * @brief cal_gain_changes - */ - int get_cal_gain_changes() - { - return _cal_gain_changes; - }; - /** - * @brief missing_lines - */ - int get_missing_lines() - { - return _missing_lines; - }; - /** - * @brief rec_gain_changes - */ - int get_rec_gain_changes() - { - return _rec_gain_changes; - }; - /** - * @brief pulse_width_of_ACF_3db - */ - double get_pulse_width_of_ACF_3db() - { - return _pulse_width_of_ACF_3db; - }; - /** - * @brief first_side_lobe_lev_of_ACF - */ - double get_first_side_lobe_lev_of_ACF() - { - return _first_side_lobe_lev_of_ACF; - }; - /** - * @brief ISLR_of_ACF - */ - double get_ISLR_of_ACF() - { - return _ISLR_of_ACF; - }; - /** - * @brief dopp_cent_conf_meas - */ - double get_dopp_cent_conf_meas() - { - return _dopp_cent_conf_meas; - }; - /** - * @brief dopp_ambig_conf_meas - */ - double get_dopp_ambig_conf_meas() - { - return _dopp_ambig_conf_meas; - }; - /** - * @brief inp_data_I_mean - */ - double get_inp_data_I_mean() - { - return _inp_data_I_mean; - }; - /** - * @brief inp_data_Q_mean - */ - double get_inp_data_Q_mean() - { - return _inp_data_Q_mean; - }; - /** - * @brief inp_data_I_stddev - */ - double get_inp_data_I_stddev() - { - return _inp_data_I_stddev; - }; - /** - * @brief inp_data_Q_stddev - */ - double get_inp_data_Q_stddev() - { - return _inp_data_Q_stddev; - }; - /** - * @brief cal_sys_gain - */ - double get_cal_sys_gain() - { - return _cal_sys_gain; - }; - /** - * @brief first_rec_gain_read - */ - double get_first_rec_gain_read() - { - return _first_rec_gain_read; - }; - /** - * @brief dopp_ambig_num - */ - double get_dopp_ambig_num() - { - return _dopp_ambig_num; - }; - /** - * @brief I_channel_bias_correction - */ - double get_I_channel_bias_correction() - { - return _I_channel_bias_correction; - }; - /** - * @brief Q_channel_bias_correction - */ - double get_Q_channel_bias_correction() - { - return _Q_channel_bias_correction; - }; - /** - * @brief I_channel_gain_correction - */ - double get_I_channel_gain_correction() - { - return _I_channel_gain_correction; - }; - /** - * @brief Q_channel_gain_correction - */ - double get_Q_channel_gain_correction() - { - return _Q_channel_gain_correction; - }; - /** - * @brief Q_channel_I_Q_correction - */ - double get_Q_channel_I_Q_correction() - { - return _Q_channel_I_Q_correction; - }; - /** - * @brief noise_power - */ - double get_noise_power() - { - return _noise_power; - }; - /** - * @brief int_cal_utc - */ - int get_int_cal_utc() - { - return _int_cal_utc; - }; - /** - * @brief num_valid_cal_pulses - */ - int get_num_valid_cal_pulses() - { - return _num_valid_cal_pulses; - }; - /** - * @brief num_valid_noise_pulses - */ - int get_num_valid_noise_pulses() - { - return _num_valid_noise_pulses; - }; - /** - * @brief num_valid_replicas - */ - int get_num_valid_replicas() - { - return _num_valid_replicas; - }; - /** - * @brief first_replica_sample - */ - double get_first_replica_sample() - { - return _first_replica_sample; - }; - /** - * @brief mean_cal_pulse_power - */ - double get_mean_cal_pulse_power() - { - return _mean_cal_pulse_power; - }; - /** - * @brief mean_noise_power - */ - double get_mean_noise_power() - { - return _mean_noise_power; - }; - /** - * @brief range_comp_norm_fact - */ - double get_range_comp_norm_fact() - { - return _range_comp_norm_fact; - }; - /** - * @brief replica_power - */ - double get_replica_power() - { - return _replica_power; - }; - /** - * @brief first_range_pixel_mid_az_inc - */ - double get_first_range_pixel_mid_az_inc() - { - return _first_range_pixel_mid_az_inc; - }; - /** - * @brief center_range_pix_mid_az_inc - */ - double get_center_range_pix_mid_az_inc() - { - return _center_range_pix_mid_az_inc; - }; - /** - * @brief last_range_pix_mid_az_inc - */ - double get_last_range_pix_mid_az_inc() - { - return _last_range_pix_mid_az_inc; - }; - /** - * @brief norm_ref_range_ro - */ - double get_norm_ref_range_ro() - { - return _norm_ref_range_ro; - }; - /** - * @brief antenna_elev_flag - */ - int get_antenna_elev_flag() - { - return _antenna_elev_flag; - }; - /** - * @brief abs_cal_const_K - */ - double get_abs_cal_const_K() - { - return _abs_cal_const_K; - }; - /** - * @brief upp_bound_K - */ - double get_upp_bound_K() - { - return _upp_bound_K; - }; - /** - * @brief low_bound_K - */ - double get_low_bound_K() - { - return _low_bound_K; - }; - /** - * @brief proc_noise_scale_fact - */ - double get_proc_noise_scale_fact() - { - return _proc_noise_scale_fact; - }; - /** - * @brief K_gen_date - */ - std::string get_K_gen_date() - { - return _K_gen_date; - }; - /** - * @brief K_vers_num - */ - std::string get_K_vers_num() - { - return _K_vers_num; - }; - /** - * @brief num_duplic_input_lines - */ - int get_num_duplic_input_lines() - { - return _num_duplic_input_lines; - }; - /** - * @brief estim_bit_error_rate - */ - double get_estim_bit_error_rate() - { - return _estim_bit_error_rate; - }; - /** - * @brief out_image_mean - */ - double get_out_image_mean() - { - return _out_image_mean; - }; - /** - * @brief out_image_std_dev - */ - double get_out_image_std_dev() - { - return _out_image_std_dev; - }; - /** - * @brief out_image_max_value - */ - double get_out_image_max_value() - { - return _out_image_max_value; - }; - /** - * @brief time_raw_data_first_input - */ - std::string get_time_raw_data_first_input() - { - return _time_raw_data_first_input; - }; - /** - * @brief time_asc_node_state_vectors - */ - std::string get_time_asc_node_state_vectors() - { - return _time_asc_node_state_vectors; - }; - /** - * @brief asc_node_pos_X_comp - */ - std::string get_asc_node_pos_X_comp() - { - return _asc_node_pos_X_comp; - }; - /** - * @brief asc_node_pos_Y_comp - */ - std::string get_asc_node_pos_Y_comp() - { - return _asc_node_pos_Y_comp; - }; - /** - * @brief asc_node_pos_Z_comp - */ - std::string get_asc_node_pos_Z_comp() - { - return _asc_node_pos_Z_comp; - }; - /** - * @brief asc_node_vel_X_comp - */ - std::string get_asc_node_vel_X_comp() - { - return _asc_node_vel_X_comp; - }; - /** - * @brief asc_node_vel_Y_comp - */ - std::string get_asc_node_vel_Y_comp() - { - return _asc_node_vel_Y_comp; - }; - /** - * @brief asc_node_vel_Z_comp - */ - std::string get_asc_node_vel_Z_comp() - { - return _asc_node_vel_Z_comp; - }; - /** - * @brief out_pixel_bit_length - */ - int get_out_pixel_bit_length() - { - return _out_pixel_bit_length; - }; - /** - * @brief proc_gain_param_1 - */ - double get_proc_gain_param_1() - { - return _proc_gain_param_1; - }; - /** - * @brief proc_gain_param_2 - */ - double get_proc_gain_param_2() - { - return _proc_gain_param_2; - }; - /** - * @brief proc_gain_param_3 - */ - double get_proc_gain_param_3() - { - return _proc_gain_param_3; - }; - /** - * @brief peak_loc_cross_correl_fun - */ - int get_peak_loc_cross_correl_fun() - { - return _peak_loc_cross_correl_fun; - }; - /** - * @brief 3_dB_width_CCF - */ - double get_3_dB_width_CCF() - { - return _3_dB_width_CCF; - }; - /** - * @brief first_side_lobe_level - */ - double get_first_side_lobe_level() - { - return _first_side_lobe_level; - }; - /** - * @brief ISLR_CCF_between_last - */ - double get_ISLR_CCF_between_last() - { - return _ISLR_CCF_between_last; - }; - /** - * @brief peak_loc_CCF_betw_last - */ - int get_peak_loc_CCF_betw_last() - { - return _peak_loc_CCF_betw_last; - }; - /** - * @brief Roll_Tilt_Mode_flag - */ - int get_Roll_Tilt_Mode_flag() - { - return _Roll_Tilt_Mode_flag; - }; - /** - * @brief raw_data_correction_flag - */ - int get_raw_data_correction_flag() - { - return _raw_data_correction_flag; - }; - /** - * @brief look_detecion_flag - */ - int get_look_detecion_flag() - { - return _look_detecion_flag; - }; - /** - * @brief doppler_ambiguity_estimat_flag - */ - int get_doppler_ambiguity_estimat_flag() - { - return _doppler_ambiguity_estimat_flag; - }; - /** - * @brief azimuth_baseband_convers_flag - */ - int get_azimuth_baseband_convers_flag() - { - return _azimuth_baseband_convers_flag; - }; - /** - * @brief samples_per_line_used - */ - int get_samples_per_line_used() - { - return _samples_per_line_used; - }; - /** - * @brief range_lines_skip_factor - */ - int get_range_lines_skip_factor() - { - return _range_lines_skip_factor; - }; - /** - * @brief time_of_inp_state_vectors - */ - std::string get_time_of_inp_state_vectors() - { - return _time_of_inp_state_vectors; - }; - /** - * @brief inp_state_vect_pos_X_comp - */ - std::string get_inp_state_vect_pos_X_comp() - { - return _inp_state_vect_pos_X_comp; - }; - /** - * @brief inp_state_vect_pos_Y_comp - */ - std::string get_inp_state_vect_pos_Y_comp() - { - return _inp_state_vect_pos_Y_comp; - }; - /** - * @brief inp_state_vect_pos_Z_comp - */ - std::string get_inp_state_vect_pos_Z_comp() - { - return _inp_state_vect_pos_Z_comp; - }; - /** - * @brief inp_state_vect_vel_Vx_comp - */ - std::string get_inp_state_vect_vel_Vx_comp() - { - return _inp_state_vect_vel_Vx_comp; - }; - /** - * @brief inp_state_vect_vel_Vy_comp - */ - std::string get_inp_state_vect_vel_Vy_comp() - { - return _inp_state_vect_vel_Vy_comp; - }; - /** - * @brief inp_state_vect_vel_Vz_comp - */ - std::string get_inp_state_vect_vel_Vz_comp() - { - return _inp_state_vect_vel_Vz_comp; - }; - /** - * @brief inp_state_vector_type_flag - */ - int get_inp_state_vector_type_flag() - { - return _inp_state_vector_type_flag; - }; - /** - * @brief win_coeff_for_range_match - */ - double get_win_coeff_for_range_match() - { - return _win_coeff_for_range_match; - }; - /** - * @brief win_coeff_for_azi_match - */ - double get_win_coeff_for_azi_match() - { - return _win_coeff_for_azi_match; - }; - /** - * @brief update_period_range_match - */ - int get_update_period_range_match() - { - return _update_period_range_match; - }; - /** - * @brief look_scalar_gain_1 - */ - double get_look_scalar_gain_1() - { - return _look_scalar_gain_1; - }; - /** - * @brief look_scalar_gain_2 - */ - double get_look_scalar_gain_2() - { - return _look_scalar_gain_2; - }; - /** - * @brief look_scalar_gain_3 - */ - double get_look_scalar_gain_3() - { - return _look_scalar_gain_3; - }; - /** - * @brief look_scalar_gain_4 - */ - double get_look_scalar_gain_4() - { - return _look_scalar_gain_4; - }; - /** - * @brief look_scalar_gain_5 - */ - double get_look_scalar_gain_5() - { - return _look_scalar_gain_5; - }; - /** - * @brief look_scalar_gain_6 - */ - double get_look_scalar_gain_6() - { - return _look_scalar_gain_6; - }; - /** - * @brief look_scalar_gain_7 - */ - double get_look_scalar_gain_7() - { - return _look_scalar_gain_7; - }; - /** - * @brief look_scalar_gain_8 - */ - double get_look_scalar_gain_8() - { - return _look_scalar_gain_8; - }; - /** - * @brief samp_window_start_time_bias - */ - int get_samp_window_start_time_bias() - { - return _samp_window_start_time_bias; - }; - /** - * @brief doppler_centroid_cubic_coeff - */ - double get_doppler_centroid_cubic_coeff() - { - return _doppler_centroid_cubic_coeff; - }; - /** - * @brief PRF_code_first_range_line - */ - int get_PRF_code_first_range_line() - { - return _PRF_code_first_range_line; - }; - /** - * @brief PRF_code_last_range_line - */ - int get_PRF_code_last_range_line() - { - return _PRF_code_last_range_line; - }; - /** - * @brief samp_win_start_first - */ - int get_samp_win_start_first() - { - return _samp_win_start_first; - }; - /** - * @brief samp_win_start_last - */ - int get_samp_win_start_last() - { - return _samp_win_start_last; - }; - /** - * @brief cal_syst_gain_last_proc - */ - int get_cal_syst_gain_last_proc() - { - return _cal_syst_gain_last_proc; - }; - /** - * @brief receiver_gain_last_proc - */ - int get_receiver_gain_last_proc() - { - return _receiver_gain_last_proc; - }; - /** - * @brief first_processed_range_sample - */ - int get_first_processed_range_sample() - { - return _first_processed_range_sample; - }; - /** - * @brief azimuth_FFT_IFFT_ratio - */ - int get_azimuth_FFT_IFFT_ratio() - { - return _azimuth_FFT_IFFT_ratio; - }; - /** - * @brief num_azimuth_blocks_proc - */ - int get_num_azimuth_blocks_proc() - { - return _num_azimuth_blocks_proc; - }; - /** - * @brief num_input_raw_data_lines - */ - int get_num_input_raw_data_lines() - { - return _num_input_raw_data_lines; - }; - /** - * @brief initial_doppler_ambiguity_num - */ - int get_initial_doppler_ambiguity_num() - { - return _initial_doppler_ambiguity_num; - }; - /** - * @brief thresh_no_1_flag - */ - double get_thresh_no_1_flag() - { - return _thresh_no_1_flag; - }; - /** - * @brief thresh_no_2_flag - */ - double get_thresh_no_2_flag() - { - return _thresh_no_2_flag; - }; - /** - * @brief thresh_no_3_flag - */ - double get_thresh_no_3_flag() - { - return _thresh_no_3_flag; - }; - /** - * @brief thresh_no_4_flag - */ - double get_thresh_no_4_flag() - { - return _thresh_no_4_flag; - }; - /** - * @brief thresh_no_5_flag - */ - double get_thresh_no_5_flag() - { - return _thresh_no_5_flag; - }; - /** - * @brief thresh_no_6_flag - */ - double get_thresh_no_6_flag() - { - return _thresh_no_6_flag; - }; - /** - * @brief thresh_no_7_flag - */ - double get_thresh_no_7_flag() - { - return _thresh_no_7_flag; - }; - /** - * @brief thresh_no_8_flag - */ - double get_thresh_no_8_flag() - { - return _thresh_no_8_flag; - }; - /** - * @brief thresh_no_9_flag - */ - double get_thresh_no_9_flag() - { - return _thresh_no_9_flag; - }; - /** - * @brief thresh_no_10_flag - */ - double get_thresh_no_10_flag() - { - return _thresh_no_10_flag; - }; - /** - * @brief thresh_no_11_flag - */ - double get_thresh_no_11_flag() - { - return _thresh_no_11_flag; - }; - /** - * @brief sat_binary_time_of_first - */ - int get_sat_binary_time_of_first() - { - return _sat_binary_time_of_first; - }; - /** - * @brief num_valid_pixels_per_range - */ - int get_num_valid_pixels_per_range() - { - return _num_valid_pixels_per_range; - }; - /** - * @brief num_range_samp_discarded - */ - int get_num_range_samp_discarded() - { - return _num_range_samp_discarded; - }; - /** - * @brief I_gain_imb_lower_bound - */ - double get_I_gain_imb_lower_bound() - { - return _I_gain_imb_lower_bound; - }; - /** - * @brief I_gain_imb_upper_bound - */ - double get_I_gain_imb_upper_bound() - { - return _I_gain_imb_upper_bound; - }; - /** - * @brief I_Q_quad_depar_lower_bound - */ - double get_I_Q_quad_depar_lower_bound() - { - return _I_Q_quad_depar_lower_bound; - }; - /** - * @brief I_Q_quad_depar_upper_bound - */ - double get_I_Q_quad_depar_upper_bound() - { - return _I_Q_quad_depar_upper_bound; - }; - /** - * @brief 3_dB_look_bandwidth - */ - double get_3_dB_look_bandwidth() - { - return _3_dB_look_bandwidth; - }; - /** - * @brief 3_dB_look_proc_dopp_bandw - */ - double get_3_dB_look_proc_dopp_bandw() - { - return _3_dB_look_proc_dopp_bandw; - }; - /** - * @brief range_spread_loss_comp_flag - */ - int get_range_spread_loss_comp_flag() - { - return _range_spread_loss_comp_flag; - }; - /** - * @brief datation_flag - */ - bool get_datation_flag() - { - return _datation_flag; - }; - /** - * @brief max_error_range_line_timing - */ - int get_max_error_range_line_timing() - { - return _max_error_range_line_timing; - }; - /** - * @brief form_num_range_line_used - */ - int get_form_num_range_line_used() - { - return _form_num_range_line_used; - }; - /** - * @brief autom_look_scal_gain_flag - */ - bool get_autom_look_scal_gain_flag() - { - return _autom_look_scal_gain_flag; - }; - /** - * @brief max_value_look_scalar_gain - */ - int get_max_value_look_scalar_gain() - { - return _max_value_look_scalar_gain; - }; - /** - * @brief replica_norm_method_flag - */ - int get_replica_norm_method_flag() - { - return _replica_norm_method_flag; - }; - /** - * @brief coef_ground_range_1 - */ - double get_coef_ground_range_1() - { - return _coef_ground_range_1; - }; - /** - * @brief coef_ground_range_2 - */ - double get_coef_ground_range_2() - { - return _coef_ground_range_2; - }; - /** - * @brief coef_ground_range_3 - */ - double get_coef_ground_range_3() - { - return _coef_ground_range_3; - }; - /** - * @brief coef_ground_range_4 - */ - double get_coef_ground_range_4() - { - return _coef_ground_range_4; - }; - /** - * @brief coef_ant_elev_1 - */ - double get_coef_ant_elev_1() - { - return _coef_ant_elev_1; - }; - /** - * @brief coef_ant_elev_2 - */ - double get_coef_ant_elev_2() - { - return _coef_ant_elev_2; - }; - /** - * @brief coef_ant_elev_3 - */ - double get_coef_ant_elev_3() - { - return _coef_ant_elev_3; - }; - /** - * @brief coef_ant_elev_4 - */ - double get_coef_ant_elev_4() - { - return _coef_ant_elev_4; - }; - /** - * @brief coef_ant_elev_5 - */ - double get_coef_ant_elev_5() - { - return _coef_ant_elev_5; - }; - /** - * @brief range_time_origin_ant - */ - double get_range_time_origin_ant() - { - return _range_time_origin_ant; - }; + /** + * @brief last_release_qc_date + */ + std::string get_last_release_qc_date() + { + return _last_release_qc_date; + }; + /** + * @brief last_release_cal_date + */ + std::string get_last_release_cal_date() + { + return _last_release_cal_date; + }; + /** + * @brief qa_summary_flag + */ + int get_qa_summary_flag() + { + return _qa_summary_flag; + }; + /** + * @brief prf_code_change_flag + */ + int get_prf_code_change_flag() + { + return _prf_code_change_flag; + }; + /** + * @brief sampling_win_change_flag + */ + int get_sampling_win_change_flag() + { + return _sampling_win_change_flag; + }; + /** + * @brief cal_gain_change_flag + */ + int get_cal_gain_change_flag() + { + return _cal_gain_change_flag; + }; + /** + * @brief quirp_qu_flag + */ + int get_quirp_qu_flag() + { + return _quirp_qu_flag; + }; + /** + * @brief inp_data_stat_flag + */ + int get_inp_data_stat_flag() + { + return _inp_data_stat_flag; + }; + /** + * @brief dopp_cent_conf_meas_flag + */ + int get_dopp_cent_conf_meas_flag() + { + return _dopp_cent_conf_meas_flag; + }; + /** + * @brief dopp_cent_val_flag + */ + int get_dopp_cent_val_flag() + { + return _dopp_cent_val_flag; + }; + /** + * @brief dopp_ambig_conf_meas_flag + */ + int get_dopp_ambig_conf_meas_flag() + { + return _dopp_ambig_conf_meas_flag; + }; + /** + * @brief outp_data_mean_flag + */ + int get_outp_data_mean_flag() + { + return _outp_data_mean_flag; + }; + /** + * @brief OGOB_flag + */ + int get_OGOB_flag() + { + return _OGOB_flag; + }; + /** + * @brief PRF_changes + */ + int get_PRF_changes() + { + return _PRF_changes; + }; + /** + * @brief sampling_win_changes + */ + int get_sampling_win_changes() + { + return _sampling_win_changes; + }; + /** + * @brief cal_gain_changes + */ + int get_cal_gain_changes() + { + return _cal_gain_changes; + }; + /** + * @brief missing_lines + */ + int get_missing_lines() + { + return _missing_lines; + }; + /** + * @brief rec_gain_changes + */ + int get_rec_gain_changes() + { + return _rec_gain_changes; + }; + /** + * @brief pulse_width_of_ACF_3db + */ + double get_pulse_width_of_ACF_3db() + { + return _pulse_width_of_ACF_3db; + }; + /** + * @brief first_side_lobe_lev_of_ACF + */ + double get_first_side_lobe_lev_of_ACF() + { + return _first_side_lobe_lev_of_ACF; + }; + /** + * @brief ISLR_of_ACF + */ + double get_ISLR_of_ACF() + { + return _ISLR_of_ACF; + }; + /** + * @brief dopp_cent_conf_meas + */ + double get_dopp_cent_conf_meas() + { + return _dopp_cent_conf_meas; + }; + /** + * @brief dopp_ambig_conf_meas + */ + double get_dopp_ambig_conf_meas() + { + return _dopp_ambig_conf_meas; + }; + /** + * @brief inp_data_I_mean + */ + double get_inp_data_I_mean() + { + return _inp_data_I_mean; + }; + /** + * @brief inp_data_Q_mean + */ + double get_inp_data_Q_mean() + { + return _inp_data_Q_mean; + }; + /** + * @brief inp_data_I_stddev + */ + double get_inp_data_I_stddev() + { + return _inp_data_I_stddev; + }; + /** + * @brief inp_data_Q_stddev + */ + double get_inp_data_Q_stddev() + { + return _inp_data_Q_stddev; + }; + /** + * @brief cal_sys_gain + */ + double get_cal_sys_gain() + { + return _cal_sys_gain; + }; + /** + * @brief first_rec_gain_read + */ + double get_first_rec_gain_read() + { + return _first_rec_gain_read; + }; + /** + * @brief dopp_ambig_num + */ + double get_dopp_ambig_num() + { + return _dopp_ambig_num; + }; + /** + * @brief I_channel_bias_correction + */ + double get_I_channel_bias_correction() + { + return _I_channel_bias_correction; + }; + /** + * @brief Q_channel_bias_correction + */ + double get_Q_channel_bias_correction() + { + return _Q_channel_bias_correction; + }; + /** + * @brief I_channel_gain_correction + */ + double get_I_channel_gain_correction() + { + return _I_channel_gain_correction; + }; + /** + * @brief Q_channel_gain_correction + */ + double get_Q_channel_gain_correction() + { + return _Q_channel_gain_correction; + }; + /** + * @brief Q_channel_I_Q_correction + */ + double get_Q_channel_I_Q_correction() + { + return _Q_channel_I_Q_correction; + }; + /** + * @brief noise_power + */ + double get_noise_power() + { + return _noise_power; + }; + /** + * @brief int_cal_utc + */ + int get_int_cal_utc() + { + return _int_cal_utc; + }; + /** + * @brief num_valid_cal_pulses + */ + int get_num_valid_cal_pulses() + { + return _num_valid_cal_pulses; + }; + /** + * @brief num_valid_noise_pulses + */ + int get_num_valid_noise_pulses() + { + return _num_valid_noise_pulses; + }; + /** + * @brief num_valid_replicas + */ + int get_num_valid_replicas() + { + return _num_valid_replicas; + }; + /** + * @brief first_replica_sample + */ + double get_first_replica_sample() + { + return _first_replica_sample; + }; + /** + * @brief mean_cal_pulse_power + */ + double get_mean_cal_pulse_power() + { + return _mean_cal_pulse_power; + }; + /** + * @brief mean_noise_power + */ + double get_mean_noise_power() + { + return _mean_noise_power; + }; + /** + * @brief range_comp_norm_fact + */ + double get_range_comp_norm_fact() + { + return _range_comp_norm_fact; + }; + /** + * @brief replica_power + */ + double get_replica_power() + { + return _replica_power; + }; + /** + * @brief first_range_pixel_mid_az_inc + */ + double get_first_range_pixel_mid_az_inc() + { + return _first_range_pixel_mid_az_inc; + }; + /** + * @brief center_range_pix_mid_az_inc + */ + double get_center_range_pix_mid_az_inc() + { + return _center_range_pix_mid_az_inc; + }; + /** + * @brief last_range_pix_mid_az_inc + */ + double get_last_range_pix_mid_az_inc() + { + return _last_range_pix_mid_az_inc; + }; + /** + * @brief norm_ref_range_ro + */ + double get_norm_ref_range_ro() + { + return _norm_ref_range_ro; + }; + /** + * @brief antenna_elev_flag + */ + int get_antenna_elev_flag() + { + return _antenna_elev_flag; + }; + /** + * @brief abs_cal_const_K + */ + double get_abs_cal_const_K() + { + return _abs_cal_const_K; + }; + /** + * @brief upp_bound_K + */ + double get_upp_bound_K() + { + return _upp_bound_K; + }; + /** + * @brief low_bound_K + */ + double get_low_bound_K() + { + return _low_bound_K; + }; + /** + * @brief proc_noise_scale_fact + */ + double get_proc_noise_scale_fact() + { + return _proc_noise_scale_fact; + }; + /** + * @brief K_gen_date + */ + std::string get_K_gen_date() + { + return _K_gen_date; + }; + /** + * @brief K_vers_num + */ + std::string get_K_vers_num() + { + return _K_vers_num; + }; + /** + * @brief num_duplic_input_lines + */ + int get_num_duplic_input_lines() + { + return _num_duplic_input_lines; + }; + /** + * @brief estim_bit_error_rate + */ + double get_estim_bit_error_rate() + { + return _estim_bit_error_rate; + }; + /** + * @brief out_image_mean + */ + double get_out_image_mean() + { + return _out_image_mean; + }; + /** + * @brief out_image_std_dev + */ + double get_out_image_std_dev() + { + return _out_image_std_dev; + }; + /** + * @brief out_image_max_value + */ + double get_out_image_max_value() + { + return _out_image_max_value; + }; + /** + * @brief time_raw_data_first_input + */ + std::string get_time_raw_data_first_input() + { + return _time_raw_data_first_input; + }; + /** + * @brief time_asc_node_state_vectors + */ + std::string get_time_asc_node_state_vectors() + { + return _time_asc_node_state_vectors; + }; + /** + * @brief asc_node_pos_X_comp + */ + std::string get_asc_node_pos_X_comp() + { + return _asc_node_pos_X_comp; + }; + /** + * @brief asc_node_pos_Y_comp + */ + std::string get_asc_node_pos_Y_comp() + { + return _asc_node_pos_Y_comp; + }; + /** + * @brief asc_node_pos_Z_comp + */ + std::string get_asc_node_pos_Z_comp() + { + return _asc_node_pos_Z_comp; + }; + /** + * @brief asc_node_vel_X_comp + */ + std::string get_asc_node_vel_X_comp() + { + return _asc_node_vel_X_comp; + }; + /** + * @brief asc_node_vel_Y_comp + */ + std::string get_asc_node_vel_Y_comp() + { + return _asc_node_vel_Y_comp; + }; + /** + * @brief asc_node_vel_Z_comp + */ + std::string get_asc_node_vel_Z_comp() + { + return _asc_node_vel_Z_comp; + }; + /** + * @brief out_pixel_bit_length + */ + int get_out_pixel_bit_length() + { + return _out_pixel_bit_length; + }; + /** + * @brief proc_gain_param_1 + */ + double get_proc_gain_param_1() + { + return _proc_gain_param_1; + }; + /** + * @brief proc_gain_param_2 + */ + double get_proc_gain_param_2() + { + return _proc_gain_param_2; + }; + /** + * @brief proc_gain_param_3 + */ + double get_proc_gain_param_3() + { + return _proc_gain_param_3; + }; + /** + * @brief peak_loc_cross_correl_fun + */ + int get_peak_loc_cross_correl_fun() + { + return _peak_loc_cross_correl_fun; + }; + /** + * @brief 3_dB_width_CCF + */ + double get_3_dB_width_CCF() + { + return _3_dB_width_CCF; + }; + /** + * @brief first_side_lobe_level + */ + double get_first_side_lobe_level() + { + return _first_side_lobe_level; + }; + /** + * @brief ISLR_CCF_between_last + */ + double get_ISLR_CCF_between_last() + { + return _ISLR_CCF_between_last; + }; + /** + * @brief peak_loc_CCF_betw_last + */ + int get_peak_loc_CCF_betw_last() + { + return _peak_loc_CCF_betw_last; + }; + /** + * @brief Roll_Tilt_Mode_flag + */ + int get_Roll_Tilt_Mode_flag() + { + return _Roll_Tilt_Mode_flag; + }; + /** + * @brief raw_data_correction_flag + */ + int get_raw_data_correction_flag() + { + return _raw_data_correction_flag; + }; + /** + * @brief look_detecion_flag + */ + int get_look_detecion_flag() + { + return _look_detecion_flag; + }; + /** + * @brief doppler_ambiguity_estimat_flag + */ + int get_doppler_ambiguity_estimat_flag() + { + return _doppler_ambiguity_estimat_flag; + }; + /** + * @brief azimuth_baseband_convers_flag + */ + int get_azimuth_baseband_convers_flag() + { + return _azimuth_baseband_convers_flag; + }; + /** + * @brief samples_per_line_used + */ + int get_samples_per_line_used() + { + return _samples_per_line_used; + }; + /** + * @brief range_lines_skip_factor + */ + int get_range_lines_skip_factor() + { + return _range_lines_skip_factor; + }; + /** + * @brief time_of_inp_state_vectors + */ + std::string get_time_of_inp_state_vectors() + { + return _time_of_inp_state_vectors; + }; + /** + * @brief inp_state_vect_pos_X_comp + */ + std::string get_inp_state_vect_pos_X_comp() + { + return _inp_state_vect_pos_X_comp; + }; + /** + * @brief inp_state_vect_pos_Y_comp + */ + std::string get_inp_state_vect_pos_Y_comp() + { + return _inp_state_vect_pos_Y_comp; + }; + /** + * @brief inp_state_vect_pos_Z_comp + */ + std::string get_inp_state_vect_pos_Z_comp() + { + return _inp_state_vect_pos_Z_comp; + }; + /** + * @brief inp_state_vect_vel_Vx_comp + */ + std::string get_inp_state_vect_vel_Vx_comp() + { + return _inp_state_vect_vel_Vx_comp; + }; + /** + * @brief inp_state_vect_vel_Vy_comp + */ + std::string get_inp_state_vect_vel_Vy_comp() + { + return _inp_state_vect_vel_Vy_comp; + }; + /** + * @brief inp_state_vect_vel_Vz_comp + */ + std::string get_inp_state_vect_vel_Vz_comp() + { + return _inp_state_vect_vel_Vz_comp; + }; + /** + * @brief inp_state_vector_type_flag + */ + int get_inp_state_vector_type_flag() + { + return _inp_state_vector_type_flag; + }; + /** + * @brief win_coeff_for_range_match + */ + double get_win_coeff_for_range_match() + { + return _win_coeff_for_range_match; + }; + /** + * @brief win_coeff_for_azi_match + */ + double get_win_coeff_for_azi_match() + { + return _win_coeff_for_azi_match; + }; + /** + * @brief update_period_range_match + */ + int get_update_period_range_match() + { + return _update_period_range_match; + }; + /** + * @brief look_scalar_gain_1 + */ + double get_look_scalar_gain_1() + { + return _look_scalar_gain_1; + }; + /** + * @brief look_scalar_gain_2 + */ + double get_look_scalar_gain_2() + { + return _look_scalar_gain_2; + }; + /** + * @brief look_scalar_gain_3 + */ + double get_look_scalar_gain_3() + { + return _look_scalar_gain_3; + }; + /** + * @brief look_scalar_gain_4 + */ + double get_look_scalar_gain_4() + { + return _look_scalar_gain_4; + }; + /** + * @brief look_scalar_gain_5 + */ + double get_look_scalar_gain_5() + { + return _look_scalar_gain_5; + }; + /** + * @brief look_scalar_gain_6 + */ + double get_look_scalar_gain_6() + { + return _look_scalar_gain_6; + }; + /** + * @brief look_scalar_gain_7 + */ + double get_look_scalar_gain_7() + { + return _look_scalar_gain_7; + }; + /** + * @brief look_scalar_gain_8 + */ + double get_look_scalar_gain_8() + { + return _look_scalar_gain_8; + }; + /** + * @brief samp_window_start_time_bias + */ + int get_samp_window_start_time_bias() + { + return _samp_window_start_time_bias; + }; + /** + * @brief doppler_centroid_cubic_coeff + */ + double get_doppler_centroid_cubic_coeff() + { + return _doppler_centroid_cubic_coeff; + }; + /** + * @brief PRF_code_first_range_line + */ + int get_PRF_code_first_range_line() + { + return _PRF_code_first_range_line; + }; + /** + * @brief PRF_code_last_range_line + */ + int get_PRF_code_last_range_line() + { + return _PRF_code_last_range_line; + }; + /** + * @brief samp_win_start_first + */ + int get_samp_win_start_first() + { + return _samp_win_start_first; + }; + /** + * @brief samp_win_start_last + */ + int get_samp_win_start_last() + { + return _samp_win_start_last; + }; + /** + * @brief cal_syst_gain_last_proc + */ + int get_cal_syst_gain_last_proc() + { + return _cal_syst_gain_last_proc; + }; + /** + * @brief receiver_gain_last_proc + */ + int get_receiver_gain_last_proc() + { + return _receiver_gain_last_proc; + }; + /** + * @brief first_processed_range_sample + */ + int get_first_processed_range_sample() + { + return _first_processed_range_sample; + }; + /** + * @brief azimuth_FFT_IFFT_ratio + */ + int get_azimuth_FFT_IFFT_ratio() + { + return _azimuth_FFT_IFFT_ratio; + }; + /** + * @brief num_azimuth_blocks_proc + */ + int get_num_azimuth_blocks_proc() + { + return _num_azimuth_blocks_proc; + }; + /** + * @brief num_input_raw_data_lines + */ + int get_num_input_raw_data_lines() + { + return _num_input_raw_data_lines; + }; + /** + * @brief initial_doppler_ambiguity_num + */ + int get_initial_doppler_ambiguity_num() + { + return _initial_doppler_ambiguity_num; + }; + /** + * @brief thresh_no_1_flag + */ + double get_thresh_no_1_flag() + { + return _thresh_no_1_flag; + }; + /** + * @brief thresh_no_2_flag + */ + double get_thresh_no_2_flag() + { + return _thresh_no_2_flag; + }; + /** + * @brief thresh_no_3_flag + */ + double get_thresh_no_3_flag() + { + return _thresh_no_3_flag; + }; + /** + * @brief thresh_no_4_flag + */ + double get_thresh_no_4_flag() + { + return _thresh_no_4_flag; + }; + /** + * @brief thresh_no_5_flag + */ + double get_thresh_no_5_flag() + { + return _thresh_no_5_flag; + }; + /** + * @brief thresh_no_6_flag + */ + double get_thresh_no_6_flag() + { + return _thresh_no_6_flag; + }; + /** + * @brief thresh_no_7_flag + */ + double get_thresh_no_7_flag() + { + return _thresh_no_7_flag; + }; + /** + * @brief thresh_no_8_flag + */ + double get_thresh_no_8_flag() + { + return _thresh_no_8_flag; + }; + /** + * @brief thresh_no_9_flag + */ + double get_thresh_no_9_flag() + { + return _thresh_no_9_flag; + }; + /** + * @brief thresh_no_10_flag + */ + double get_thresh_no_10_flag() + { + return _thresh_no_10_flag; + }; + /** + * @brief thresh_no_11_flag + */ + double get_thresh_no_11_flag() + { + return _thresh_no_11_flag; + }; + /** + * @brief sat_binary_time_of_first + */ + int get_sat_binary_time_of_first() + { + return _sat_binary_time_of_first; + }; + /** + * @brief num_valid_pixels_per_range + */ + int get_num_valid_pixels_per_range() + { + return _num_valid_pixels_per_range; + }; + /** + * @brief num_range_samp_discarded + */ + int get_num_range_samp_discarded() + { + return _num_range_samp_discarded; + }; + /** + * @brief I_gain_imb_lower_bound + */ + double get_I_gain_imb_lower_bound() + { + return _I_gain_imb_lower_bound; + }; + /** + * @brief I_gain_imb_upper_bound + */ + double get_I_gain_imb_upper_bound() + { + return _I_gain_imb_upper_bound; + }; + /** + * @brief I_Q_quad_depar_lower_bound + */ + double get_I_Q_quad_depar_lower_bound() + { + return _I_Q_quad_depar_lower_bound; + }; + /** + * @brief I_Q_quad_depar_upper_bound + */ + double get_I_Q_quad_depar_upper_bound() + { + return _I_Q_quad_depar_upper_bound; + }; + /** + * @brief 3_dB_look_bandwidth + */ + double get_3_dB_look_bandwidth() + { + return _3_dB_look_bandwidth; + }; + /** + * @brief 3_dB_look_proc_dopp_bandw + */ + double get_3_dB_look_proc_dopp_bandw() + { + return _3_dB_look_proc_dopp_bandw; + }; + /** + * @brief range_spread_loss_comp_flag + */ + int get_range_spread_loss_comp_flag() + { + return _range_spread_loss_comp_flag; + }; + /** + * @brief datation_flag + */ + bool get_datation_flag() + { + return _datation_flag; + }; + /** + * @brief max_error_range_line_timing + */ + int get_max_error_range_line_timing() + { + return _max_error_range_line_timing; + }; + /** + * @brief form_num_range_line_used + */ + int get_form_num_range_line_used() + { + return _form_num_range_line_used; + }; + /** + * @brief autom_look_scal_gain_flag + */ + bool get_autom_look_scal_gain_flag() + { + return _autom_look_scal_gain_flag; + }; + /** + * @brief max_value_look_scalar_gain + */ + int get_max_value_look_scalar_gain() + { + return _max_value_look_scalar_gain; + }; + /** + * @brief replica_norm_method_flag + */ + int get_replica_norm_method_flag() + { + return _replica_norm_method_flag; + }; + /** + * @brief coef_ground_range_1 + */ + double get_coef_ground_range_1() + { + return _coef_ground_range_1; + }; + /** + * @brief coef_ground_range_2 + */ + double get_coef_ground_range_2() + { + return _coef_ground_range_2; + }; + /** + * @brief coef_ground_range_3 + */ + double get_coef_ground_range_3() + { + return _coef_ground_range_3; + }; + /** + * @brief coef_ground_range_4 + */ + double get_coef_ground_range_4() + { + return _coef_ground_range_4; + }; + /** + * @brief coef_ant_elev_1 + */ + double get_coef_ant_elev_1() + { + return _coef_ant_elev_1; + }; + /** + * @brief coef_ant_elev_2 + */ + double get_coef_ant_elev_2() + { + return _coef_ant_elev_2; + }; + /** + * @brief coef_ant_elev_3 + */ + double get_coef_ant_elev_3() + { + return _coef_ant_elev_3; + }; + /** + * @brief coef_ant_elev_4 + */ + double get_coef_ant_elev_4() + { + return _coef_ant_elev_4; + }; + /** + * @brief coef_ant_elev_5 + */ + double get_coef_ant_elev_5() + { + return _coef_ant_elev_5; + }; + /** + * @brief range_time_origin_ant + */ + double get_range_time_origin_ant() + { + return _range_time_origin_ant; + }; protected: - /** - * @brief last_release_qc_date - */ - std::string _name_of_facil_rec; - /** - * @brief last_release_qc_date - */ - std::string _last_release_qc_date; - /** - * @brief last_release_cal_date - */ - std::string _last_release_cal_date; - /** - * @brief qa_summary_flag - */ - int _qa_summary_flag; - /** - * @brief prf_code_change_flag - */ - int _prf_code_change_flag; - /** - * @brief sampling_win_change_flag - */ - int _sampling_win_change_flag; - /** - * @brief cal_gain_change_flag - */ - int _cal_gain_change_flag; - /** - * @brief quirp_qu_flag - */ - int _quirp_qu_flag; - /** - * @brief inp_data_stat_flag - */ - int _inp_data_stat_flag; - /** - * @brief dopp_cent_conf_meas_flag - */ - int _dopp_cent_conf_meas_flag; - /** - * @brief dopp_cent_val_flag - */ - int _dopp_cent_val_flag; - /** - * @brief dopp_ambig_conf_meas_flag - */ - int _dopp_ambig_conf_meas_flag; - /** - * @brief outp_data_mean_flag - */ - int _outp_data_mean_flag; - /** - * @brief OGOB_flag - */ - int _OGOB_flag; - /** - * @brief PRF_changes - */ - int _PRF_changes; - /** - * @brief sampling_win_changes - */ - int _sampling_win_changes; - /** - * @brief cal_gain_changes - */ - int _cal_gain_changes; - /** - * @brief missing_lines - */ - int _missing_lines; - /** - * @brief rec_gain_changes - */ - int _rec_gain_changes; - /** - * @brief pulse_width_of_ACF_3db - */ - double _pulse_width_of_ACF_3db; - /** - * @brief first_side_lobe_lev_of_ACF - */ - double _first_side_lobe_lev_of_ACF; - /** - * @brief ISLR_of_ACF - */ - double _ISLR_of_ACF; - /** - * @brief dopp_cent_conf_meas - */ - double _dopp_cent_conf_meas; - /** - * @brief dopp_ambig_conf_meas - */ - double _dopp_ambig_conf_meas; - /** - * @brief inp_data_I_mean - */ - double _inp_data_I_mean; - /** - * @brief inp_data_Q_mean - */ - double _inp_data_Q_mean; - /** - * @brief inp_data_I_stddev - */ - double _inp_data_I_stddev; - /** - * @brief inp_data_Q_stddev - */ - double _inp_data_Q_stddev; - /** - * @brief cal_sys_gain - */ - double _cal_sys_gain; - /** - * @brief first_rec_gain_read - */ - double _first_rec_gain_read; - /** - * @brief dopp_ambig_num - */ - double _dopp_ambig_num; - /** - * @brief I_channel_bias_correction - */ - double _I_channel_bias_correction; - /** - * @brief Q_channel_bias_correction - */ - double _Q_channel_bias_correction; - /** - * @brief I_channel_gain_correction - */ - double _I_channel_gain_correction; - /** - * @brief Q_channel_gain_correction - */ - double _Q_channel_gain_correction; - /** - * @brief Q_channel_I_Q_correction - */ - double _Q_channel_I_Q_correction; - /** - * @brief noise_power - */ - double _noise_power; - /** - * @brief int_cal_utc - */ - int _int_cal_utc; - /** - * @brief num_valid_cal_pulses - */ - int _num_valid_cal_pulses; - /** - * @brief num_valid_noise_pulses - */ - int _num_valid_noise_pulses; - /** - * @brief num_valid_replicas - */ - int _num_valid_replicas; - /** - * @brief first_replica_sample - */ - double _first_replica_sample; - /** - * @brief mean_cal_pulse_power - */ - double _mean_cal_pulse_power; - /** - * @brief mean_noise_power - */ - double _mean_noise_power; - /** - * @brief range_comp_norm_fact - */ - double _range_comp_norm_fact; - /** - * @brief replica_power - */ - double _replica_power; - /** - * @brief first_range_pixel_mid_az_inc - */ - double _first_range_pixel_mid_az_inc; - /** - * @brief center_range_pix_mid_az_inc - */ - double _center_range_pix_mid_az_inc; - /** - * @brief last_range_pix_mid_az_inc - */ - double _last_range_pix_mid_az_inc; - /** - * @brief norm_ref_range_ro - */ - double _norm_ref_range_ro; - /** - * @brief antenna_elev_flag - */ - int _antenna_elev_flag; - /** - * @brief abs_cal_const_K - */ - double _abs_cal_const_K; - /** - * @brief upp_bound_K - */ - double _upp_bound_K; - /** - * @brief low_bound_K - */ - double _low_bound_K; - /** - * @brief proc_noise_scale_fact - */ - double _proc_noise_scale_fact; - /** - * @brief K_gen_date - */ - std::string _K_gen_date; - /** - * @brief K_vers_num - */ - std::string _K_vers_num; - /** - * @brief num_duplic_input_lines - */ - int _num_duplic_input_lines; - /** - * @brief estim_bit_error_rate - */ - double _estim_bit_error_rate; - /** - * @brief out_image_mean - */ - double _out_image_mean; - /** - * @brief out_image_std_dev - */ - double _out_image_std_dev; - /** - * @brief out_image_max_value - */ - double _out_image_max_value; - /** - * @brief time_raw_data_first_input - */ - std::string _time_raw_data_first_input; - /** - * @brief time_asc_node_state_vectors - */ - std::string _time_asc_node_state_vectors; - /** - * @brief asc_node_pos_X_comp - */ - std::string _asc_node_pos_X_comp; - /** - * @brief asc_node_pos_Y_comp - */ - std::string _asc_node_pos_Y_comp; - /** - * @brief asc_node_pos_Z_comp - */ - std::string _asc_node_pos_Z_comp; - /** - * @brief asc_node_vel_X_comp - */ - std::string _asc_node_vel_X_comp; - /** - * @brief asc_node_vel_Y_comp - */ - std::string _asc_node_vel_Y_comp; - /** - * @brief asc_node_vel_Z_comp - */ - std::string _asc_node_vel_Z_comp; - /** - * @brief out_pixel_bit_length - */ - int _out_pixel_bit_length; - /** - * @brief proc_gain_param_1 - */ - double _proc_gain_param_1; - /** - * @brief proc_gain_param_2 - */ - double _proc_gain_param_2; - /** - * @brief proc_gain_param_3 - */ - double _proc_gain_param_3; - /** - * @brief peak_loc_cross_correl_fun - */ - int _peak_loc_cross_correl_fun; - /** - * @brief 3_dB_width_CCF - */ - double _3_dB_width_CCF; - /** - * @brief first_side_lobe_level - */ - double _first_side_lobe_level; - /** - * @brief ISLR_CCF_between_last - */ - double _ISLR_CCF_between_last; - /** - * @brief peak_loc_CCF_betw_last - */ - int _peak_loc_CCF_betw_last; - /** - * @brief Roll_Tilt_Mode_flag - */ - int _Roll_Tilt_Mode_flag; - /** - * @brief raw_data_correction_flag - */ - int _raw_data_correction_flag; - /** - * @brief look_detecion_flag - */ - int _look_detecion_flag; - /** - * @brief doppler_ambiguity_estimat_flag - */ - int _doppler_ambiguity_estimat_flag; - /** - * @brief azimuth_baseband_convers_flag - */ - int _azimuth_baseband_convers_flag; - /** - * @brief samples_per_line_used - */ - int _samples_per_line_used; - /** - * @brief range_lines_skip_factor - */ - int _range_lines_skip_factor; - /** - * @brief time_of_inp_state_vectors - */ - std::string _time_of_inp_state_vectors; - /** - * @brief inp_state_vect_pos_X_comp - */ - std::string _inp_state_vect_pos_X_comp; - /** - * @brief inp_state_vect_pos_Y_comp - */ - std::string _inp_state_vect_pos_Y_comp; - /** - * @brief inp_state_vect_pos_Z_comp - */ - std::string _inp_state_vect_pos_Z_comp; - /** - * @brief inp_state_vect_vel_Vx_comp - */ - std::string _inp_state_vect_vel_Vx_comp; - /** - * @brief inp_state_vect_vel_Vy_comp - */ - std::string _inp_state_vect_vel_Vy_comp; - /** - * @brief inp_state_vect_vel_Vz_comp - */ - std::string _inp_state_vect_vel_Vz_comp; - /** - * @brief inp_state_vector_type_flag - */ - int _inp_state_vector_type_flag; - /** - * @brief win_coeff_for_range_match - */ - double _win_coeff_for_range_match; - /** - * @brief win_coeff_for_azi_match - */ - double _win_coeff_for_azi_match; - /** - * @brief update_period_range_match - */ - int _update_period_range_match; - /** - * @brief look_scalar_gain_1 - */ - double _look_scalar_gain_1; - /** - * @brief look_scalar_gain_2 - */ - double _look_scalar_gain_2; - /** - * @brief look_scalar_gain_3 - */ - double _look_scalar_gain_3; - /** - * @brief look_scalar_gain_4 - */ - double _look_scalar_gain_4; - /** - * @brief look_scalar_gain_5 - */ - double _look_scalar_gain_5; - /** - * @brief look_scalar_gain_6 - */ - double _look_scalar_gain_6; - /** - * @brief look_scalar_gain_7 - */ - double _look_scalar_gain_7; - /** - * @brief look_scalar_gain_8 - */ - double _look_scalar_gain_8; - /** - * @brief samp_window_start_time_bias - */ - int _samp_window_start_time_bias; - /** - * @brief doppler_centroid_cubic_coeff - */ - double _doppler_centroid_cubic_coeff; - /** - * @brief PRF_code_first_range_line - */ - int _PRF_code_first_range_line; - /** - * @brief PRF_code_last_range_line - */ - int _PRF_code_last_range_line; - /** - * @brief samp_win_start_first - */ - int _samp_win_start_first; - /** - * @brief samp_win_start_last - */ - int _samp_win_start_last; - /** - * @brief cal_syst_gain_last_proc - */ - int _cal_syst_gain_last_proc; - /** - * @brief receiver_gain_last_proc - */ - int _receiver_gain_last_proc; - /** - * @brief first_processed_range_sample - */ - int _first_processed_range_sample; - /** - * @brief azimuth_FFT_IFFT_ratio - */ - int _azimuth_FFT_IFFT_ratio; - /** - * @brief num_azimuth_blocks_proc - */ - int _num_azimuth_blocks_proc; - /** - * @brief num_input_raw_data_lines - */ - int _num_input_raw_data_lines; - /** - * @brief initial_doppler_ambiguity_num - */ - int _initial_doppler_ambiguity_num; - /** - * @brief thresh_no_1_flag - */ - double _thresh_no_1_flag; - /** - * @brief thresh_no_2_flag - */ - double _thresh_no_2_flag; - /** - * @brief thresh_no_3_flag - */ - double _thresh_no_3_flag; - /** - * @brief thresh_no_4_flag - */ - double _thresh_no_4_flag; - /** - * @brief thresh_no_5_flag - */ - double _thresh_no_5_flag; - /** - * @brief thresh_no_6_flag - */ - double _thresh_no_6_flag; - /** - * @brief thresh_no_7_flag - */ - double _thresh_no_7_flag; - /** - * @brief thresh_no_8_flag - */ - double _thresh_no_8_flag; - /** - * @brief thresh_no_9_flag - */ - double _thresh_no_9_flag; - /** - * @brief thresh_no_10_flag - */ - double _thresh_no_10_flag; - /** - * @brief thresh_no_11_flag - */ - double _thresh_no_11_flag; - /** - * @brief sat_binary_time_of_first - */ - int _sat_binary_time_of_first; - /** - * @brief num_valid_pixels_per_range - */ - int _num_valid_pixels_per_range; - /** - * @brief num_range_samp_discarded - */ - int _num_range_samp_discarded; - /** - * @brief I_gain_imb_lower_bound - */ - double _I_gain_imb_lower_bound; - /** - * @brief I_gain_imb_upper_bound - */ - double _I_gain_imb_upper_bound; - /** - * @brief I_Q_quad_depar_lower_bound - */ - double _I_Q_quad_depar_lower_bound; - /** - * @brief I_Q_quad_depar_upper_bound - */ - double _I_Q_quad_depar_upper_bound; - /** - * @brief 3_dB_look_bandwidth - */ - double _3_dB_look_bandwidth; - /** - * @brief 3_dB_look_proc_dopp_bandw - */ - double _3_dB_look_proc_dopp_bandw; - /** - * @brief range_spread_loss_comp_flag - */ - int _range_spread_loss_comp_flag; - /** - * @brief datation_flag - */ - bool _datation_flag; - /** - * @brief max_error_range_line_timing - */ - int _max_error_range_line_timing; - /** - * @brief form_num_range_line_used - */ - int _form_num_range_line_used; - /** - * @brief autom_look_scal_gain_flag - */ - bool _autom_look_scal_gain_flag; - /** - * @brief max_value_look_scalar_gain - */ - int _max_value_look_scalar_gain; - /** - * @brief replica_norm_method_flag - */ - int _replica_norm_method_flag; - /** - * @brief coef_ground_range_1 - */ - double _coef_ground_range_1; - /** - * @brief coef_ground_range_2 - */ - double _coef_ground_range_2; - /** - * @brief coef_ground_range_3 - */ - double _coef_ground_range_3; - /** - * @brief coef_ground_range_4 - */ - double _coef_ground_range_4; - /** - * @brief coef_ant_elev_1 - */ - double _coef_ant_elev_1; - /** - * @brief coef_ant_elev_2 - */ - double _coef_ant_elev_2; - /** - * @brief coef_ant_elev_3 - */ - double _coef_ant_elev_3; - /** - * @brief coef_ant_elev_4 - */ - double _coef_ant_elev_4; - /** - * @brief coef_ant_elev_5 - */ - double _coef_ant_elev_5; - /** - * @brief range_time_origin_ant - */ - double _range_time_origin_ant; + /** + * @brief last_release_qc_date + */ + std::string _name_of_facil_rec; + /** + * @brief last_release_qc_date + */ + std::string _last_release_qc_date; + /** + * @brief last_release_cal_date + */ + std::string _last_release_cal_date; + /** + * @brief qa_summary_flag + */ + int _qa_summary_flag; + /** + * @brief prf_code_change_flag + */ + int _prf_code_change_flag; + /** + * @brief sampling_win_change_flag + */ + int _sampling_win_change_flag; + /** + * @brief cal_gain_change_flag + */ + int _cal_gain_change_flag; + /** + * @brief quirp_qu_flag + */ + int _quirp_qu_flag; + /** + * @brief inp_data_stat_flag + */ + int _inp_data_stat_flag; + /** + * @brief dopp_cent_conf_meas_flag + */ + int _dopp_cent_conf_meas_flag; + /** + * @brief dopp_cent_val_flag + */ + int _dopp_cent_val_flag; + /** + * @brief dopp_ambig_conf_meas_flag + */ + int _dopp_ambig_conf_meas_flag; + /** + * @brief outp_data_mean_flag + */ + int _outp_data_mean_flag; + /** + * @brief OGOB_flag + */ + int _OGOB_flag; + /** + * @brief PRF_changes + */ + int _PRF_changes; + /** + * @brief sampling_win_changes + */ + int _sampling_win_changes; + /** + * @brief cal_gain_changes + */ + int _cal_gain_changes; + /** + * @brief missing_lines + */ + int _missing_lines; + /** + * @brief rec_gain_changes + */ + int _rec_gain_changes; + /** + * @brief pulse_width_of_ACF_3db + */ + double _pulse_width_of_ACF_3db; + /** + * @brief first_side_lobe_lev_of_ACF + */ + double _first_side_lobe_lev_of_ACF; + /** + * @brief ISLR_of_ACF + */ + double _ISLR_of_ACF; + /** + * @brief dopp_cent_conf_meas + */ + double _dopp_cent_conf_meas; + /** + * @brief dopp_ambig_conf_meas + */ + double _dopp_ambig_conf_meas; + /** + * @brief inp_data_I_mean + */ + double _inp_data_I_mean; + /** + * @brief inp_data_Q_mean + */ + double _inp_data_Q_mean; + /** + * @brief inp_data_I_stddev + */ + double _inp_data_I_stddev; + /** + * @brief inp_data_Q_stddev + */ + double _inp_data_Q_stddev; + /** + * @brief cal_sys_gain + */ + double _cal_sys_gain; + /** + * @brief first_rec_gain_read + */ + double _first_rec_gain_read; + /** + * @brief dopp_ambig_num + */ + double _dopp_ambig_num; + /** + * @brief I_channel_bias_correction + */ + double _I_channel_bias_correction; + /** + * @brief Q_channel_bias_correction + */ + double _Q_channel_bias_correction; + /** + * @brief I_channel_gain_correction + */ + double _I_channel_gain_correction; + /** + * @brief Q_channel_gain_correction + */ + double _Q_channel_gain_correction; + /** + * @brief Q_channel_I_Q_correction + */ + double _Q_channel_I_Q_correction; + /** + * @brief noise_power + */ + double _noise_power; + /** + * @brief int_cal_utc + */ + int _int_cal_utc; + /** + * @brief num_valid_cal_pulses + */ + int _num_valid_cal_pulses; + /** + * @brief num_valid_noise_pulses + */ + int _num_valid_noise_pulses; + /** + * @brief num_valid_replicas + */ + int _num_valid_replicas; + /** + * @brief first_replica_sample + */ + double _first_replica_sample; + /** + * @brief mean_cal_pulse_power + */ + double _mean_cal_pulse_power; + /** + * @brief mean_noise_power + */ + double _mean_noise_power; + /** + * @brief range_comp_norm_fact + */ + double _range_comp_norm_fact; + /** + * @brief replica_power + */ + double _replica_power; + /** + * @brief first_range_pixel_mid_az_inc + */ + double _first_range_pixel_mid_az_inc; + /** + * @brief center_range_pix_mid_az_inc + */ + double _center_range_pix_mid_az_inc; + /** + * @brief last_range_pix_mid_az_inc + */ + double _last_range_pix_mid_az_inc; + /** + * @brief norm_ref_range_ro + */ + double _norm_ref_range_ro; + /** + * @brief antenna_elev_flag + */ + int _antenna_elev_flag; + /** + * @brief abs_cal_const_K + */ + double _abs_cal_const_K; + /** + * @brief upp_bound_K + */ + double _upp_bound_K; + /** + * @brief low_bound_K + */ + double _low_bound_K; + /** + * @brief proc_noise_scale_fact + */ + double _proc_noise_scale_fact; + /** + * @brief K_gen_date + */ + std::string _K_gen_date; + /** + * @brief K_vers_num + */ + std::string _K_vers_num; + /** + * @brief num_duplic_input_lines + */ + int _num_duplic_input_lines; + /** + * @brief estim_bit_error_rate + */ + double _estim_bit_error_rate; + /** + * @brief out_image_mean + */ + double _out_image_mean; + /** + * @brief out_image_std_dev + */ + double _out_image_std_dev; + /** + * @brief out_image_max_value + */ + double _out_image_max_value; + /** + * @brief time_raw_data_first_input + */ + std::string _time_raw_data_first_input; + /** + * @brief time_asc_node_state_vectors + */ + std::string _time_asc_node_state_vectors; + /** + * @brief asc_node_pos_X_comp + */ + std::string _asc_node_pos_X_comp; + /** + * @brief asc_node_pos_Y_comp + */ + std::string _asc_node_pos_Y_comp; + /** + * @brief asc_node_pos_Z_comp + */ + std::string _asc_node_pos_Z_comp; + /** + * @brief asc_node_vel_X_comp + */ + std::string _asc_node_vel_X_comp; + /** + * @brief asc_node_vel_Y_comp + */ + std::string _asc_node_vel_Y_comp; + /** + * @brief asc_node_vel_Z_comp + */ + std::string _asc_node_vel_Z_comp; + /** + * @brief out_pixel_bit_length + */ + int _out_pixel_bit_length; + /** + * @brief proc_gain_param_1 + */ + double _proc_gain_param_1; + /** + * @brief proc_gain_param_2 + */ + double _proc_gain_param_2; + /** + * @brief proc_gain_param_3 + */ + double _proc_gain_param_3; + /** + * @brief peak_loc_cross_correl_fun + */ + int _peak_loc_cross_correl_fun; + /** + * @brief 3_dB_width_CCF + */ + double _3_dB_width_CCF; + /** + * @brief first_side_lobe_level + */ + double _first_side_lobe_level; + /** + * @brief ISLR_CCF_between_last + */ + double _ISLR_CCF_between_last; + /** + * @brief peak_loc_CCF_betw_last + */ + int _peak_loc_CCF_betw_last; + /** + * @brief Roll_Tilt_Mode_flag + */ + int _Roll_Tilt_Mode_flag; + /** + * @brief raw_data_correction_flag + */ + int _raw_data_correction_flag; + /** + * @brief look_detecion_flag + */ + int _look_detecion_flag; + /** + * @brief doppler_ambiguity_estimat_flag + */ + int _doppler_ambiguity_estimat_flag; + /** + * @brief azimuth_baseband_convers_flag + */ + int _azimuth_baseband_convers_flag; + /** + * @brief samples_per_line_used + */ + int _samples_per_line_used; + /** + * @brief range_lines_skip_factor + */ + int _range_lines_skip_factor; + /** + * @brief time_of_inp_state_vectors + */ + std::string _time_of_inp_state_vectors; + /** + * @brief inp_state_vect_pos_X_comp + */ + std::string _inp_state_vect_pos_X_comp; + /** + * @brief inp_state_vect_pos_Y_comp + */ + std::string _inp_state_vect_pos_Y_comp; + /** + * @brief inp_state_vect_pos_Z_comp + */ + std::string _inp_state_vect_pos_Z_comp; + /** + * @brief inp_state_vect_vel_Vx_comp + */ + std::string _inp_state_vect_vel_Vx_comp; + /** + * @brief inp_state_vect_vel_Vy_comp + */ + std::string _inp_state_vect_vel_Vy_comp; + /** + * @brief inp_state_vect_vel_Vz_comp + */ + std::string _inp_state_vect_vel_Vz_comp; + /** + * @brief inp_state_vector_type_flag + */ + int _inp_state_vector_type_flag; + /** + * @brief win_coeff_for_range_match + */ + double _win_coeff_for_range_match; + /** + * @brief win_coeff_for_azi_match + */ + double _win_coeff_for_azi_match; + /** + * @brief update_period_range_match + */ + int _update_period_range_match; + /** + * @brief look_scalar_gain_1 + */ + double _look_scalar_gain_1; + /** + * @brief look_scalar_gain_2 + */ + double _look_scalar_gain_2; + /** + * @brief look_scalar_gain_3 + */ + double _look_scalar_gain_3; + /** + * @brief look_scalar_gain_4 + */ + double _look_scalar_gain_4; + /** + * @brief look_scalar_gain_5 + */ + double _look_scalar_gain_5; + /** + * @brief look_scalar_gain_6 + */ + double _look_scalar_gain_6; + /** + * @brief look_scalar_gain_7 + */ + double _look_scalar_gain_7; + /** + * @brief look_scalar_gain_8 + */ + double _look_scalar_gain_8; + /** + * @brief samp_window_start_time_bias + */ + int _samp_window_start_time_bias; + /** + * @brief doppler_centroid_cubic_coeff + */ + double _doppler_centroid_cubic_coeff; + /** + * @brief PRF_code_first_range_line + */ + int _PRF_code_first_range_line; + /** + * @brief PRF_code_last_range_line + */ + int _PRF_code_last_range_line; + /** + * @brief samp_win_start_first + */ + int _samp_win_start_first; + /** + * @brief samp_win_start_last + */ + int _samp_win_start_last; + /** + * @brief cal_syst_gain_last_proc + */ + int _cal_syst_gain_last_proc; + /** + * @brief receiver_gain_last_proc + */ + int _receiver_gain_last_proc; + /** + * @brief first_processed_range_sample + */ + int _first_processed_range_sample; + /** + * @brief azimuth_FFT_IFFT_ratio + */ + int _azimuth_FFT_IFFT_ratio; + /** + * @brief num_azimuth_blocks_proc + */ + int _num_azimuth_blocks_proc; + /** + * @brief num_input_raw_data_lines + */ + int _num_input_raw_data_lines; + /** + * @brief initial_doppler_ambiguity_num + */ + int _initial_doppler_ambiguity_num; + /** + * @brief thresh_no_1_flag + */ + double _thresh_no_1_flag; + /** + * @brief thresh_no_2_flag + */ + double _thresh_no_2_flag; + /** + * @brief thresh_no_3_flag + */ + double _thresh_no_3_flag; + /** + * @brief thresh_no_4_flag + */ + double _thresh_no_4_flag; + /** + * @brief thresh_no_5_flag + */ + double _thresh_no_5_flag; + /** + * @brief thresh_no_6_flag + */ + double _thresh_no_6_flag; + /** + * @brief thresh_no_7_flag + */ + double _thresh_no_7_flag; + /** + * @brief thresh_no_8_flag + */ + double _thresh_no_8_flag; + /** + * @brief thresh_no_9_flag + */ + double _thresh_no_9_flag; + /** + * @brief thresh_no_10_flag + */ + double _thresh_no_10_flag; + /** + * @brief thresh_no_11_flag + */ + double _thresh_no_11_flag; + /** + * @brief sat_binary_time_of_first + */ + int _sat_binary_time_of_first; + /** + * @brief num_valid_pixels_per_range + */ + int _num_valid_pixels_per_range; + /** + * @brief num_range_samp_discarded + */ + int _num_range_samp_discarded; + /** + * @brief I_gain_imb_lower_bound + */ + double _I_gain_imb_lower_bound; + /** + * @brief I_gain_imb_upper_bound + */ + double _I_gain_imb_upper_bound; + /** + * @brief I_Q_quad_depar_lower_bound + */ + double _I_Q_quad_depar_lower_bound; + /** + * @brief I_Q_quad_depar_upper_bound + */ + double _I_Q_quad_depar_upper_bound; + /** + * @brief 3_dB_look_bandwidth + */ + double _3_dB_look_bandwidth; + /** + * @brief 3_dB_look_proc_dopp_bandw + */ + double _3_dB_look_proc_dopp_bandw; + /** + * @brief range_spread_loss_comp_flag + */ + int _range_spread_loss_comp_flag; + /** + * @brief datation_flag + */ + bool _datation_flag; + /** + * @brief max_error_range_line_timing + */ + int _max_error_range_line_timing; + /** + * @brief form_num_range_line_used + */ + int _form_num_range_line_used; + /** + * @brief autom_look_scal_gain_flag + */ + bool _autom_look_scal_gain_flag; + /** + * @brief max_value_look_scalar_gain + */ + int _max_value_look_scalar_gain; + /** + * @brief replica_norm_method_flag + */ + int _replica_norm_method_flag; + /** + * @brief coef_ground_range_1 + */ + double _coef_ground_range_1; + /** + * @brief coef_ground_range_2 + */ + double _coef_ground_range_2; + /** + * @brief coef_ground_range_3 + */ + double _coef_ground_range_3; + /** + * @brief coef_ground_range_4 + */ + double _coef_ground_range_4; + /** + * @brief coef_ant_elev_1 + */ + double _coef_ant_elev_1; + /** + * @brief coef_ant_elev_2 + */ + double _coef_ant_elev_2; + /** + * @brief coef_ant_elev_3 + */ + double _coef_ant_elev_3; + /** + * @brief coef_ant_elev_4 + */ + double _coef_ant_elev_4; + /** + * @brief coef_ant_elev_5 + */ + double _coef_ant_elev_5; + /** + * @brief range_time_origin_ant + */ + double _range_time_origin_ant; private: diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.cpp index 8b231b0d69af8711177ee938daf42b2db1b24875..cfd9953af644da4f0a2ade3b8ab5a071f8f26d6e 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.cpp @@ -25,313 +25,313 @@ ErsSarFileDescriptor::~ErsSarFileDescriptor() std::ostream& operator<<(std::ostream& os, const ErsSarFileDescriptor& data) { - os<<"ascii_flag:"<<data._ascii_flag.c_str()<<std::endl; - os<<"format_doc:"<<data._format_doc.c_str()<<std::endl; - os<<"format_ver:"<<data._format_ver.c_str()<<std::endl; - os<<"design_rev:"<<data._design_rev.c_str()<<std::endl; - os<<"software_id:"<<data._software_id.c_str()<<std::endl; - os<<"file_num:"<<data._file_num<<std::endl; - os<<"file_name:"<<data._file_name.c_str()<<std::endl; - os<<"rec_seq:"<<data._rec_seq.c_str()<<std::endl; - os<<"seq_loc:"<<data._seq_loc<<std::endl; - os<<"seq_len:"<<data._seq_len<<std::endl; - os<<"rec_code:"<<data._rec_code.c_str()<<std::endl; - os<<"code_loc:"<<data._code_loc<<std::endl; - os<<"code_len:"<<data._code_len<<std::endl; - os<<"rec_len:"<<data._rec_len.c_str()<<std::endl; - os<<"rlen_loc:"<<data._rlen_loc<<std::endl; - os<<"rlen_len:"<<data._rlen_len<<std::endl; - os<<"n_dataset:"<<data._n_dataset<<std::endl; - os<<"l_dataset:"<<data._l_dataset<<std::endl; - os<<"n_map_proj:"<<data._n_map_proj<<std::endl; - os<<"l_map_proj:"<<data._l_map_proj<<std::endl; - os<<"n_plat_pos:"<<data._n_plat_pos<<std::endl; - os<<"l_plat_pos:"<<data._l_plat_pos<<std::endl; - os<<"n_att_data:"<<data._n_att_data<<std::endl; - os<<"l_att_data:"<<data._l_att_data<<std::endl; - os<<"n_radi_data:"<<data._n_radi_data<<std::endl; - os<<"l_radi_data:"<<data._l_radi_data<<std::endl; - os<<"n_radi_comp:"<<data._n_radi_comp<<std::endl; - os<<"l_radi_comp:"<<data._l_radi_comp<<std::endl; - os<<"n_qual_sum:"<<data._n_qual_sum<<std::endl; - os<<"l_qual_sum:"<<data._l_qual_sum<<std::endl; - os<<"n_data_his:"<<data._n_data_his<<std::endl; - os<<"l_data_his:"<<data._l_data_his<<std::endl; - os<<"n_rang_spec:"<<data._n_rang_spec<<std::endl; - os<<"l_rang_spec:"<<data._l_rang_spec<<std::endl; - os<<"n_dem_desc:"<<data._n_dem_desc<<std::endl; - os<<"l_dem_desc:"<<data._l_dem_desc<<std::endl; - os<<"n_radar_par:"<<data._n_radar_par<<std::endl; - os<<"l_radar_par:"<<data._l_radar_par<<std::endl; - os<<"n_anno_data:"<<data._n_anno_data<<std::endl; - os<<"l_anno_data:"<<data._l_anno_data<<std::endl; - os<<"n_det_proc:"<<data._n_det_proc<<std::endl; - os<<"l_det_proc:"<<data._l_det_proc<<std::endl; - os<<"n_cal:"<<data._n_cal<<std::endl; - os<<"l_cal:"<<data._l_cal<<std::endl; - os<<"n_gcp:"<<data._n_gcp<<std::endl; - os<<"l_gcp:"<<data._l_gcp<<std::endl; - os<<"n_fac_data:"<<data._n_fac_data<<std::endl; - os<<"l_fac_data:"<<data._l_fac_data<<std::endl; - return os; + os<<"ascii_flag:"<<data._ascii_flag.c_str()<<std::endl; + os<<"format_doc:"<<data._format_doc.c_str()<<std::endl; + os<<"format_ver:"<<data._format_ver.c_str()<<std::endl; + os<<"design_rev:"<<data._design_rev.c_str()<<std::endl; + os<<"software_id:"<<data._software_id.c_str()<<std::endl; + os<<"file_num:"<<data._file_num<<std::endl; + os<<"file_name:"<<data._file_name.c_str()<<std::endl; + os<<"rec_seq:"<<data._rec_seq.c_str()<<std::endl; + os<<"seq_loc:"<<data._seq_loc<<std::endl; + os<<"seq_len:"<<data._seq_len<<std::endl; + os<<"rec_code:"<<data._rec_code.c_str()<<std::endl; + os<<"code_loc:"<<data._code_loc<<std::endl; + os<<"code_len:"<<data._code_len<<std::endl; + os<<"rec_len:"<<data._rec_len.c_str()<<std::endl; + os<<"rlen_loc:"<<data._rlen_loc<<std::endl; + os<<"rlen_len:"<<data._rlen_len<<std::endl; + os<<"n_dataset:"<<data._n_dataset<<std::endl; + os<<"l_dataset:"<<data._l_dataset<<std::endl; + os<<"n_map_proj:"<<data._n_map_proj<<std::endl; + os<<"l_map_proj:"<<data._l_map_proj<<std::endl; + os<<"n_plat_pos:"<<data._n_plat_pos<<std::endl; + os<<"l_plat_pos:"<<data._l_plat_pos<<std::endl; + os<<"n_att_data:"<<data._n_att_data<<std::endl; + os<<"l_att_data:"<<data._l_att_data<<std::endl; + os<<"n_radi_data:"<<data._n_radi_data<<std::endl; + os<<"l_radi_data:"<<data._l_radi_data<<std::endl; + os<<"n_radi_comp:"<<data._n_radi_comp<<std::endl; + os<<"l_radi_comp:"<<data._l_radi_comp<<std::endl; + os<<"n_qual_sum:"<<data._n_qual_sum<<std::endl; + os<<"l_qual_sum:"<<data._l_qual_sum<<std::endl; + os<<"n_data_his:"<<data._n_data_his<<std::endl; + os<<"l_data_his:"<<data._l_data_his<<std::endl; + os<<"n_rang_spec:"<<data._n_rang_spec<<std::endl; + os<<"l_rang_spec:"<<data._l_rang_spec<<std::endl; + os<<"n_dem_desc:"<<data._n_dem_desc<<std::endl; + os<<"l_dem_desc:"<<data._l_dem_desc<<std::endl; + os<<"n_radar_par:"<<data._n_radar_par<<std::endl; + os<<"l_radar_par:"<<data._l_radar_par<<std::endl; + os<<"n_anno_data:"<<data._n_anno_data<<std::endl; + os<<"l_anno_data:"<<data._l_anno_data<<std::endl; + os<<"n_det_proc:"<<data._n_det_proc<<std::endl; + os<<"l_det_proc:"<<data._l_det_proc<<std::endl; + os<<"n_cal:"<<data._n_cal<<std::endl; + os<<"l_cal:"<<data._l_cal<<std::endl; + os<<"n_gcp:"<<data._n_gcp<<std::endl; + os<<"l_gcp:"<<data._l_gcp<<std::endl; + os<<"n_fac_data:"<<data._n_fac_data<<std::endl; + os<<"l_fac_data:"<<data._l_fac_data<<std::endl; + return os; } std::istream& operator>>(std::istream& is, ErsSarFileDescriptor& data) { - char buf2[3]; - buf2[2] = '\0'; - char buf12[13]; - buf12[12] = '\0'; - char buf16[17]; - buf16[16] = '\0'; - char buf4[5]; - buf4[4] = '\0'; - char buf6[7]; - buf6[6] = '\0'; - char buf8[9]; - buf8[8] = '\0'; - char buf64[65]; - buf64[64] = '\0'; + char buf2[3]; + buf2[2] = '\0'; + char buf12[13]; + buf12[12] = '\0'; + char buf16[17]; + buf16[16] = '\0'; + char buf4[5]; + buf4[4] = '\0'; + char buf6[7]; + buf6[6] = '\0'; + char buf8[9]; + buf8[8] = '\0'; + char buf64[65]; + buf64[64] = '\0'; - char buf60[61]; - buf60[60] = '\0'; + char buf60[61]; + buf60[60] = '\0'; - char buf288[289]; - buf288[288] = '\0'; - - is.read(buf2,2); - data._ascii_flag = buf2; - - is.read(buf2,2); - - is.read(buf12,12); - data._format_doc = buf12; - - is.read(buf2,2); - data._format_ver = buf2; - - is.read(buf2,2); - data._design_rev = buf2; - - is.read(buf12,12); - data._software_id = buf12; - - is.read(buf4,4); - data._file_num = atoi(buf4); - - is.read(buf16,16); - data._file_name = buf16; - - is.read(buf4,4); - data._rec_seq = buf4; - - is.read(buf8,8); - data._seq_loc = atoi(buf8); - - is.read(buf4,4); - data._seq_len = atoi(buf4); - - is.read(buf4,4); - data._rec_code = buf4; - - is.read(buf8,8); - data._code_loc = atoi(buf8); - - is.read(buf4,4); - data._code_len = atoi(buf4); - - is.read(buf4,4); - data._rec_len = buf4; - - is.read(buf8,8); - data._rlen_loc = atoi(buf8); - - is.read(buf4,4); - data._rlen_len = atoi(buf4); - - is.read(buf4,4); - - is.read(buf64,64); - - is.read(buf6,6); - data._n_dataset = atoi(buf6); - - is.read(buf6,6); - data._l_dataset = atoi(buf6); - - is.read(buf6,6); - data._n_map_proj = atoi(buf6); - - is.read(buf6,6); - data._l_map_proj = atoi(buf6); - - is.read(buf6,6); - data._n_plat_pos = atoi(buf6); - is.read(buf6,6); - data._l_plat_pos = atoi(buf6); - is.read(buf6,6); - data._n_att_data = atoi(buf6); - is.read(buf6,6); - data._l_att_data = atoi(buf6); - is.read(buf6,6); - data._n_radi_data = atoi(buf6); - is.read(buf6,6); - data._l_radi_data = atoi(buf6); - is.read(buf6,6); - data._n_radi_comp = atoi(buf6); - is.read(buf6,6); - data._l_radi_comp = atoi(buf6); - is.read(buf6,6); - data._n_qual_sum = atoi(buf6); - is.read(buf6,6); - data._l_qual_sum = atoi(buf6); - is.read(buf6,6); - data._n_data_his = atoi(buf6); - is.read(buf6,6); - data._l_data_his = atoi(buf6); - - - - is.read(buf6,6); - data._n_rang_spec = atoi(buf6); - is.read(buf6,6); - data._l_rang_spec = atoi(buf6); - is.read(buf6,6); - data._n_dem_desc = atoi(buf6); - is.read(buf6,6); - data._l_dem_desc = atoi(buf6); - is.read(buf6,6); - data._n_radar_par = atoi(buf6); - is.read(buf6,6); - data._l_radar_par = atoi(buf6); - is.read(buf6,6); - data._n_anno_data = atoi(buf6); - is.read(buf6,6); - data._l_anno_data = atoi(buf6); - is.read(buf6,6); - data._n_det_proc = atoi(buf6); - is.read(buf6,6); - data._l_det_proc = atoi(buf6); - is.read(buf6,6); - data._n_cal = atoi(buf6); - is.read(buf6,6); - data._l_cal = atoi(buf6); - is.read(buf6,6); - data._n_gcp = atoi(buf6); - is.read(buf6,6); - data._l_gcp = atoi(buf6); - is.read(buf60,60); - is.read(buf6,6); - data._n_fac_data = atoi(buf6); - is.read(buf6,6); - data._l_fac_data = atoi(buf6); - is.read(buf288,288); - return is; + char buf288[289]; + buf288[288] = '\0'; + + is.read(buf2,2); + data._ascii_flag = buf2; + + is.read(buf2,2); + + is.read(buf12,12); + data._format_doc = buf12; + + is.read(buf2,2); + data._format_ver = buf2; + + is.read(buf2,2); + data._design_rev = buf2; + + is.read(buf12,12); + data._software_id = buf12; + + is.read(buf4,4); + data._file_num = atoi(buf4); + + is.read(buf16,16); + data._file_name = buf16; + + is.read(buf4,4); + data._rec_seq = buf4; + + is.read(buf8,8); + data._seq_loc = atoi(buf8); + + is.read(buf4,4); + data._seq_len = atoi(buf4); + + is.read(buf4,4); + data._rec_code = buf4; + + is.read(buf8,8); + data._code_loc = atoi(buf8); + + is.read(buf4,4); + data._code_len = atoi(buf4); + + is.read(buf4,4); + data._rec_len = buf4; + + is.read(buf8,8); + data._rlen_loc = atoi(buf8); + + is.read(buf4,4); + data._rlen_len = atoi(buf4); + + is.read(buf4,4); + + is.read(buf64,64); + + is.read(buf6,6); + data._n_dataset = atoi(buf6); + + is.read(buf6,6); + data._l_dataset = atoi(buf6); + + is.read(buf6,6); + data._n_map_proj = atoi(buf6); + + is.read(buf6,6); + data._l_map_proj = atoi(buf6); + + is.read(buf6,6); + data._n_plat_pos = atoi(buf6); + is.read(buf6,6); + data._l_plat_pos = atoi(buf6); + is.read(buf6,6); + data._n_att_data = atoi(buf6); + is.read(buf6,6); + data._l_att_data = atoi(buf6); + is.read(buf6,6); + data._n_radi_data = atoi(buf6); + is.read(buf6,6); + data._l_radi_data = atoi(buf6); + is.read(buf6,6); + data._n_radi_comp = atoi(buf6); + is.read(buf6,6); + data._l_radi_comp = atoi(buf6); + is.read(buf6,6); + data._n_qual_sum = atoi(buf6); + is.read(buf6,6); + data._l_qual_sum = atoi(buf6); + is.read(buf6,6); + data._n_data_his = atoi(buf6); + is.read(buf6,6); + data._l_data_his = atoi(buf6); + + + + is.read(buf6,6); + data._n_rang_spec = atoi(buf6); + is.read(buf6,6); + data._l_rang_spec = atoi(buf6); + is.read(buf6,6); + data._n_dem_desc = atoi(buf6); + is.read(buf6,6); + data._l_dem_desc = atoi(buf6); + is.read(buf6,6); + data._n_radar_par = atoi(buf6); + is.read(buf6,6); + data._l_radar_par = atoi(buf6); + is.read(buf6,6); + data._n_anno_data = atoi(buf6); + is.read(buf6,6); + data._l_anno_data = atoi(buf6); + is.read(buf6,6); + data._n_det_proc = atoi(buf6); + is.read(buf6,6); + data._l_det_proc = atoi(buf6); + is.read(buf6,6); + data._n_cal = atoi(buf6); + is.read(buf6,6); + data._l_cal = atoi(buf6); + is.read(buf6,6); + data._n_gcp = atoi(buf6); + is.read(buf6,6); + data._l_gcp = atoi(buf6); + is.read(buf60,60); + is.read(buf6,6); + data._n_fac_data = atoi(buf6); + is.read(buf6,6); + data._l_fac_data = atoi(buf6); + is.read(buf288,288); + return is; } ErsSarFileDescriptor::ErsSarFileDescriptor(const ErsSarFileDescriptor& rhs): - ErsSarRecord(rhs), - _ascii_flag(rhs._ascii_flag), - _format_doc(rhs._format_doc), - _format_ver(rhs._format_ver), - _design_rev(rhs._design_rev), - _software_id(rhs._software_id), - _file_num(rhs._file_num), - _file_name(rhs._file_name), - _rec_seq(rhs._rec_seq), - _seq_loc(rhs._seq_loc), - _seq_len(rhs._seq_len), - _rec_code(rhs._rec_code), - _code_loc(rhs._code_loc), - _code_len(rhs._code_len), - _rec_len(rhs._rec_len), - _rlen_loc(rhs._rlen_loc), - _rlen_len(rhs._rlen_len), - _n_dataset(rhs._n_dataset), - _l_dataset(rhs._l_dataset), - _n_map_proj(rhs._n_map_proj), - _l_map_proj(rhs._l_map_proj), - _n_plat_pos(rhs._n_plat_pos), - _l_plat_pos(rhs._l_plat_pos), - _n_att_data(rhs._n_att_data), - _l_att_data(rhs._l_att_data), - _n_radi_data(rhs._n_radi_data), - _l_radi_data(rhs._l_radi_data), - _n_radi_comp(rhs._n_radi_comp), - _l_radi_comp(rhs._l_radi_comp), - _n_qual_sum(rhs._n_qual_sum), - _l_qual_sum(rhs._l_qual_sum), - _n_data_his(rhs._n_data_his), - _l_data_his(rhs._l_data_his), - _n_rang_spec(rhs._n_rang_spec), - _l_rang_spec(rhs._l_rang_spec), - _n_dem_desc(rhs._n_dem_desc), - _l_dem_desc(rhs._l_dem_desc), - _n_radar_par(rhs._n_radar_par), - _l_radar_par(rhs._l_radar_par), - _n_anno_data(rhs._n_anno_data), - _l_anno_data(rhs._l_anno_data), - _n_det_proc(rhs._n_det_proc), - _l_det_proc(rhs._l_det_proc), - _n_cal(rhs._n_cal), - _l_cal(rhs._l_cal), - _n_gcp(rhs._n_gcp), - _l_gcp(rhs._l_gcp), - _n_fac_data(rhs._n_fac_data), - _l_fac_data(rhs._l_fac_data) + ErsSarRecord(rhs), + _ascii_flag(rhs._ascii_flag), + _format_doc(rhs._format_doc), + _format_ver(rhs._format_ver), + _design_rev(rhs._design_rev), + _software_id(rhs._software_id), + _file_num(rhs._file_num), + _file_name(rhs._file_name), + _rec_seq(rhs._rec_seq), + _seq_loc(rhs._seq_loc), + _seq_len(rhs._seq_len), + _rec_code(rhs._rec_code), + _code_loc(rhs._code_loc), + _code_len(rhs._code_len), + _rec_len(rhs._rec_len), + _rlen_loc(rhs._rlen_loc), + _rlen_len(rhs._rlen_len), + _n_dataset(rhs._n_dataset), + _l_dataset(rhs._l_dataset), + _n_map_proj(rhs._n_map_proj), + _l_map_proj(rhs._l_map_proj), + _n_plat_pos(rhs._n_plat_pos), + _l_plat_pos(rhs._l_plat_pos), + _n_att_data(rhs._n_att_data), + _l_att_data(rhs._l_att_data), + _n_radi_data(rhs._n_radi_data), + _l_radi_data(rhs._l_radi_data), + _n_radi_comp(rhs._n_radi_comp), + _l_radi_comp(rhs._l_radi_comp), + _n_qual_sum(rhs._n_qual_sum), + _l_qual_sum(rhs._l_qual_sum), + _n_data_his(rhs._n_data_his), + _l_data_his(rhs._l_data_his), + _n_rang_spec(rhs._n_rang_spec), + _l_rang_spec(rhs._l_rang_spec), + _n_dem_desc(rhs._n_dem_desc), + _l_dem_desc(rhs._l_dem_desc), + _n_radar_par(rhs._n_radar_par), + _l_radar_par(rhs._l_radar_par), + _n_anno_data(rhs._n_anno_data), + _l_anno_data(rhs._l_anno_data), + _n_det_proc(rhs._n_det_proc), + _l_det_proc(rhs._l_det_proc), + _n_cal(rhs._n_cal), + _l_cal(rhs._l_cal), + _n_gcp(rhs._n_gcp), + _l_gcp(rhs._l_gcp), + _n_fac_data(rhs._n_fac_data), + _l_fac_data(rhs._l_fac_data) { } ErsSarFileDescriptor& ErsSarFileDescriptor::operator=(const ErsSarFileDescriptor& rhs) { - _ascii_flag = rhs._ascii_flag; - _format_doc = rhs._format_doc; - _format_ver = rhs._format_ver; - _design_rev = rhs._design_rev; - _software_id = rhs._software_id; - _file_num = rhs._file_num; - _file_name = rhs._file_name; - _rec_seq = rhs._rec_seq; - _seq_loc = rhs._seq_loc; - _seq_len = rhs._seq_len; - _rec_code = rhs._rec_code; - _code_loc = rhs._code_loc; - _code_len = rhs._code_len; - _rec_len = rhs._rec_len; - _rlen_loc = rhs._rlen_loc; - _rlen_len = rhs._rlen_len; - _n_dataset = rhs._n_dataset; - _l_dataset = rhs._l_dataset; - _n_map_proj = rhs._n_map_proj; - _l_map_proj = rhs._l_map_proj; - _n_plat_pos = rhs._n_plat_pos; - _l_plat_pos = rhs._l_plat_pos; - _n_att_data = rhs._n_att_data; - _l_att_data = rhs._l_att_data; - _n_radi_data = rhs._n_radi_data; - _l_radi_data = rhs._l_radi_data; - _n_radi_comp = rhs._n_radi_comp; - _l_radi_comp = rhs._l_radi_comp; - _n_qual_sum = rhs._n_qual_sum ; - _l_qual_sum = rhs._l_qual_sum; - _n_data_his = rhs._n_data_his; - _l_data_his = rhs._l_data_his; - _n_rang_spec = rhs._n_rang_spec; - _l_rang_spec = rhs._l_rang_spec; - _n_dem_desc = rhs._n_dem_desc; - _l_dem_desc = rhs._l_dem_desc; - _n_radar_par = rhs._n_radar_par; - _l_radar_par = rhs._l_radar_par; - _n_anno_data = rhs._n_anno_data; - _l_anno_data = rhs._l_anno_data; - _n_det_proc = rhs._n_det_proc; - _l_det_proc = rhs._l_det_proc; - _n_cal = rhs._n_cal; - _l_cal = rhs._l_cal; - _n_gcp = rhs._n_gcp; - _l_gcp = rhs._l_gcp; - _n_fac_data = rhs._n_fac_data; - _l_fac_data = rhs._l_fac_data; - return *this; + _ascii_flag = rhs._ascii_flag; + _format_doc = rhs._format_doc; + _format_ver = rhs._format_ver; + _design_rev = rhs._design_rev; + _software_id = rhs._software_id; + _file_num = rhs._file_num; + _file_name = rhs._file_name; + _rec_seq = rhs._rec_seq; + _seq_loc = rhs._seq_loc; + _seq_len = rhs._seq_len; + _rec_code = rhs._rec_code; + _code_loc = rhs._code_loc; + _code_len = rhs._code_len; + _rec_len = rhs._rec_len; + _rlen_loc = rhs._rlen_loc; + _rlen_len = rhs._rlen_len; + _n_dataset = rhs._n_dataset; + _l_dataset = rhs._l_dataset; + _n_map_proj = rhs._n_map_proj; + _l_map_proj = rhs._l_map_proj; + _n_plat_pos = rhs._n_plat_pos; + _l_plat_pos = rhs._l_plat_pos; + _n_att_data = rhs._n_att_data; + _l_att_data = rhs._l_att_data; + _n_radi_data = rhs._n_radi_data; + _l_radi_data = rhs._l_radi_data; + _n_radi_comp = rhs._n_radi_comp; + _l_radi_comp = rhs._l_radi_comp; + _n_qual_sum = rhs._n_qual_sum ; + _l_qual_sum = rhs._l_qual_sum; + _n_data_his = rhs._n_data_his; + _l_data_his = rhs._l_data_his; + _n_rang_spec = rhs._n_rang_spec; + _l_rang_spec = rhs._l_rang_spec; + _n_dem_desc = rhs._n_dem_desc; + _l_dem_desc = rhs._l_dem_desc; + _n_radar_par = rhs._n_radar_par; + _l_radar_par = rhs._l_radar_par; + _n_anno_data = rhs._n_anno_data; + _l_anno_data = rhs._l_anno_data; + _n_det_proc = rhs._n_det_proc; + _l_det_proc = rhs._l_det_proc; + _n_cal = rhs._n_cal; + _l_cal = rhs._l_cal; + _n_gcp = rhs._n_gcp; + _l_gcp = rhs._l_gcp; + _n_fac_data = rhs._n_fac_data; + _l_fac_data = rhs._l_fac_data; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.h index 70adcfb3d22070d2864f9baf7ca5a292d1d01f78..d7cc195605b1db3aab54679f72726eec2a7aa7a2 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarFileDescriptor.h @@ -30,602 +30,602 @@ namespace ossimplugins class ErsSarFileDescriptor : public ErsSarRecord { public: - /** - * @brief Constructor - */ - ErsSarFileDescriptor(); - /** - * @brief Destructor - */ - ~ErsSarFileDescriptor(); + /** + * @brief Constructor + */ + ErsSarFileDescriptor(); + /** + * @brief Destructor + */ + ~ErsSarFileDescriptor(); - /** - * @brief This function write the ErsSarFileDescriptor in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarFileDescriptor& data); + /** + * @brief This function write the ErsSarFileDescriptor in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarFileDescriptor& data); - /** - * @brief This function read a ErsSarFileDescriptor from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarFileDescriptor& data); + /** + * @brief This function read a ErsSarFileDescriptor from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarFileDescriptor& data); - /** - * @brief Copy constructor - */ - ErsSarFileDescriptor(const ErsSarFileDescriptor& rhs); + /** + * @brief Copy constructor + */ + ErsSarFileDescriptor(const ErsSarFileDescriptor& rhs); - /** - * @brief Copy operator - */ - ErsSarFileDescriptor& operator=(const ErsSarFileDescriptor& rhs); + /** + * @brief Copy operator + */ + ErsSarFileDescriptor& operator=(const ErsSarFileDescriptor& rhs); - /** - * @brief This function is able to create a new instance of the class - */ - ErsSarRecord* Instanciate() - { - return new ErsSarFileDescriptor(); - }; + /** + * @brief This function is able to create a new instance of the class + */ + ErsSarRecord* Instanciate() + { + return new ErsSarFileDescriptor(); + }; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - ErsSarRecord* Clone() - { - return new ErsSarFileDescriptor(*this); - }; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + ErsSarRecord* Clone() + { + return new ErsSarFileDescriptor(*this); + }; - /** - * @brief Read the class data from a stream - */ - void Read(std::istream& is) - { - is>>*this; - }; + /** + * @brief Read the class data from a stream + */ + void Read(std::istream& is) + { + is>>*this; + }; - /** - * @brief Write the class to a stream - */ - void Write(std::ostream& os) - { - os<<*this; - }; + /** + * @brief Write the class to a stream + */ + void Write(std::ostream& os) + { + os<<*this; + }; - /** - * @brief ASCII flag - */ - std::string get_ascii_flag() - { - return _ascii_flag; - }; + /** + * @brief ASCII flag + */ + std::string get_ascii_flag() + { + return _ascii_flag; + }; - /** - * @brief Format control documentation - */ - std::string get_format_doc() - { - return _format_doc; - }; - /** - * @brief Format doc version - */ - std::string get_format_ver() - { - return _format_ver; - }; - /** - * @brief Format doc revision - */ + /** + * @brief Format control documentation + */ + std::string get_format_doc() + { + return _format_doc; + }; + /** + * @brief Format doc version + */ + std::string get_format_ver() + { + return _format_ver; + }; + /** + * @brief Format doc revision + */ std::string get_design_rev() - { - return _design_rev; - }; - /** - * @brief Software identifier - */ + { + return _design_rev; + }; + /** + * @brief Software identifier + */ std::string get_software_id() - { - return _software_id; - }; - /** - * @brief File number - */ - int get_file_num() - { - return _file_num ; - }; - /** - * @brief File name - */ + { + return _software_id; + }; + /** + * @brief File number + */ + int get_file_num() + { + return _file_num ; + }; + /** + * @brief File name + */ std::string get_file_name() - { - return _file_name; - }; - /** - * @brief Record sequence/location flag - */ + { + return _file_name; + }; + /** + * @brief Record sequence/location flag + */ std::string get_rec_seq() - { - return _rec_seq; - }; - /** - * @brief Sequence number location - */ - int get_seq_loc() - { - return _seq_loc; - }; - /** - * @brief Sequence number lenght - */ - int get_seq_len() - { - return _seq_len; - }; - /** - * @brief Record code/location flag - */ - std::string get_rec_code() - { - return _rec_code; - }; - /** - * @brief Record code location - */ - int get_code_loc() - { - return _code_loc; - }; - /** - * @brief Record code length - */ + { + return _rec_seq; + }; + /** + * @brief Sequence number location + */ + int get_seq_loc() + { + return _seq_loc; + }; + /** + * @brief Sequence number lenght + */ + int get_seq_len() + { + return _seq_len; + }; + /** + * @brief Record code/location flag + */ + std::string get_rec_code() + { + return _rec_code; + }; + /** + * @brief Record code location + */ + int get_code_loc() + { + return _code_loc; + }; + /** + * @brief Record code length + */ int get_code_len() - { - return _code_len; - }; - /** - * @brief Record length/location flag - */ - std::string get_rec_len() - { - return _rec_len; - }; - /** - * @brief Record lenght location - */ - int get_rlen_loc() - { - return _rlen_loc; - }; - /** - * @brief Record length, bytes - */ - int get_rlen_len() - { - return _rlen_len; - }; - /** - * @brief Number of dataset summ records - */ - int get_n_dataset() - { - return _n_dataset; - }; - /** - * @brief Data set summary record length, bytes - */ - int get_l_dataset() - { - return _l_dataset; - }; - /** - * @brief Number of map proj records - */ - int get_n_map_proj() - { - return _n_map_proj; - }; - /** - * @brief Map projection record length, bytes - */ - int get_l_map_proj() - { - return _l_map_proj; - }; - /** - * @brief Number of platform position records - */ - int get_n_plat_pos() - { - return _n_plat_pos; - }; - /** - * @brief Platform position record length, bytes - */ - int get_l_plat_pos() - { - return _l_plat_pos; - }; - /** - * @brief Number of attitude data records - */ - int get_n_att_data() - { - return _n_att_data; - }; - /** - * @brief Attitude data record length, bytes - */ - int get_l_att_data() - { - return _l_att_data; - }; - /** - * @brief Number of radiometric data records - */ - int get_n_radi_data() - { - return _n_radi_data; - }; - /** - * @brief Radiometric data record length, bytes - */ - int get_l_radi_data() - { - return _l_radi_data; - }; - /** - * @brief Number of radiometric compensation records - */ - int get_n_radi_comp() - { - return _n_radi_comp; - }; - /** - * @brief Radiometric compensation record length, bytes - */ - int get_l_radi_comp() - { - return _l_radi_comp; - }; - /** - * @brief Number of data quality summary records - */ - int get_n_qual_sum() - { - return _n_qual_sum; - }; - /** - * @brief Data quality summary record length, bytes - */ - int get_l_qual_sum() - { - return _l_qual_sum; - }; - /** - * @brief Number of data histogram records - */ - int get_n_data_his() - { - return _n_data_his; - }; - /** - * @brief Data histogram record length, bytes - */ - int get_l_data_his() - { - return _l_data_his; - }; - /** - * @brief Number of range spectra records - */ - int get_n_rang_spec() - { - return _n_rang_spec ; - }; - /** - * @brief Range spectra record length, bytes - */ - int get_l_rang_spec() - { - return _l_rang_spec; - }; - /** - * @brief Number of DEM descriptor records - */ - int get_n_dem_desc() - { - return _n_dem_desc; - }; - /** - * @brief DEM desc record length, bytes - */ - int get_l_dem_desc() - { - return _l_dem_desc; - }; - /** - * @brief Number of RADAR par records - */ - int get_n_radar_par() - { - return _n_radar_par; - }; - /** - * @brief RADAR par record length, bytes - */ - int get_l_radar_par() - { - return _l_radar_par; - }; - /** - * @brief Number of annotation data records - */ - int get_n_anno_data() - { - return _n_anno_data; - }; - /** - * @brief Annotation data record length, bytes - */ - int get_l_anno_data() - { - return _l_anno_data; - }; - /** - * @brief Number of processing parameter records - */ - int get_n_det_proc() - { - return _n_det_proc; - }; - /** - * @brief Processing parameter record length, bytes - */ - int get_l_det_proc() - { - return _l_det_proc; - }; - /** - * @brief Number of calibration records - */ - int get_n_cal() - { - return _n_cal; - }; - /** - * @brief Calibration record length, bytes - */ - int get_l_cal() - { - return _l_cal; - }; - /** - * @brief Number of GCP records - */ - int get_n_gcp() - { - return _n_gcp; - }; - /** - * @brief GCP record length, bytes - */ - int get_l_gcp() - { - return _l_gcp; - }; - /** - * @brief Number of facility data records - */ - int get_n_fac_data() - { - return _n_fac_data; - }; - /** - * @brief Fac data record length, bytes - */ - int get_l_fac_data() - { - return _l_fac_data; - }; + { + return _code_len; + }; + /** + * @brief Record length/location flag + */ + std::string get_rec_len() + { + return _rec_len; + }; + /** + * @brief Record lenght location + */ + int get_rlen_loc() + { + return _rlen_loc; + }; + /** + * @brief Record length, bytes + */ + int get_rlen_len() + { + return _rlen_len; + }; + /** + * @brief Number of dataset summ records + */ + int get_n_dataset() + { + return _n_dataset; + }; + /** + * @brief Data set summary record length, bytes + */ + int get_l_dataset() + { + return _l_dataset; + }; + /** + * @brief Number of map proj records + */ + int get_n_map_proj() + { + return _n_map_proj; + }; + /** + * @brief Map projection record length, bytes + */ + int get_l_map_proj() + { + return _l_map_proj; + }; + /** + * @brief Number of platform position records + */ + int get_n_plat_pos() + { + return _n_plat_pos; + }; + /** + * @brief Platform position record length, bytes + */ + int get_l_plat_pos() + { + return _l_plat_pos; + }; + /** + * @brief Number of attitude data records + */ + int get_n_att_data() + { + return _n_att_data; + }; + /** + * @brief Attitude data record length, bytes + */ + int get_l_att_data() + { + return _l_att_data; + }; + /** + * @brief Number of radiometric data records + */ + int get_n_radi_data() + { + return _n_radi_data; + }; + /** + * @brief Radiometric data record length, bytes + */ + int get_l_radi_data() + { + return _l_radi_data; + }; + /** + * @brief Number of radiometric compensation records + */ + int get_n_radi_comp() + { + return _n_radi_comp; + }; + /** + * @brief Radiometric compensation record length, bytes + */ + int get_l_radi_comp() + { + return _l_radi_comp; + }; + /** + * @brief Number of data quality summary records + */ + int get_n_qual_sum() + { + return _n_qual_sum; + }; + /** + * @brief Data quality summary record length, bytes + */ + int get_l_qual_sum() + { + return _l_qual_sum; + }; + /** + * @brief Number of data histogram records + */ + int get_n_data_his() + { + return _n_data_his; + }; + /** + * @brief Data histogram record length, bytes + */ + int get_l_data_his() + { + return _l_data_his; + }; + /** + * @brief Number of range spectra records + */ + int get_n_rang_spec() + { + return _n_rang_spec ; + }; + /** + * @brief Range spectra record length, bytes + */ + int get_l_rang_spec() + { + return _l_rang_spec; + }; + /** + * @brief Number of DEM descriptor records + */ + int get_n_dem_desc() + { + return _n_dem_desc; + }; + /** + * @brief DEM desc record length, bytes + */ + int get_l_dem_desc() + { + return _l_dem_desc; + }; + /** + * @brief Number of RADAR par records + */ + int get_n_radar_par() + { + return _n_radar_par; + }; + /** + * @brief RADAR par record length, bytes + */ + int get_l_radar_par() + { + return _l_radar_par; + }; + /** + * @brief Number of annotation data records + */ + int get_n_anno_data() + { + return _n_anno_data; + }; + /** + * @brief Annotation data record length, bytes + */ + int get_l_anno_data() + { + return _l_anno_data; + }; + /** + * @brief Number of processing parameter records + */ + int get_n_det_proc() + { + return _n_det_proc; + }; + /** + * @brief Processing parameter record length, bytes + */ + int get_l_det_proc() + { + return _l_det_proc; + }; + /** + * @brief Number of calibration records + */ + int get_n_cal() + { + return _n_cal; + }; + /** + * @brief Calibration record length, bytes + */ + int get_l_cal() + { + return _l_cal; + }; + /** + * @brief Number of GCP records + */ + int get_n_gcp() + { + return _n_gcp; + }; + /** + * @brief GCP record length, bytes + */ + int get_l_gcp() + { + return _l_gcp; + }; + /** + * @brief Number of facility data records + */ + int get_n_fac_data() + { + return _n_fac_data; + }; + /** + * @brief Fac data record length, bytes + */ + int get_l_fac_data() + { + return _l_fac_data; + }; protected: - /** - * @brief ASCII flag - */ - std::string _ascii_flag; + /** + * @brief ASCII flag + */ + std::string _ascii_flag; - /** - * @brief Format control documentation - */ - std::string _format_doc; - /** - * @brief Format doc version - */ - std::string _format_ver; - /** - * @brief Format doc revision - */ + /** + * @brief Format control documentation + */ + std::string _format_doc; + /** + * @brief Format doc version + */ + std::string _format_ver; + /** + * @brief Format doc revision + */ std::string _design_rev; - /** - * @brief Software identifier - */ + /** + * @brief Software identifier + */ std::string _software_id; - /** - * @brief File number - */ - int _file_num; - /** - * @brief File name - */ + /** + * @brief File number + */ + int _file_num; + /** + * @brief File name + */ std::string _file_name; - /** - * @brief Record sequence/location flag - */ + /** + * @brief Record sequence/location flag + */ std::string _rec_seq; - /** - * @brief Sequence number location - */ - int _seq_loc; - /** - * @brief Sequence number lenght - */ - int _seq_len; - /** - * @brief Record code/location flag - */ - std::string _rec_code; - /** - * @brief Record code location - */ - int _code_loc; - /** - * @brief Record code length - */ + /** + * @brief Sequence number location + */ + int _seq_loc; + /** + * @brief Sequence number lenght + */ + int _seq_len; + /** + * @brief Record code/location flag + */ + std::string _rec_code; + /** + * @brief Record code location + */ + int _code_loc; + /** + * @brief Record code length + */ int _code_len; - /** - * @brief Record length/location flag - */ - std::string _rec_len; - /** - * @brief Record lenght location - */ - int _rlen_loc; - /** - * @brief Record length, bytes - */ - int _rlen_len; + /** + * @brief Record length/location flag + */ + std::string _rec_len; + /** + * @brief Record lenght location + */ + int _rlen_loc; + /** + * @brief Record length, bytes + */ + int _rlen_len; - /** - * @brief Number of dataset summ records - */ - int _n_dataset; - /** - * @brief Data set summary record length, bytes - */ - int _l_dataset; - /** - * @brief Number of map proj records - */ - int _n_map_proj; - /** - * @brief Map projection record length, bytes - */ - int _l_map_proj; - /** - * @brief Number of platform position records - */ - int _n_plat_pos; - /** - * @brief Platform position record length, bytes - */ - int _l_plat_pos; - /** - * @brief Number of attitude data records - */ - int _n_att_data; - /** - * @brief Attitude data record length, bytes - */ - int _l_att_data; - /** - * @brief Number of radiometric data records - */ - int _n_radi_data; - /** - * @brief Radiometric data record length, bytes - */ - int _l_radi_data; - /** - * @brief Number of radiometric compensation records - */ - int _n_radi_comp; - /** - * @brief Radiometric compensation record length, bytes - */ - int _l_radi_comp; - /** - * @brief Number of data quality summary records - */ - int _n_qual_sum; - /** - * @brief Data quality summary record length, bytes - */ - int _l_qual_sum; - /** - * @brief Number of data histogram records - */ - int _n_data_his; - /** - * @brief Data histogram record length, bytes - */ - int _l_data_his; - /** - * @brief Number of range spectra records - */ - int _n_rang_spec; - /** - * @brief Range spectra record length, bytes - */ - int _l_rang_spec; - /** - * @brief Number of DEM descriptor records - */ - int _n_dem_desc; - /** - * @brief DEM desc record length, bytes - */ - int _l_dem_desc; - /** - * @brief Number of RADAR par records - */ - int _n_radar_par; - /** - * @brief RADAR par record length, bytes - */ - int _l_radar_par; - /** - * @brief Number of annotation data records - */ - int _n_anno_data; - /** - * @brief Annotation data record length, bytes - */ - int _l_anno_data; - /** - * @brief Number of processing parameter records - */ - int _n_det_proc; - /** - * @brief Processing parameter record length, bytes - */ - int _l_det_proc; - /** - * @brief Number of calibration records - */ - int _n_cal; - /** - * @brief Calibration record length, bytes - */ - int _l_cal; - /** - * @brief Number of GCP records - */ - int _n_gcp; - /** - * @brief GCP record length, bytes - */ - int _l_gcp; + /** + * @brief Number of dataset summ records + */ + int _n_dataset; + /** + * @brief Data set summary record length, bytes + */ + int _l_dataset; + /** + * @brief Number of map proj records + */ + int _n_map_proj; + /** + * @brief Map projection record length, bytes + */ + int _l_map_proj; + /** + * @brief Number of platform position records + */ + int _n_plat_pos; + /** + * @brief Platform position record length, bytes + */ + int _l_plat_pos; + /** + * @brief Number of attitude data records + */ + int _n_att_data; + /** + * @brief Attitude data record length, bytes + */ + int _l_att_data; + /** + * @brief Number of radiometric data records + */ + int _n_radi_data; + /** + * @brief Radiometric data record length, bytes + */ + int _l_radi_data; + /** + * @brief Number of radiometric compensation records + */ + int _n_radi_comp; + /** + * @brief Radiometric compensation record length, bytes + */ + int _l_radi_comp; + /** + * @brief Number of data quality summary records + */ + int _n_qual_sum; + /** + * @brief Data quality summary record length, bytes + */ + int _l_qual_sum; + /** + * @brief Number of data histogram records + */ + int _n_data_his; + /** + * @brief Data histogram record length, bytes + */ + int _l_data_his; + /** + * @brief Number of range spectra records + */ + int _n_rang_spec; + /** + * @brief Range spectra record length, bytes + */ + int _l_rang_spec; + /** + * @brief Number of DEM descriptor records + */ + int _n_dem_desc; + /** + * @brief DEM desc record length, bytes + */ + int _l_dem_desc; + /** + * @brief Number of RADAR par records + */ + int _n_radar_par; + /** + * @brief RADAR par record length, bytes + */ + int _l_radar_par; + /** + * @brief Number of annotation data records + */ + int _n_anno_data; + /** + * @brief Annotation data record length, bytes + */ + int _l_anno_data; + /** + * @brief Number of processing parameter records + */ + int _n_det_proc; + /** + * @brief Processing parameter record length, bytes + */ + int _l_det_proc; + /** + * @brief Number of calibration records + */ + int _n_cal; + /** + * @brief Calibration record length, bytes + */ + int _l_cal; + /** + * @brief Number of GCP records + */ + int _n_gcp; + /** + * @brief GCP record length, bytes + */ + int _l_gcp; - /** - * @brief Number of facility data records - */ - int _n_fac_data; - /** - * @brief Fac data record length, bytes - */ - int _l_fac_data; + /** + * @brief Number of facility data records + */ + int _n_fac_data; + /** + * @brief Fac data record length, bytes + */ + int _l_fac_data; private: }; diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.cpp index 4e87d38fa2dc6d0997850cf0423218f006fa5646..4a55919bc76328677547646626a3493d7293db8c 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.cpp @@ -33,88 +33,88 @@ ErsSarLeader::ErsSarLeader() ErsSarLeader::~ErsSarLeader() { - ClearRecords(); + ClearRecords(); } std::ostream& operator<<(std::ostream& os, const ErsSarLeader& data) { - std::map<int, ErsSarRecord*>::const_iterator it = data._records.begin(); - while(it != data._records.end()) - { - (*it).second->Write(os); - ++it; - } - return os; + std::map<int, ErsSarRecord*>::const_iterator it = data._records.begin(); + while(it != data._records.end()) + { + (*it).second->Write(os); + ++it; + } + return os; } std::istream& operator>>(std::istream& is, ErsSarLeader& data) { - ErsSarLeaderFactory factory; - - data.ClearRecords(); - - ErsSarRecordHeader header; - bool eof = false; - while(!eof) - { - is>>header; - if(is.eof()) - { - eof = true; - } - else - { - ErsSarRecord* record = factory.Instanciate(header.get_rec_seq()); - if (record != NULL) - { - record->Read(is); - data._records[header.get_rec_seq()] = record; - } - else - { - char* buff = new char[header.get_length()-12]; - is.read(buff, header.get_length()-12); - delete buff; - } - } - } - return is; + ErsSarLeaderFactory factory; + + data.ClearRecords(); + + ErsSarRecordHeader header; + bool eof = false; + while(!eof) + { + is>>header; + if(is.eof()) + { + eof = true; + } + else + { + ErsSarRecord* record = factory.Instanciate(header.get_rec_seq()); + if (record != NULL) + { + record->Read(is); + data._records[header.get_rec_seq()] = record; + } + else + { + char* buff = new char[header.get_length()-12]; + is.read(buff, header.get_length()-12); + delete buff; + } + } + } + return is; } ErsSarLeader::ErsSarLeader(const ErsSarLeader& rhs) { - std::map<int, ErsSarRecord*>::const_iterator it = rhs._records.begin(); - while(it != rhs._records.end()) - { - _records[(*it).first] = (*it).second->Clone(); - ++it; - } + std::map<int, ErsSarRecord*>::const_iterator it = rhs._records.begin(); + while(it != rhs._records.end()) + { + _records[(*it).first] = (*it).second->Clone(); + ++it; + } } ErsSarLeader& ErsSarLeader::operator=(const ErsSarLeader& rhs) { - ClearRecords(); - std::map<int, ErsSarRecord*>::const_iterator it = rhs._records.begin(); - while(it != rhs._records.end()) - { - _records[(*it).first] = (*it).second->Clone(); - ++it; - } - - return *this; + ClearRecords(); + std::map<int, ErsSarRecord*>::const_iterator it = rhs._records.begin(); + while(it != rhs._records.end()) + { + _records[(*it).first] = (*it).second->Clone(); + ++it; + } + + return *this; } void ErsSarLeader::ClearRecords() { - std::map<int, ErsSarRecord*>::const_iterator it = _records.begin(); - while(it != _records.end()) - { - delete (*it).second; - ++it; - } - _records.clear(); + std::map<int, ErsSarRecord*>::const_iterator it = _records.begin(); + while(it != _records.end()) + { + delete (*it).second; + ++it; + } + _records.clear(); } bool ErsSarLeader::saveState(ossimKeywordlist& kwl, @@ -131,119 +131,119 @@ bool ErsSarLeader::saveState(ossimKeywordlist& kwl, bool result = true; - char name[64]; - - kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true); - /* - * Adding metadata necessary to the sensor model in the keywordlist - */ - ErsSarFileDescriptor *leaderfiledesc = get_ErsSarFileDescriptor(); - if (leaderfiledesc != NULL) - { - kwl.add(prefix, "filename",leaderfiledesc->get_file_name().c_str(),true); - } - else - { - result = false; + char name[64]; + + kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true); + /* + * Adding metadata necessary to the sensor model in the keywordlist + */ + ErsSarFileDescriptor *leaderfiledesc = get_ErsSarFileDescriptor(); + if (leaderfiledesc != NULL) + { + kwl.add(prefix, "filename",leaderfiledesc->get_file_name().c_str(),true); + } + else + { + result = false; } - /* - * Adding metadata necessary to the sensor model in the keywordlist - */ - ErsSarDataSetSummary *datasetSummary = get_ErsSarDataSetSummary(); - if ( (datasetSummary != NULL) && (result == true) ) - { - kwl.add(prefix, "inp_sctim",(datasetSummary->get_inp_sctim()).c_str(),true); - kwl.add(prefix, "ellip_maj", datasetSummary->get_ellip_maj(),true); - kwl.add(prefix, "ellip_min", datasetSummary->get_ellip_min(),true); - kwl.add(prefix, "sc_lin", datasetSummary->get_sc_lin(),true); - kwl.add(prefix, "sc_pix", datasetSummary->get_sc_pix(),true); - kwl.add(prefix, "wave_length", datasetSummary->get_wave_length(),true); - kwl.add(prefix, "fr", datasetSummary->get_fr(),true); - kwl.add(prefix, "fa", datasetSummary->get_fa(),true); - kwl.add(prefix, "time_dir_pix", (datasetSummary->get_time_dir_pix()).c_str(),true); - kwl.add(prefix, "time_dir_lin", (datasetSummary->get_time_dir_lin()).c_str(),true); - kwl.add(prefix, "line_spacing", datasetSummary->get_line_spacing(),true); - kwl.add(prefix, "pix_spacing", datasetSummary->get_pix_spacing(),true); - kwl.add(prefix, "nlooks_az", datasetSummary->get_n_azilok(),true); - kwl.add(prefix, "n_rnglok", datasetSummary->get_n_rnglok(),true); - kwl.add(prefix, "zero_dop_range_time_f_pixel", datasetSummary->get_zero_dop_range_time_f_pixel(),true); - kwl.add(prefix, "zero_dop_range_time_c_pixel", datasetSummary->get_zero_dop_range_time_c_pixel(),true); - kwl.add(prefix, "zero_dop_range_time_l_pixel", datasetSummary->get_zero_dop_range_time_l_pixel(),true); - } - else - { - result = false; - } - - ErsSarMapProjectionData *mapprojectiondata = get_ErsSarMapProjectionData(); - if ( (mapprojectiondata != NULL) && (result == true) ) - { - kwl.add(prefix, "map_proj_des",(mapprojectiondata->get_map_proj_des()).c_str(),true); - kwl.add(prefix, "num_lines",(double) mapprojectiondata->get_num_lines(),true); - kwl.add(prefix, "num_pix",(double) mapprojectiondata->get_num_pix_in_line(),true); - kwl.add(prefix, "first_line_first_pixel_lat",mapprojectiondata->get_first_line_first_pixel_lat(), true); - kwl.add(prefix, "first_line_first_pixel_lon",mapprojectiondata->get_first_line_first_pixel_lon(), true); - kwl.add(prefix, "first_line_last_pixel_lat",mapprojectiondata->get_first_line_last_pixel_lat(), true); - kwl.add(prefix, "first_line_last_pixel_lon",mapprojectiondata->get_first_line_last_pixel_lon(), true); - kwl.add(prefix, "last_line_first_pixel_lat",mapprojectiondata->get_last_line_first_pixel_lat(), true); - kwl.add(prefix, "last_line_first_pixel_lon",mapprojectiondata->get_last_line_first_pixel_lon(), true); - kwl.add(prefix, "last_line_last_pixel_lat",mapprojectiondata->get_last_line_last_pixel_lat(), true); - kwl.add(prefix, "last_line_last_pixel_lon",mapprojectiondata->get_last_line_last_pixel_lon(), true); - } - else - { - result = false; - } - - ErsSarPlatformPositionData *platformposition = get_ErsSarPlatformPositionData(); - if ( (mapprojectiondata != NULL) && (result == true) ) - { - kwl.add(prefix, "neph", platformposition->get_ndata(),true); - kwl.add(prefix, "eph_year", platformposition->get_year(),true); - kwl.add(prefix, "eph_month", platformposition->get_month(),true); - kwl.add(prefix, "eph_day", platformposition->get_day(),true); - kwl.add(prefix, "eph_gmt_day", platformposition->get_gmt_day(),true); - kwl.add(prefix, "eph_sec", platformposition->get_gmt_sec(),true); - kwl.add(prefix, "eph_hr_angle", platformposition->get_hr_angle(),true); - kwl.add(prefix, "eph_int", platformposition->get_data_int(),true); - - for (int i=0;i<platformposition->get_ndata();i++) - { - sprintf(name,"eph%i_posX",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[0],true); - sprintf(name,"eph%i_posY",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[1],true); - sprintf(name,"eph%i_posZ",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[2],true); - - sprintf(name,"eph%i_velX",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[0],true); - sprintf(name,"eph%i_velY",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[1],true); - sprintf(name,"eph%i_velZ",i); - kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[2],true); - } - } - else - { - result = false; - } - /* - * Adding metadata necessary to the sensor model in the keywordlist - */ - ErsSarFacilityData *facilitydata = get_ErsSarFacilityData(); - if ( (facilitydata != NULL) && (result == true) ) - { - kwl.add(prefix, "coef_ground_range_1",facilitydata->get_coef_ground_range_1(),true); - kwl.add(prefix, "coef_ground_range_2",facilitydata->get_coef_ground_range_2(),true); - kwl.add(prefix, "coef_ground_range_3",facilitydata->get_coef_ground_range_3(),true); - kwl.add(prefix, "coef_ground_range_4",facilitydata->get_coef_ground_range_4(),true); - } - else - { - result = false; - } + /* + * Adding metadata necessary to the sensor model in the keywordlist + */ + ErsSarDataSetSummary *datasetSummary = get_ErsSarDataSetSummary(); + if ( (datasetSummary != NULL) && (result == true) ) + { + kwl.add(prefix, "inp_sctim",(datasetSummary->get_inp_sctim()).c_str(),true); + kwl.add(prefix, "ellip_maj", datasetSummary->get_ellip_maj(),true); + kwl.add(prefix, "ellip_min", datasetSummary->get_ellip_min(),true); + kwl.add(prefix, "sc_lin", datasetSummary->get_sc_lin(),true); + kwl.add(prefix, "sc_pix", datasetSummary->get_sc_pix(),true); + kwl.add(prefix, "wave_length", datasetSummary->get_wave_length(),true); + kwl.add(prefix, "fr", datasetSummary->get_fr(),true); + kwl.add(prefix, "fa", datasetSummary->get_fa(),true); + kwl.add(prefix, "time_dir_pix", (datasetSummary->get_time_dir_pix()).c_str(),true); + kwl.add(prefix, "time_dir_lin", (datasetSummary->get_time_dir_lin()).c_str(),true); + kwl.add(prefix, "line_spacing", datasetSummary->get_line_spacing(),true); + kwl.add(prefix, "pix_spacing", datasetSummary->get_pix_spacing(),true); + kwl.add(prefix, "nlooks_az", datasetSummary->get_n_azilok(),true); + kwl.add(prefix, "n_rnglok", datasetSummary->get_n_rnglok(),true); + kwl.add(prefix, "zero_dop_range_time_f_pixel", datasetSummary->get_zero_dop_range_time_f_pixel(),true); + kwl.add(prefix, "zero_dop_range_time_c_pixel", datasetSummary->get_zero_dop_range_time_c_pixel(),true); + kwl.add(prefix, "zero_dop_range_time_l_pixel", datasetSummary->get_zero_dop_range_time_l_pixel(),true); + } + else + { + result = false; + } + + ErsSarMapProjectionData *mapprojectiondata = get_ErsSarMapProjectionData(); + if ( (mapprojectiondata != NULL) && (result == true) ) + { + kwl.add(prefix, "map_proj_des",(mapprojectiondata->get_map_proj_des()).c_str(),true); + kwl.add(prefix, "num_lines",(double) mapprojectiondata->get_num_lines(),true); + kwl.add(prefix, "num_pix",(double) mapprojectiondata->get_num_pix_in_line(),true); + kwl.add(prefix, "first_line_first_pixel_lat",mapprojectiondata->get_first_line_first_pixel_lat(), true); + kwl.add(prefix, "first_line_first_pixel_lon",mapprojectiondata->get_first_line_first_pixel_lon(), true); + kwl.add(prefix, "first_line_last_pixel_lat",mapprojectiondata->get_first_line_last_pixel_lat(), true); + kwl.add(prefix, "first_line_last_pixel_lon",mapprojectiondata->get_first_line_last_pixel_lon(), true); + kwl.add(prefix, "last_line_first_pixel_lat",mapprojectiondata->get_last_line_first_pixel_lat(), true); + kwl.add(prefix, "last_line_first_pixel_lon",mapprojectiondata->get_last_line_first_pixel_lon(), true); + kwl.add(prefix, "last_line_last_pixel_lat",mapprojectiondata->get_last_line_last_pixel_lat(), true); + kwl.add(prefix, "last_line_last_pixel_lon",mapprojectiondata->get_last_line_last_pixel_lon(), true); + } + else + { + result = false; + } + + ErsSarPlatformPositionData *platformposition = get_ErsSarPlatformPositionData(); + if ( (mapprojectiondata != NULL) && (result == true) ) + { + kwl.add(prefix, "neph", platformposition->get_ndata(),true); + kwl.add(prefix, "eph_year", platformposition->get_year(),true); + kwl.add(prefix, "eph_month", platformposition->get_month(),true); + kwl.add(prefix, "eph_day", platformposition->get_day(),true); + kwl.add(prefix, "eph_gmt_day", platformposition->get_gmt_day(),true); + kwl.add(prefix, "eph_sec", platformposition->get_gmt_sec(),true); + kwl.add(prefix, "eph_hr_angle", platformposition->get_hr_angle(),true); + kwl.add(prefix, "eph_int", platformposition->get_data_int(),true); + + for (int i=0;i<platformposition->get_ndata();i++) + { + sprintf(name,"eph%i_posX",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[0],true); + sprintf(name,"eph%i_posY",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[1],true); + sprintf(name,"eph%i_posZ",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_pos()[2],true); + + sprintf(name,"eph%i_velX",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[0],true); + sprintf(name,"eph%i_velY",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[1],true); + sprintf(name,"eph%i_velZ",i); + kwl.add(prefix, name,(platformposition->get_pos_vect()[i]).get_vel()[2],true); + } + } + else + { + result = false; + } + /* + * Adding metadata necessary to the sensor model in the keywordlist + */ + ErsSarFacilityData *facilitydata = get_ErsSarFacilityData(); + if ( (facilitydata != NULL) && (result == true) ) + { + kwl.add(prefix, "coef_ground_range_1",facilitydata->get_coef_ground_range_1(),true); + kwl.add(prefix, "coef_ground_range_2",facilitydata->get_coef_ground_range_2(),true); + kwl.add(prefix, "coef_ground_range_3",facilitydata->get_coef_ground_range_3(),true); + kwl.add(prefix, "coef_ground_range_4",facilitydata->get_coef_ground_range_4(),true); + } + else + { + result = false; + } /* if (traceDebug()) @@ -260,24 +260,24 @@ bool ErsSarLeader::saveState(ossimKeywordlist& kwl, ErsSarFacilityData * ErsSarLeader::get_ErsSarFacilityData() const { - return (ErsSarFacilityData*)_records[ErsSarFacilityDataID]; + return (ErsSarFacilityData*)_records[ErsSarFacilityDataID]; } ErsSarPlatformPositionData * ErsSarLeader::get_ErsSarPlatformPositionData() const { - return (ErsSarPlatformPositionData*)_records[ErsSarPlatformPositionDataID]; + return (ErsSarPlatformPositionData*)_records[ErsSarPlatformPositionDataID]; } ErsSarMapProjectionData * ErsSarLeader::get_ErsSarMapProjectionData() const { - return (ErsSarMapProjectionData*)_records[ErsSarMapProjectionDataID]; + return (ErsSarMapProjectionData*)_records[ErsSarMapProjectionDataID]; } ErsSarDataSetSummary * ErsSarLeader::get_ErsSarDataSetSummary() const { - return (ErsSarDataSetSummary*)_records[ErsSarDataSetSummaryID]; + return (ErsSarDataSetSummary*)_records[ErsSarDataSetSummaryID]; } ErsSarFileDescriptor * ErsSarLeader::get_ErsSarFileDescriptor() const { - return static_cast<ErsSarFileDescriptor*>(_records[ErsSarFileDescriptorID]); + return static_cast<ErsSarFileDescriptor*>(_records[ErsSarFileDescriptorID]); } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.h index 49e6d33578ee8997451322d468e965a056d1362e..6ea4dfb697c76b02d47effc8931a64c067c16c68 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeader.h @@ -40,40 +40,40 @@ class ErsSarFacilityData; class ErsSarLeader { public: - /** - * @brief Constructor - */ - ErsSarLeader(); - - /** - * @brief Destructor - */ - ~ErsSarLeader(); - - /** - * @brief This function write the ErsSarLeader in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarLeader& data); - - /** - * @brief This function read a ErsSarLeader from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarLeader& data); - - /** - * @brief Copy constructor - */ - ErsSarLeader(const ErsSarLeader& rhs); - - /** - * @brief Copy operator - */ - ErsSarLeader& operator=(const ErsSarLeader& rhs); - - /** - * @brief Remove all the previous records from the ErsSarLeader - */ - void ClearRecords(); + /** + * @brief Constructor + */ + ErsSarLeader(); + + /** + * @brief Destructor + */ + ~ErsSarLeader(); + + /** + * @brief This function write the ErsSarLeader in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarLeader& data); + + /** + * @brief This function read a ErsSarLeader from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarLeader& data); + + /** + * @brief Copy constructor + */ + ErsSarLeader(const ErsSarLeader& rhs); + + /** + * @brief Copy operator + */ + ErsSarLeader& operator=(const ErsSarLeader& rhs); + + /** + * @brief Remove all the previous records from the ErsSarLeader + */ + void ClearRecords(); /** * @brief Method to save object state to a keyword list. @@ -84,22 +84,22 @@ public: virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const; - ErsSarFacilityData * get_ErsSarFacilityData() const; - ErsSarPlatformPositionData * get_ErsSarPlatformPositionData() const; - ErsSarMapProjectionData * get_ErsSarMapProjectionData() const; - ErsSarDataSetSummary * get_ErsSarDataSetSummary() const; - ErsSarFileDescriptor * get_ErsSarFileDescriptor() const; + ErsSarFacilityData * get_ErsSarFacilityData() const; + ErsSarPlatformPositionData * get_ErsSarPlatformPositionData() const; + ErsSarMapProjectionData * get_ErsSarMapProjectionData() const; + ErsSarDataSetSummary * get_ErsSarDataSetSummary() const; + ErsSarFileDescriptor * get_ErsSarFileDescriptor() const; protected: // Made mutable because the get_* methods need to access it. // (modifying the definition of the map might be another solution) - mutable std::map<int, ErsSarRecord*> _records; + mutable std::map<int, ErsSarRecord*> _records; - static const int ErsSarFacilityDataID; - static const int ErsSarPlatformPositionDataID; - static const int ErsSarMapProjectionDataID; - static const int ErsSarDataSetSummaryID; - static const int ErsSarFileDescriptorID; + static const int ErsSarFacilityDataID; + static const int ErsSarPlatformPositionDataID; + static const int ErsSarMapProjectionDataID; + static const int ErsSarDataSetSummaryID; + static const int ErsSarFileDescriptorID; private: }; diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.cpp index 02dfb3938cc323ea35e029a0155089b5a2f530cf..c6e9e5db37c532197cc11e6ee6ad55f89fa5cf56 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.cpp @@ -22,11 +22,11 @@ namespace ossimplugins ErsSarLeaderFactory::ErsSarLeaderFactory() { - RegisterRecord(5, new ErsSarFacilityData()); - RegisterRecord(4, new ErsSarPlatformPositionData()); - RegisterRecord(3, new ErsSarMapProjectionData()); - RegisterRecord(2, new ErsSarDataSetSummary()); - RegisterRecord(1, new ErsSarFileDescriptor()); + RegisterRecord(5, new ErsSarFacilityData()); + RegisterRecord(4, new ErsSarPlatformPositionData()); + RegisterRecord(3, new ErsSarMapProjectionData()); + RegisterRecord(2, new ErsSarDataSetSummary()); + RegisterRecord(1, new ErsSarFileDescriptor()); } ErsSarLeaderFactory::~ErsSarLeaderFactory() diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.h index 658926f69c0afab8636e1c13dd76476e9cc118db..e9707b84b953ffbe6ff6e9eaa0d26be088c4eb70 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarLeaderFactory.h @@ -28,14 +28,14 @@ namespace ossimplugins class ErsSarLeaderFactory : public ErsSarRecordFactory { public: - /** - * @brief Contstructor - */ - ErsSarLeaderFactory(); - /** - * @brief Destructor - */ - ~ErsSarLeaderFactory(); + /** + * @brief Contstructor + */ + ErsSarLeaderFactory(); + /** + * @brief Destructor + */ + ~ErsSarLeaderFactory(); protected: diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.cpp index a5f1884b149d9841e5ab5718b48a1810b7ac4496..05d5c4eff4ce097ce1c5f71776646c626a3395cd 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.cpp @@ -24,186 +24,186 @@ ErsSarMapProjectionData::~ErsSarMapProjectionData() std::ostream& operator<<(std::ostream& os, const ErsSarMapProjectionData& data) { - os<<"map_proj_des:"<<data._map_proj_des.c_str()<<std::endl; + os<<"map_proj_des:"<<data._map_proj_des.c_str()<<std::endl; - os<<"num_pix_in_line:"<<data._num_pix_in_line<<std::endl; + os<<"num_pix_in_line:"<<data._num_pix_in_line<<std::endl; - os<<"num_lines:"<<data._num_lines<<std::endl; + os<<"num_lines:"<<data._num_lines<<std::endl; - os<<"nom_interpixel_dist:"<<data._nom_interpixel_dist<<std::endl; + os<<"nom_interpixel_dist:"<<data._nom_interpixel_dist<<std::endl; - os<<"nom_interline_dist:"<<data._nom_interline_dist<<std::endl; + os<<"nom_interline_dist:"<<data._nom_interline_dist<<std::endl; - os<<"orientation_at_center:"<<data._orientation_at_center<<std::endl; + os<<"orientation_at_center:"<<data._orientation_at_center<<std::endl; - os<<"orbit_incl:"<<data._orbit_incl<<std::endl; + os<<"orbit_incl:"<<data._orbit_incl<<std::endl; - os<<"asc_node_long:"<<data._asc_node_long<<std::endl; + os<<"asc_node_long:"<<data._asc_node_long<<std::endl; - os<<"platform_heading:"<<data._platform_heading<<std::endl; + os<<"platform_heading:"<<data._platform_heading<<std::endl; - os<<"name_of_ref_ellipsoid:"<<data._name_of_ref_ellipsoid.c_str()<<std::endl; + os<<"name_of_ref_ellipsoid:"<<data._name_of_ref_ellipsoid.c_str()<<std::endl; - os<<"semi_maj_axis:"<<data._semi_maj_axis<<std::endl; + os<<"semi_maj_axis:"<<data._semi_maj_axis<<std::endl; - os<<"semi_min_axis:"<<data._semi_min_axis<<std::endl; + os<<"semi_min_axis:"<<data._semi_min_axis<<std::endl; - os<<"first_line_first_pixel_lat:"<<data._first_line_first_pixel_lat<<std::endl; + os<<"first_line_first_pixel_lat:"<<data._first_line_first_pixel_lat<<std::endl; - os<<"first_line_first_pixel_lon:"<<data._first_line_first_pixel_lon<<std::endl; + os<<"first_line_first_pixel_lon:"<<data._first_line_first_pixel_lon<<std::endl; - os<<"first_line_last_pixel_lat:"<<data._first_line_last_pixel_lat<<std::endl; + os<<"first_line_last_pixel_lat:"<<data._first_line_last_pixel_lat<<std::endl; - os<<"first_line_last_pixel_lon:"<<data._first_line_last_pixel_lon<<std::endl; + os<<"first_line_last_pixel_lon:"<<data._first_line_last_pixel_lon<<std::endl; - os<<"last_line_last_pixel_lat:"<<data._last_line_last_pixel_lat<<std::endl; + os<<"last_line_last_pixel_lat:"<<data._last_line_last_pixel_lat<<std::endl; - os<<"last_line_last_pixel_lon:"<<data._last_line_last_pixel_lon<<std::endl; + os<<"last_line_last_pixel_lon:"<<data._last_line_last_pixel_lon<<std::endl; - os<<"last_line_first_pixel_lat:"<<data._last_line_first_pixel_lat<<std::endl; + os<<"last_line_first_pixel_lat:"<<data._last_line_first_pixel_lat<<std::endl; - os<<"last_line_first_pixel_lon:"<<data._last_line_first_pixel_lon<<std::endl; + os<<"last_line_first_pixel_lon:"<<data._last_line_first_pixel_lon<<std::endl; - return os; + return os; } std::istream& operator>>(std::istream& is, ErsSarMapProjectionData& data) { - char buf16[17]; - buf16[16]='\0'; - char buf32[33]; - buf32[32] = '\0'; - char buf8[9]; - buf8[8] = '\0'; - char buf4[5]; - buf4[4] = '\0'; + char buf16[17]; + buf16[16]='\0'; + char buf32[33]; + buf32[32] = '\0'; + char buf8[9]; + buf8[8] = '\0'; + char buf4[5]; + buf4[4] = '\0'; - is.read(buf16,16); + is.read(buf16,16); - is.read(buf32,32); - data._map_proj_des = buf32; + is.read(buf32,32); + data._map_proj_des = buf32; - is.read(buf16,16); - data._num_pix_in_line = atoi(buf16); + is.read(buf16,16); + data._num_pix_in_line = atoi(buf16); - is.read(buf16,16 ); - data._num_lines = atoi(buf16); + is.read(buf16,16 ); + data._num_lines = atoi(buf16); - is.read(buf16,16); - data._nom_interpixel_dist = atof(buf16); + is.read(buf16,16); + data._nom_interpixel_dist = atof(buf16); - is.read(buf16,16); - data._nom_interline_dist = atof(buf16); + is.read(buf16,16); + data._nom_interline_dist = atof(buf16); - is.read(buf16,16); - data._orientation_at_center = atof(buf16); + is.read(buf16,16); + data._orientation_at_center = atof(buf16); - is.read(buf16,16); - data._orbit_incl = atof(buf16); + is.read(buf16,16); + data._orbit_incl = atof(buf16); - is.read(buf16,16); - data._asc_node_long = atof(buf16); + is.read(buf16,16); + data._asc_node_long = atof(buf16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf16,16); + is.read(buf16,16); - is.read(buf16,16); - data._platform_heading = atof(buf16); + is.read(buf16,16); + data._platform_heading = atof(buf16); - is.read(buf32,32); - data._name_of_ref_ellipsoid = buf32; + is.read(buf32,32); + data._name_of_ref_ellipsoid = buf32; - is.read(buf16,16); - data._semi_maj_axis = atof(buf16); + is.read(buf16,16); + data._semi_maj_axis = atof(buf16); - is.read(buf16,16); - data._semi_min_axis = atof(buf16); + is.read(buf16,16); + data._semi_min_axis = atof(buf16); - char buf772[772]; - is.read(buf772,772); + char buf772[772]; + is.read(buf772,772); - is.read(buf16,16); - data._first_line_first_pixel_lat = atof(buf16); + is.read(buf16,16); + data._first_line_first_pixel_lat = atof(buf16); - is.read(buf16,16); - data._first_line_first_pixel_lon = atof(buf16); + is.read(buf16,16); + data._first_line_first_pixel_lon = atof(buf16); - is.read(buf16,16); - data._first_line_last_pixel_lat = atof(buf16); + is.read(buf16,16); + data._first_line_last_pixel_lat = atof(buf16); - is.read(buf16,16); - data._first_line_last_pixel_lon = atof(buf16); + is.read(buf16,16); + data._first_line_last_pixel_lon = atof(buf16); - is.read(buf16,16); - data._last_line_last_pixel_lat = atof(buf16); + is.read(buf16,16); + data._last_line_last_pixel_lat = atof(buf16); - is.read(buf16,16); - data._last_line_last_pixel_lon = atof(buf16); + is.read(buf16,16); + data._last_line_last_pixel_lon = atof(buf16); - is.read(buf16,16); - data._last_line_first_pixel_lat = atof(buf16); + is.read(buf16,16); + data._last_line_first_pixel_lat = atof(buf16); - is.read(buf16,16); - data._last_line_first_pixel_lon = atof(buf16); + is.read(buf16,16); + data._last_line_first_pixel_lon = atof(buf16); - char buf420[420]; - is.read(buf420,420); + char buf420[420]; + is.read(buf420,420); - return is; + return is; } ErsSarMapProjectionData::ErsSarMapProjectionData(const ErsSarMapProjectionData& rhs): - ErsSarRecord(rhs), - _map_proj_des(rhs._map_proj_des), - _num_pix_in_line(rhs._num_pix_in_line), - _num_lines(rhs._num_lines), - _nom_interpixel_dist(rhs._nom_interpixel_dist), - _nom_interline_dist(rhs._nom_interline_dist), - _orientation_at_center(rhs._orientation_at_center), - _orbit_incl(rhs._orbit_incl), - _asc_node_long(rhs._asc_node_long), - _platform_heading(rhs._platform_heading), - _name_of_ref_ellipsoid(rhs._name_of_ref_ellipsoid), - _semi_maj_axis(rhs._semi_maj_axis), - _semi_min_axis(rhs._semi_min_axis), - _first_line_first_pixel_lat(rhs._first_line_first_pixel_lat), - _first_line_first_pixel_lon(rhs._first_line_first_pixel_lon), - _first_line_last_pixel_lat(rhs._first_line_last_pixel_lat), - _first_line_last_pixel_lon(rhs._first_line_last_pixel_lon), - _last_line_last_pixel_lat(rhs._last_line_last_pixel_lat), - _last_line_last_pixel_lon(rhs._last_line_last_pixel_lon), - _last_line_first_pixel_lat(rhs._last_line_first_pixel_lat), - _last_line_first_pixel_lon(rhs._last_line_first_pixel_lon) - {} + ErsSarRecord(rhs), + _map_proj_des(rhs._map_proj_des), + _num_pix_in_line(rhs._num_pix_in_line), + _num_lines(rhs._num_lines), + _nom_interpixel_dist(rhs._nom_interpixel_dist), + _nom_interline_dist(rhs._nom_interline_dist), + _orientation_at_center(rhs._orientation_at_center), + _orbit_incl(rhs._orbit_incl), + _asc_node_long(rhs._asc_node_long), + _platform_heading(rhs._platform_heading), + _name_of_ref_ellipsoid(rhs._name_of_ref_ellipsoid), + _semi_maj_axis(rhs._semi_maj_axis), + _semi_min_axis(rhs._semi_min_axis), + _first_line_first_pixel_lat(rhs._first_line_first_pixel_lat), + _first_line_first_pixel_lon(rhs._first_line_first_pixel_lon), + _first_line_last_pixel_lat(rhs._first_line_last_pixel_lat), + _first_line_last_pixel_lon(rhs._first_line_last_pixel_lon), + _last_line_last_pixel_lat(rhs._last_line_last_pixel_lat), + _last_line_last_pixel_lon(rhs._last_line_last_pixel_lon), + _last_line_first_pixel_lat(rhs._last_line_first_pixel_lat), + _last_line_first_pixel_lon(rhs._last_line_first_pixel_lon) + {} ErsSarMapProjectionData& ErsSarMapProjectionData::operator=(const ErsSarMapProjectionData& rhs) { - _map_proj_des = rhs._map_proj_des; - _num_pix_in_line = rhs._num_pix_in_line; - _num_lines = rhs._num_lines; - _nom_interpixel_dist = rhs._nom_interpixel_dist; - _nom_interline_dist = rhs._nom_interline_dist; - _orientation_at_center = rhs._orientation_at_center; - _orbit_incl = rhs._orbit_incl; - _asc_node_long = rhs._asc_node_long; - _platform_heading = rhs._platform_heading; - _name_of_ref_ellipsoid = rhs._name_of_ref_ellipsoid; - _semi_maj_axis = rhs._semi_maj_axis; - _semi_min_axis = rhs._semi_min_axis; - _first_line_first_pixel_lat = rhs._first_line_first_pixel_lat; - _first_line_first_pixel_lon = rhs._first_line_first_pixel_lon; - _first_line_last_pixel_lat = rhs._first_line_last_pixel_lat; - _first_line_last_pixel_lon = rhs._first_line_last_pixel_lon; - _last_line_last_pixel_lat = rhs._last_line_last_pixel_lat; - _last_line_last_pixel_lon = rhs._last_line_last_pixel_lon; - _last_line_first_pixel_lat = rhs._last_line_first_pixel_lat; - _last_line_first_pixel_lon = rhs._last_line_first_pixel_lon; - - return *this; + _map_proj_des = rhs._map_proj_des; + _num_pix_in_line = rhs._num_pix_in_line; + _num_lines = rhs._num_lines; + _nom_interpixel_dist = rhs._nom_interpixel_dist; + _nom_interline_dist = rhs._nom_interline_dist; + _orientation_at_center = rhs._orientation_at_center; + _orbit_incl = rhs._orbit_incl; + _asc_node_long = rhs._asc_node_long; + _platform_heading = rhs._platform_heading; + _name_of_ref_ellipsoid = rhs._name_of_ref_ellipsoid; + _semi_maj_axis = rhs._semi_maj_axis; + _semi_min_axis = rhs._semi_min_axis; + _first_line_first_pixel_lat = rhs._first_line_first_pixel_lat; + _first_line_first_pixel_lon = rhs._first_line_first_pixel_lon; + _first_line_last_pixel_lat = rhs._first_line_last_pixel_lat; + _first_line_last_pixel_lon = rhs._first_line_last_pixel_lon; + _last_line_last_pixel_lat = rhs._last_line_last_pixel_lat; + _last_line_last_pixel_lon = rhs._last_line_last_pixel_lon; + _last_line_first_pixel_lat = rhs._last_line_first_pixel_lat; + _last_line_first_pixel_lon = rhs._last_line_first_pixel_lon; + + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.h index f0fbe8448592823652c4dd48e7a8963f2899f199..de6e13cb02cbd5cfcdfa09fa0895edb277b372d2 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarMapProjectionData.h @@ -29,290 +29,290 @@ namespace ossimplugins class ErsSarMapProjectionData : public ErsSarRecord { public: - /** - * @brief Constructor - */ - ErsSarMapProjectionData(); + /** + * @brief Constructor + */ + ErsSarMapProjectionData(); - /** - * @brief Destructor - */ - ~ErsSarMapProjectionData(); + /** + * @brief Destructor + */ + ~ErsSarMapProjectionData(); - /** - * @brief This function write the ErsSarMapProjectionData in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarMapProjectionData& data); + /** + * @brief This function write the ErsSarMapProjectionData in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarMapProjectionData& data); - /** - * @brief This function read a ErsSarMapProjectionData from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarMapProjectionData& data); + /** + * @brief This function read a ErsSarMapProjectionData from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarMapProjectionData& data); - /** - * @brief Copy constructor - */ - ErsSarMapProjectionData(const ErsSarMapProjectionData& rhs); + /** + * @brief Copy constructor + */ + ErsSarMapProjectionData(const ErsSarMapProjectionData& rhs); - /** - * @brief Copy operator - */ - ErsSarMapProjectionData& operator=(const ErsSarMapProjectionData& rhs); + /** + * @brief Copy operator + */ + ErsSarMapProjectionData& operator=(const ErsSarMapProjectionData& rhs); - /** - * @brief This function is able to create a new instance of the class - */ - ErsSarRecord* Instanciate() - { - return new ErsSarMapProjectionData(); - }; + /** + * @brief This function is able to create a new instance of the class + */ + ErsSarRecord* Instanciate() + { + return new ErsSarMapProjectionData(); + }; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - ErsSarRecord* Clone() - { - return new ErsSarMapProjectionData(*this); - }; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + ErsSarRecord* Clone() + { + return new ErsSarMapProjectionData(*this); + }; - /** - * @brief Read the class data from a stream - */ - void Read(std::istream& is) - { - is>>*this; - }; + /** + * @brief Read the class data from a stream + */ + void Read(std::istream& is) + { + is>>*this; + }; - /** - * @brief Write the class to a stream - */ - void Write(std::ostream& os) - { - os<<*this; - }; + /** + * @brief Write the class to a stream + */ + void Write(std::ostream& os) + { + os<<*this; + }; - /** - * @brief map_proj_des - */ - std::string get_map_proj_des() - { - return _map_proj_des; - }; - /** - * @brief num_pix_in_line - */ - int get_num_pix_in_line() - { - return _num_pix_in_line; - }; - /** - * @brief num_lines - */ - int get_num_lines() - { - return _num_lines; - }; - /** - * @brief nom_interpixel_dist - */ - double get_nom_interpixel_dist() - { - return _nom_interpixel_dist; - }; - /** - * @brief nom_interline_dist - */ - double get_nom_interline_dist() - { - return _nom_interline_dist; - }; - /** - * @brief orientation_at_center - */ - double get_orientation_at_center() - { - return _orientation_at_center; - }; - /** - * @brief orbit_incl - */ - double get_orbit_incl() - { - return _orbit_incl; - }; - /** - * @brief asc_node_long - */ - double get_asc_node_long() - { - return _asc_node_long; - }; - /** - * @brief platform_heading - */ - double get_platform_heading() - { - return _platform_heading; - }; - /** - * @brief name_of_ref_ellipsoid - */ - std::string get_name_of_ref_ellipsoid() - { - return _name_of_ref_ellipsoid; - }; - /** - * @brief semi_maj_axis - */ - double get_semi_maj_axis() - { - return _semi_maj_axis; - }; - /** - * @brief semi_min_axis - */ - double get_semi_min_axis() - { - return _semi_min_axis; - }; - /** - * @brief first_line_first_pixel _lat - */ - double get_first_line_first_pixel_lat() - { - return _first_line_first_pixel_lat; - }; - /** - * @brief first_line_first_pixel_lon - */ - double get_first_line_first_pixel_lon() - { - return _first_line_first_pixel_lon; - }; - /** - * @brief first_line_last_pixel _lat - */ - double get_first_line_last_pixel_lat() - { - return _first_line_last_pixel_lat; - }; - /** - * @brief first_line_last_pixel_lon - */ - double get_first_line_last_pixel_lon() - { - return _first_line_last_pixel_lon; - }; - /** - * @brief last_line_last_pixel_lat - */ - double get_last_line_last_pixel_lat() - { - return _last_line_last_pixel_lat; - }; - /** - * @brief last_line_last_pixel_lon - */ - double get_last_line_last_pixel_lon() - { - return _last_line_last_pixel_lon; - }; - /** - * @brief last_line_first_pixel_lat - */ - double get_last_line_first_pixel_lat() - { - return _last_line_first_pixel_lat; - }; - /** - * @brief last_line_first_pixel_lon - */ - double get_last_line_first_pixel_lon() - { - return _last_line_first_pixel_lon; - }; + /** + * @brief map_proj_des + */ + std::string get_map_proj_des() + { + return _map_proj_des; + }; + /** + * @brief num_pix_in_line + */ + int get_num_pix_in_line() + { + return _num_pix_in_line; + }; + /** + * @brief num_lines + */ + int get_num_lines() + { + return _num_lines; + }; + /** + * @brief nom_interpixel_dist + */ + double get_nom_interpixel_dist() + { + return _nom_interpixel_dist; + }; + /** + * @brief nom_interline_dist + */ + double get_nom_interline_dist() + { + return _nom_interline_dist; + }; + /** + * @brief orientation_at_center + */ + double get_orientation_at_center() + { + return _orientation_at_center; + }; + /** + * @brief orbit_incl + */ + double get_orbit_incl() + { + return _orbit_incl; + }; + /** + * @brief asc_node_long + */ + double get_asc_node_long() + { + return _asc_node_long; + }; + /** + * @brief platform_heading + */ + double get_platform_heading() + { + return _platform_heading; + }; + /** + * @brief name_of_ref_ellipsoid + */ + std::string get_name_of_ref_ellipsoid() + { + return _name_of_ref_ellipsoid; + }; + /** + * @brief semi_maj_axis + */ + double get_semi_maj_axis() + { + return _semi_maj_axis; + }; + /** + * @brief semi_min_axis + */ + double get_semi_min_axis() + { + return _semi_min_axis; + }; + /** + * @brief first_line_first_pixel _lat + */ + double get_first_line_first_pixel_lat() + { + return _first_line_first_pixel_lat; + }; + /** + * @brief first_line_first_pixel_lon + */ + double get_first_line_first_pixel_lon() + { + return _first_line_first_pixel_lon; + }; + /** + * @brief first_line_last_pixel _lat + */ + double get_first_line_last_pixel_lat() + { + return _first_line_last_pixel_lat; + }; + /** + * @brief first_line_last_pixel_lon + */ + double get_first_line_last_pixel_lon() + { + return _first_line_last_pixel_lon; + }; + /** + * @brief last_line_last_pixel_lat + */ + double get_last_line_last_pixel_lat() + { + return _last_line_last_pixel_lat; + }; + /** + * @brief last_line_last_pixel_lon + */ + double get_last_line_last_pixel_lon() + { + return _last_line_last_pixel_lon; + }; + /** + * @brief last_line_first_pixel_lat + */ + double get_last_line_first_pixel_lat() + { + return _last_line_first_pixel_lat; + }; + /** + * @brief last_line_first_pixel_lon + */ + double get_last_line_first_pixel_lon() + { + return _last_line_first_pixel_lon; + }; protected: - /** - * @brief map_proj_des - */ - std::string _map_proj_des; - /** - * @brief num_pix_in_line - */ - int _num_pix_in_line; - /** - * @brief num_lines - */ - int _num_lines; - /** - * @brief nom_interpixel_dist - */ - double _nom_interpixel_dist; - /** - * @brief nom_interline_dist - */ - double _nom_interline_dist; - /** - * @brief orientation_at_center - */ - double _orientation_at_center; - /** - * @brief orbit_incl - */ - double _orbit_incl; - /** - * @brief asc_node_long - */ - double _asc_node_long; - /** - * @brief platform_heading - */ - double _platform_heading; - /** - * @brief name_of_ref_ellipsoid - */ - std::string _name_of_ref_ellipsoid; - /** - * @brief semi_maj_axis - */ - double _semi_maj_axis; - /** - * @brief semi_min_axis - */ - double _semi_min_axis; - /** - * @brief first_line_first_pixel_lat - */ - double _first_line_first_pixel_lat; - /** - * @brief first_line_first_pixel_lon - */ - double _first_line_first_pixel_lon; - /** - * @brief first_line_last_pixel_lat - */ - double _first_line_last_pixel_lat; - /** - * @brief first_line_last_pixel_lon - */ - double _first_line_last_pixel_lon; - /** - * @brief last_line_last_pixel_lat - */ - double _last_line_last_pixel_lat; - /** - * @brief last_line_last_pixel_lon - */ - double _last_line_last_pixel_lon; - /** - * @brief last_line_first_pixel_lat - */ - double _last_line_first_pixel_lat; - /** - * @brief last_line_first_pixel_lon - */ - double _last_line_first_pixel_lon; + /** + * @brief map_proj_des + */ + std::string _map_proj_des; + /** + * @brief num_pix_in_line + */ + int _num_pix_in_line; + /** + * @brief num_lines + */ + int _num_lines; + /** + * @brief nom_interpixel_dist + */ + double _nom_interpixel_dist; + /** + * @brief nom_interline_dist + */ + double _nom_interline_dist; + /** + * @brief orientation_at_center + */ + double _orientation_at_center; + /** + * @brief orbit_incl + */ + double _orbit_incl; + /** + * @brief asc_node_long + */ + double _asc_node_long; + /** + * @brief platform_heading + */ + double _platform_heading; + /** + * @brief name_of_ref_ellipsoid + */ + std::string _name_of_ref_ellipsoid; + /** + * @brief semi_maj_axis + */ + double _semi_maj_axis; + /** + * @brief semi_min_axis + */ + double _semi_min_axis; + /** + * @brief first_line_first_pixel_lat + */ + double _first_line_first_pixel_lat; + /** + * @brief first_line_first_pixel_lon + */ + double _first_line_first_pixel_lon; + /** + * @brief first_line_last_pixel_lat + */ + double _first_line_last_pixel_lat; + /** + * @brief first_line_last_pixel_lon + */ + double _first_line_last_pixel_lon; + /** + * @brief last_line_last_pixel_lat + */ + double _last_line_last_pixel_lat; + /** + * @brief last_line_last_pixel_lon + */ + double _last_line_last_pixel_lon; + /** + * @brief last_line_first_pixel_lat + */ + double _last_line_first_pixel_lat; + /** + * @brief last_line_first_pixel_lon + */ + double _last_line_first_pixel_lon; private: diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.cpp index 281ec15e445cf77c92b06ef551cf167a67c80e92..e0b63b84d17625ead8d15a8b8d9dffb855881f07 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.cpp @@ -25,14 +25,14 @@ ErsSarPlatformPositionData::~ErsSarPlatformPositionData() std::ostream& operator<<(std::ostream& os, const ErsSarPlatformPositionData& data) { - os<<"orbit_ele_desg:"<<data._orbit_ele_desg.c_str()<<std::endl; + os<<"orbit_ele_desg:"<<data._orbit_ele_desg.c_str()<<std::endl; - for(int i=0;i<6;i++) - { - os<<"orbit_ele["<<i<<"]:"<<data._orbit_ele[i]<<std::endl; - } + for(int i=0;i<6;i++) + { + os<<"orbit_ele["<<i<<"]:"<<data._orbit_ele[i]<<std::endl; + } - os<<"ndata:"<<data._ndata<<std::endl; + os<<"ndata:"<<data._ndata<<std::endl; os<<"year:"<<data._year<<std::endl; @@ -56,115 +56,115 @@ std::ostream& operator<<(std::ostream& os, const ErsSarPlatformPositionData& dat os<<"rad_poserr:"<<data._rad_poserr<<std::endl; - os<<"alt_velerr:"<<data._alt_velerr<<std::endl; + os<<"alt_velerr:"<<data._alt_velerr<<std::endl; os<<"crt_velerr:"<<data._crt_velerr<<std::endl; os<<"rad_velerr:"<<data._rad_velerr<<std::endl; - for (int i=0;i<64;i++) - { - os<<"pos_vect["<<i<<"]:"<<data._pos_vect[i]<<std::endl; - } + for (int i=0;i<64;i++) + { + os<<"pos_vect["<<i<<"]:"<<data._pos_vect[i]<<std::endl; + } - return os; + return os; } std::istream& operator>>(std::istream& is, ErsSarPlatformPositionData& data) { - char buf[1207]; - buf[1206] = '\0'; + char buf[1207]; + buf[1206] = '\0'; - is.read(buf,32); - buf[32] = '\0'; - data._orbit_ele_desg = buf; + is.read(buf,32); + buf[32] = '\0'; + data._orbit_ele_desg = buf; - for(int i=0;i<6;i++) - { - is.read(buf,16); - buf[16] = '\0'; - data._orbit_ele[i] = atof(buf); - } + for(int i=0;i<6;i++) + { + is.read(buf,16); + buf[16] = '\0'; + data._orbit_ele[i] = atof(buf); + } - is.read(buf,4); - buf[4] = '\0'; - data._ndata = atoi(buf); + is.read(buf,4); + buf[4] = '\0'; + data._ndata = atoi(buf); is.read(buf,4); - buf[4] = '\0'; - data._year = atoi(buf); + buf[4] = '\0'; + data._year = atoi(buf); is.read(buf,4); - buf[4] = '\0'; - data._month = atoi(buf); + buf[4] = '\0'; + data._month = atoi(buf); is.read(buf,4); - buf[4] = '\0'; - data._day = atoi(buf); + buf[4] = '\0'; + data._day = atoi(buf); is.read(buf,4); - buf[4] = '\0'; - data._gmt_day = atoi(buf); + buf[4] = '\0'; + data._gmt_day = atoi(buf); is.read(buf,22); - buf[22] = '\0'; - data._gmt_sec = atof(buf); + buf[22] = '\0'; + data._gmt_sec = atof(buf); is.read(buf,22); - buf[22] = '\0'; - data._data_int = atof(buf); + buf[22] = '\0'; + data._data_int = atof(buf); is.read(buf,64); - buf[64] = '\0'; - data._ref_coord = buf; + buf[64] = '\0'; + data._ref_coord = buf; is.read(buf,22); - buf[22] = '\0'; - data._hr_angle = atof(buf); + buf[22] = '\0'; + data._hr_angle = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._alt_poserr = atof(buf); + buf[16] = '\0'; + data._alt_poserr = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._crt_poserr = atof(buf); + buf[16] = '\0'; + data._crt_poserr = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._rad_poserr = atof(buf); + buf[16] = '\0'; + data._rad_poserr = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._alt_velerr = atof(buf); + buf[16] = '\0'; + data._alt_velerr = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._crt_velerr = atof(buf); + buf[16] = '\0'; + data._crt_velerr = atof(buf); is.read(buf,16); - buf[16] = '\0'; - data._rad_velerr = atof(buf); + buf[16] = '\0'; + data._rad_velerr = atof(buf); - for (int i=0;i<data._ndata;i++) - { - is>>data._pos_vect[i]; - } + for (int i=0;i<data._ndata;i++) + { + is>>data._pos_vect[i]; + } - return is; + return is; } ErsSarPlatformPositionData::ErsSarPlatformPositionData(const ErsSarPlatformPositionData& rhs): - ErsSarRecord(rhs) + ErsSarRecord(rhs) { - _orbit_ele_desg = rhs._orbit_ele_desg; + _orbit_ele_desg = rhs._orbit_ele_desg; - for(int i=0;i<6;i++) - { - _orbit_ele[i] = rhs._orbit_ele[i]; - } + for(int i=0;i<6;i++) + { + _orbit_ele[i] = rhs._orbit_ele[i]; + } - _ndata = rhs._ndata; + _ndata = rhs._ndata; _year = rhs._year; @@ -188,29 +188,29 @@ ErsSarPlatformPositionData::ErsSarPlatformPositionData(const ErsSarPlatformPosit _rad_poserr = rhs._rad_poserr; - _alt_velerr = rhs._alt_velerr; + _alt_velerr = rhs._alt_velerr; _crt_velerr = rhs._crt_velerr; _rad_velerr = rhs._rad_velerr; - for (int i=0;i<64;i++) - { - _pos_vect[i] = rhs._pos_vect[i]; - } + for (int i=0;i<64;i++) + { + _pos_vect[i] = rhs._pos_vect[i]; + } } ErsSarPlatformPositionData& ErsSarPlatformPositionData::operator=(const ErsSarPlatformPositionData& rhs) { - _orbit_ele_desg = rhs._orbit_ele_desg; + _orbit_ele_desg = rhs._orbit_ele_desg; - for(int i=0;i<6;i++) - { - _orbit_ele[i] = rhs._orbit_ele[i]; - } + for(int i=0;i<6;i++) + { + _orbit_ele[i] = rhs._orbit_ele[i]; + } - _ndata = rhs._ndata; + _ndata = rhs._ndata; _year = rhs._year; @@ -234,17 +234,17 @@ ErsSarPlatformPositionData& ErsSarPlatformPositionData::operator=(const ErsSarPl _rad_poserr = rhs._rad_poserr; - _alt_velerr = rhs._alt_velerr; + _alt_velerr = rhs._alt_velerr; _crt_velerr = rhs._crt_velerr; _rad_velerr = rhs._rad_velerr; - for (int i=0;i<64;i++) - { - _pos_vect[i] = rhs._pos_vect[i]; - } + for (int i=0;i<64;i++) + { + _pos_vect[i] = rhs._pos_vect[i]; + } - return *this; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.h index 332afee2a7ea3c556577857a65df77cd470ee580..10aa46117f401446a702edeeddf00aae4282dca6 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPlatformPositionData.h @@ -30,267 +30,267 @@ namespace ossimplugins class ErsSarPlatformPositionData : public ErsSarRecord { public: - /** - * @brief Constructor - */ - ErsSarPlatformPositionData(); + /** + * @brief Constructor + */ + ErsSarPlatformPositionData(); - /** - * @brief Destructor - */ - ~ErsSarPlatformPositionData(); + /** + * @brief Destructor + */ + ~ErsSarPlatformPositionData(); - /** - * @brief Copy constructor - */ - ErsSarPlatformPositionData(const ErsSarPlatformPositionData& rhs); + /** + * @brief Copy constructor + */ + ErsSarPlatformPositionData(const ErsSarPlatformPositionData& rhs); - /** - * @brief Copy operator - */ - ErsSarPlatformPositionData& operator=(const ErsSarPlatformPositionData& rhs); - /** - * @brief This function write the ErsSar PlatformPositionData in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarPlatformPositionData& data); + /** + * @brief Copy operator + */ + ErsSarPlatformPositionData& operator=(const ErsSarPlatformPositionData& rhs); + /** + * @brief This function write the ErsSar PlatformPositionData in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarPlatformPositionData& data); - /** - * @brief This function read a ErsSar PlatformPositionData from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarPlatformPositionData& data); + /** + * @brief This function read a ErsSar PlatformPositionData from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarPlatformPositionData& data); - /** - * @brief This function is able to create a new instance of the class - */ - ErsSarRecord* Instanciate() - { - return new ErsSarPlatformPositionData(); - }; + /** + * @brief This function is able to create a new instance of the class + */ + ErsSarRecord* Instanciate() + { + return new ErsSarPlatformPositionData(); + }; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - ErsSarRecord* Clone() - { - return new ErsSarPlatformPositionData(*this); - }; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + ErsSarRecord* Clone() + { + return new ErsSarPlatformPositionData(*this); + }; - /** - * @brief Read the class data from a stream - */ - void Read(std::istream& is) - { - is>>*this; - }; + /** + * @brief Read the class data from a stream + */ + void Read(std::istream& is) + { + is>>*this; + }; - /** - * @brief Write the class to a stream - */ - void Write(std::ostream& os) - { - os<<*this; - }; + /** + * @brief Write the class to a stream + */ + void Write(std::ostream& os) + { + os<<*this; + }; - /** - * @brief Orbital elements designator - */ - std::string get_orbit_ele_desg() - { - return _orbit_ele_desg; - }; - /** - * @brief Orbital elements - */ - double* get_orbit_ele() - { - return _orbit_ele; - }; - /** - * @brief Number of data points - */ - int get_ndata() - { - return _ndata; - }; - /** - * @brief Year of data point - */ - int get_year() - { - return _year; - }; - /** - * @brief Month of data point - */ - int get_month() - { - return _month; - }; - /** - * @brief Day of data point - */ - int get_day() - { - return _day; - }; - /** - * @brief Day of year - */ - int get_gmt_day() - { - return _gmt_day; - }; - /** - * @brief Seconds of day - */ - double get_gmt_sec() - { - return _gmt_sec; - }; - /** - * @brief Data sampling interval - */ - double get_data_int() - { - return _data_int; - }; - /** - * @brief Reference coordinate system - */ - std::string get_ref_coord() - { - return _ref_coord; - }; - /** - * @brief Greenwich mean hour angle - */ - double get_hr_angle() - { - return _hr_angle; - }; - /** - * @brief Along track position error - */ - double get_alt_poserr() - { - return _alt_poserr; - }; - /** - * @brief Cross track position error - */ - double get_crt_poserr() - { - return _crt_poserr; - }; - /** - * @brief Radial position error - */ - double get_rad_poserr() - { - return _rad_poserr; - }; - /** - * @brief Along track velocity error - */ - double get_alt_velerr() - { - return _alt_velerr; - }; - /** - * @brief Cross track velocity error - */ - double get_crt_velerr() - { - return _crt_velerr; - }; - /** - * @brief Radial velocity error - */ - double get_rad_velerr() - { - return _rad_velerr; - }; - /** - * @brief Data point position/velocity - */ - ErsSarPositionVectorRecord* get_pos_vect() - { - return _pos_vect; - }; + /** + * @brief Orbital elements designator + */ + std::string get_orbit_ele_desg() + { + return _orbit_ele_desg; + }; + /** + * @brief Orbital elements + */ + double* get_orbit_ele() + { + return _orbit_ele; + }; + /** + * @brief Number of data points + */ + int get_ndata() + { + return _ndata; + }; + /** + * @brief Year of data point + */ + int get_year() + { + return _year; + }; + /** + * @brief Month of data point + */ + int get_month() + { + return _month; + }; + /** + * @brief Day of data point + */ + int get_day() + { + return _day; + }; + /** + * @brief Day of year + */ + int get_gmt_day() + { + return _gmt_day; + }; + /** + * @brief Seconds of day + */ + double get_gmt_sec() + { + return _gmt_sec; + }; + /** + * @brief Data sampling interval + */ + double get_data_int() + { + return _data_int; + }; + /** + * @brief Reference coordinate system + */ + std::string get_ref_coord() + { + return _ref_coord; + }; + /** + * @brief Greenwich mean hour angle + */ + double get_hr_angle() + { + return _hr_angle; + }; + /** + * @brief Along track position error + */ + double get_alt_poserr() + { + return _alt_poserr; + }; + /** + * @brief Cross track position error + */ + double get_crt_poserr() + { + return _crt_poserr; + }; + /** + * @brief Radial position error + */ + double get_rad_poserr() + { + return _rad_poserr; + }; + /** + * @brief Along track velocity error + */ + double get_alt_velerr() + { + return _alt_velerr; + }; + /** + * @brief Cross track velocity error + */ + double get_crt_velerr() + { + return _crt_velerr; + }; + /** + * @brief Radial velocity error + */ + double get_rad_velerr() + { + return _rad_velerr; + }; + /** + * @brief Data point position/velocity + */ + ErsSarPositionVectorRecord* get_pos_vect() + { + return _pos_vect; + }; protected: - /** - * @brief Orbital elements designator - */ - std::string _orbit_ele_desg; - /** - * @brief Orbital elements - */ - double _orbit_ele[6]; - /** - * @brief Number of data points - */ - int _ndata; - /** - * @brief Year of data point - */ - int _year; - /** - * @brief Month of data point - */ - int _month; - /** - * @brief Day of data point - */ - int _day; - /** - * @brief Day of year - */ - int _gmt_day; - /** - * @brief Seconds of day - */ - double _gmt_sec; - /** - * @brief Data sampling interval - */ - double _data_int; - /** - * @brief Reference coordinate system - */ - std::string _ref_coord; - /** - * @brief Greenwich mean hour angle - */ - double _hr_angle; - /** - * @brief Along track position error - */ - double _alt_poserr; - /** - * @brief Cross track position error - */ - double _crt_poserr; - /** - * @brief Radial position error - */ - double _rad_poserr; - /** - * @brief Along track velocity error - */ - double _alt_velerr; - /** - * @brief Cross track velocity error - */ - double _crt_velerr; - /** - * @brief Radial velocity error - */ - double _rad_velerr; - /** - * @brief Data point position/velocity - */ - ErsSarPositionVectorRecord _pos_vect[64]; + /** + * @brief Orbital elements designator + */ + std::string _orbit_ele_desg; + /** + * @brief Orbital elements + */ + double _orbit_ele[6]; + /** + * @brief Number of data points + */ + int _ndata; + /** + * @brief Year of data point + */ + int _year; + /** + * @brief Month of data point + */ + int _month; + /** + * @brief Day of data point + */ + int _day; + /** + * @brief Day of year + */ + int _gmt_day; + /** + * @brief Seconds of day + */ + double _gmt_sec; + /** + * @brief Data sampling interval + */ + double _data_int; + /** + * @brief Reference coordinate system + */ + std::string _ref_coord; + /** + * @brief Greenwich mean hour angle + */ + double _hr_angle; + /** + * @brief Along track position error + */ + double _alt_poserr; + /** + * @brief Cross track position error + */ + double _crt_poserr; + /** + * @brief Radial position error + */ + double _rad_poserr; + /** + * @brief Along track velocity error + */ + double _alt_velerr; + /** + * @brief Cross track velocity error + */ + double _crt_velerr; + /** + * @brief Radial velocity error + */ + double _rad_velerr; + /** + * @brief Data point position/velocity + */ + ErsSarPositionVectorRecord _pos_vect[64]; private: }; diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.cpp index bc3e9df49dc2da5f7b753ae82e918a30dbc70b3f..577b48b805c306fae8a322e0a1a3624b6702a0b7 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.cpp @@ -25,61 +25,61 @@ ErsSarPositionVectorRecord::~ErsSarPositionVectorRecord() std::ostream& operator<<(std::ostream& os, const ErsSarPositionVectorRecord& data) { - for (int i=0;i<3;i++) - { - os<<"pos["<<i<<"]:"<<data._pos[i]<<std::endl; - } + for (int i=0;i<3;i++) + { + os<<"pos["<<i<<"]:"<<data._pos[i]<<std::endl; + } - for (int i=0;i<3;i++) - { - os<<"vel["<<i<<"]:"<<data._vel[i]<<std::endl; - } - return os; + for (int i=0;i<3;i++) + { + os<<"vel["<<i<<"]:"<<data._vel[i]<<std::endl; + } + return os; } std::istream& operator>>(std::istream& is, ErsSarPositionVectorRecord& data) { - char buf[23]; - buf[22] = '\0'; + char buf[23]; + buf[22] = '\0'; - for (int i=0;i<3;i++) - { - is.read(buf,22); - data._pos[i] = atof(buf); - } + for (int i=0;i<3;i++) + { + is.read(buf,22); + data._pos[i] = atof(buf); + } - for (int i=0;i<3;i++) - { - is.read(buf,22); - data._vel[i] = atof(buf); - } - return is; + for (int i=0;i<3;i++) + { + is.read(buf,22); + data._vel[i] = atof(buf); + } + return is; } ErsSarPositionVectorRecord::ErsSarPositionVectorRecord(const ErsSarPositionVectorRecord& rhs) { - for (int i=0;i<3;i++) - { - _pos[i] = rhs._pos[i]; - } + for (int i=0;i<3;i++) + { + _pos[i] = rhs._pos[i]; + } - for (int i=0;i<3;i++) - { - _vel[i] = rhs._vel[i]; - } + for (int i=0;i<3;i++) + { + _vel[i] = rhs._vel[i]; + } } ErsSarPositionVectorRecord& ErsSarPositionVectorRecord::operator=(const ErsSarPositionVectorRecord& rhs) { - for (int i=0;i<3;i++) - { - _pos[i] = rhs._pos[i]; - } + for (int i=0;i<3;i++) + { + _pos[i] = rhs._pos[i]; + } - for (int i=0;i<3;i++) - { - _vel[i] = rhs._vel[i]; - } - return *this; + for (int i=0;i<3;i++) + { + _vel[i] = rhs._vel[i]; + } + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.h index 4fb4a1020096ae8cec45aafd2366a597f48b3cec..800f8f9431e8d34321ca4328135e806add8f643d 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarLeader/ErsSarPositionVectorRecord.h @@ -27,60 +27,60 @@ namespace ossimplugins class ErsSarPositionVectorRecord { public: - /** - * @brief Constructor - */ - ErsSarPositionVectorRecord(); + /** + * @brief Constructor + */ + ErsSarPositionVectorRecord(); - /** - * @brief Destructor - */ - ~ErsSarPositionVectorRecord(); + /** + * @brief Destructor + */ + ~ErsSarPositionVectorRecord(); - /** - * @brief Copy constructor - */ - ErsSarPositionVectorRecord(const ErsSarPositionVectorRecord& rhs); + /** + * @brief Copy constructor + */ + ErsSarPositionVectorRecord(const ErsSarPositionVectorRecord& rhs); - /** - * @brief Copy operator - */ - ErsSarPositionVectorRecord& operator=(const ErsSarPositionVectorRecord& rhs); - /** - * @brief This function write the ErsSar PositionVectorRecord in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarPositionVectorRecord& data); + /** + * @brief Copy operator + */ + ErsSarPositionVectorRecord& operator=(const ErsSarPositionVectorRecord& rhs); + /** + * @brief This function write the ErsSar PositionVectorRecord in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarPositionVectorRecord& data); - /** - * @brief This function read a ErsSar PositionVectorRecord from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarPositionVectorRecord& data); + /** + * @brief This function read a ErsSar PositionVectorRecord from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarPositionVectorRecord& data); - /** - * @brief Data point position (m) - */ - double* get_pos() - { - return _pos; - }; + /** + * @brief Data point position (m) + */ + double* get_pos() + { + return _pos; + }; - /** - * @brief Data point velocity (mm/s) - */ - double* get_vel() - { - return _vel; - }; + /** + * @brief Data point velocity (mm/s) + */ + double* get_vel() + { + return _vel; + }; protected: - /** - * @brief Data point position (m) - */ - double _pos[3]; - /** - * @brief Data point velocity (mm/s) - */ - double _vel[3]; + /** + * @brief Data point position (m) + */ + double _pos[3]; + /** + * @brief Data point velocity (mm/s) + */ + double _vel[3]; private: diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.cpp index 5d87c922ac144edbd2d021204aa8cec1c488a6c5..1e23e59968fced073ba625fc42b53fa08265c0cc 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.cpp @@ -16,7 +16,7 @@ namespace ossimplugins { ErsSarRecord::ErsSarRecord(std::string mnemonic): - _mnemonic(mnemonic) + _mnemonic(mnemonic) { } @@ -25,7 +25,7 @@ ErsSarRecord::~ErsSarRecord() } ErsSarRecord::ErsSarRecord(const ErsSarRecord& rhs): - _mnemonic(rhs._mnemonic) + _mnemonic(rhs._mnemonic) { } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.h index 2ff22aa29831ea75755e627ccb9f4584f527ffb3..b144cbb4be2552b779d7b190a40ee90471b4046e 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecord.h @@ -27,49 +27,49 @@ namespace ossimplugins class ErsSarRecord { public: - /** - * @brief Constructor - * @param mnemonic Name of the record - */ - ErsSarRecord(std::string mnemonic); - /** - * @brief Destructor - */ - ~ErsSarRecord(); + /** + * @brief Constructor + * @param mnemonic Name of the record + */ + ErsSarRecord(std::string mnemonic); + /** + * @brief Destructor + */ + ~ErsSarRecord(); - /** - * @brief Copy constructor - */ - ErsSarRecord(const ErsSarRecord& rhs); + /** + * @brief Copy constructor + */ + ErsSarRecord(const ErsSarRecord& rhs); - /** - * @brief This function is able to create a new instance of the class - */ - virtual ErsSarRecord* Instanciate() =0; + /** + * @brief This function is able to create a new instance of the class + */ + virtual ErsSarRecord* Instanciate() =0; - /** - * @brief This function is able to create a new instance of the class initialised with the data of the calling instance - */ - virtual ErsSarRecord* Clone()=0; + /** + * @brief This function is able to create a new instance of the class initialised with the data of the calling instance + */ + virtual ErsSarRecord* Clone()=0; - /** - * @brief Read the class data from a stream - */ - virtual void Read(std::istream& is) =0; + /** + * @brief Read the class data from a stream + */ + virtual void Read(std::istream& is) =0; - /** - * @brief Write the class to a stream - */ - virtual void Write(std::ostream& os)=0; + /** + * @brief Write the class to a stream + */ + virtual void Write(std::ostream& os)=0; - std::string get_mnemonic() - { - return _mnemonic; - }; + std::string get_mnemonic() + { + return _mnemonic; + }; protected: - std::string _mnemonic; + std::string _mnemonic; private: }; diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.cpp index f911dec9802bfba9875f90a81b553ea881d4d07b..5f345440ea7826ba529bd154b00aacbc42f18367 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.cpp @@ -24,19 +24,19 @@ ErsSarRecordFactory::~ErsSarRecordFactory() ErsSarRecord* ErsSarRecordFactory::Instanciate(int id) { - ErsSarRecord* record = _availableRecords[id]; - if(record == NULL) - { - return NULL; - } - else - { - return record->Instanciate(); - } + ErsSarRecord* record = _availableRecords[id]; + if(record == NULL) + { + return NULL; + } + else + { + return record->Instanciate(); + } } void ErsSarRecordFactory::RegisterRecord(int id, ErsSarRecord * record) { - _availableRecords[id] = record; + _availableRecords[id] = record; } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.h index 54ef6e90548d5ce14d7360f236485ebdec815d5e..82b0f6eea21223790489a0f1aa4f09ba3abb9678 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordFactory.h @@ -31,33 +31,33 @@ namespace ossimplugins class ErsSarRecordFactory { public: - /** - * @brief Constructor - */ - ErsSarRecordFactory(); - /** - * @brief Destructor - */ - ~ErsSarRecordFactory(); + /** + * @brief Constructor + */ + ErsSarRecordFactory(); + /** + * @brief Destructor + */ + ~ErsSarRecordFactory(); - /** - * @brief Add a new Record type available in this factory - * @param record Record to add in the factory - * @param id Id of the new avalaible Record - */ - void RegisterRecord(int id, ErsSarRecord * record); + /** + * @brief Add a new Record type available in this factory + * @param record Record to add in the factory + * @param id Id of the new avalaible Record + */ + void RegisterRecord(int id, ErsSarRecord * record); - /** - * @brief Instanciate a new Record - * @param id Id of the Record we want to instanciate - */ - ErsSarRecord* Instanciate(int id) ; + /** + * @brief Instanciate a new Record + * @param id Id of the Record we want to instanciate + */ + ErsSarRecord* Instanciate(int id) ; protected: - /** - * @brief Contain all the available Records for the factory - */ - std::map<int, ErsSarRecord*> _availableRecords; + /** + * @brief Contain all the available Records for the factory + */ + std::map<int, ErsSarRecord*> _availableRecords; private: }; diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.cpp b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.cpp index b5315f9c0b585aec7de0e44bed1325ed1c62ddd3..e537501e55d335af77a6f65df348e1aae0f5ab85 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.cpp +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.cpp @@ -25,58 +25,58 @@ ErsSarRecordHeader::~ErsSarRecordHeader() std::ostream& operator<<(std::ostream& os, const ErsSarRecordHeader& data) { - os<<"record_sequence_number:"<<data._rec_seq<<std::endl; - os<<"first_record_sub-type:"<<(int)data._rec_sub1<<std::endl; - os<<"record_type_code:"<<(int)data._rec_type<<std::endl; - os<<"second_record_sub-type:"<<(int)data._rec_sub2<<std::endl; - os<<"third_record_sub-type:"<<(int)data._rec_sub3<<std::endl; - os<<"length:"<<data._length<<std::endl; - return os; + os<<"record_sequence_number:"<<data._rec_seq<<std::endl; + os<<"first_record_sub-type:"<<(int)data._rec_sub1<<std::endl; + os<<"record_type_code:"<<(int)data._rec_type<<std::endl; + os<<"second_record_sub-type:"<<(int)data._rec_sub2<<std::endl; + os<<"third_record_sub-type:"<<(int)data._rec_sub3<<std::endl; + os<<"length:"<<data._length<<std::endl; + return os; } std::istream& operator>>(std::istream& is, ErsSarRecordHeader& data) { - is.read((char*)&(data._rec_seq),4); - data.SwitchEndian(data._rec_seq); - is.read((char*)&(data._rec_sub1),1); - is.read((char*)&(data._rec_type),1); - is.read((char*)&(data._rec_sub2),1); - is.read((char*)&(data._rec_sub3),1); - is.read((char*)&(data._length),4); - data.SwitchEndian(data._length); - return is; + is.read((char*)&(data._rec_seq),4); + data.SwitchEndian(data._rec_seq); + is.read((char*)&(data._rec_sub1),1); + is.read((char*)&(data._rec_type),1); + is.read((char*)&(data._rec_sub2),1); + is.read((char*)&(data._rec_sub3),1); + is.read((char*)&(data._length),4); + data.SwitchEndian(data._length); + return is; } ErsSarRecordHeader::ErsSarRecordHeader(const ErsSarRecordHeader& rhs): - _rec_seq(rhs._rec_seq), - _rec_sub1(rhs._rec_sub1), - _rec_type(rhs._rec_type), - _rec_sub2(rhs._rec_sub2), - _rec_sub3(rhs._rec_sub3) + _rec_seq(rhs._rec_seq), + _rec_sub1(rhs._rec_sub1), + _rec_type(rhs._rec_type), + _rec_sub2(rhs._rec_sub2), + _rec_sub3(rhs._rec_sub3) { } ErsSarRecordHeader& ErsSarRecordHeader::operator=(const ErsSarRecordHeader& rhs) { - _rec_seq=rhs._rec_seq; - _rec_sub1=rhs._rec_sub1; - _rec_type=rhs._rec_type; - _rec_sub2=rhs._rec_sub2; - _rec_sub3=rhs._rec_sub3; - return *this; + _rec_seq=rhs._rec_seq; + _rec_sub1=rhs._rec_sub1; + _rec_type=rhs._rec_type; + _rec_sub2=rhs._rec_sub2; + _rec_sub3=rhs._rec_sub3; + return *this; } void ErsSarRecordHeader::SwitchEndian(unsigned int& value) { - char buffer[4]; - char res[4]; + char buffer[4]; + char res[4]; - memcpy(buffer,&value,4); - res[0] = buffer[3]; - res[1] = buffer[2]; - res[2] = buffer[1]; - res[3] = buffer[0]; + memcpy(buffer,&value,4); + res[0] = buffer[3]; + res[1] = buffer[2]; + res[2] = buffer[1]; + res[3] = buffer[0]; - memcpy(&value,res,4); + memcpy(&value,res,4); } } diff --git a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.h b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.h index 72188e697fe6c5f73246fada76cf3b60e230b97a..ea817dde69332e6e8e32ae5c4101f64f5130b142 100644 --- a/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.h +++ b/Utilities/otbossimplugins/ossim/ers/ErsSar/ErsSarRecordHeader.h @@ -26,112 +26,112 @@ namespace ossimplugins class ErsSarRecordHeader { public: - /** - * @brief Constructor - */ - ErsSarRecordHeader(); - - /** - * @brief Destructor - */ - ~ErsSarRecordHeader(); - - /** - * @brief Copy constructor - */ - ErsSarRecordHeader(const ErsSarRecordHeader& rhs); - - /** - * @brief Copy operator - */ - ErsSarRecordHeader& operator=(const ErsSarRecordHeader& rhs); - /** - * @brief This function write the RecordHeader in a stream - */ - friend std::ostream& operator<<(std::ostream& os, const ErsSarRecordHeader& data); - - /** - * @brief This function read a RecordHeader from a stream - */ - friend std::istream& operator>>(std::istream& is, ErsSarRecordHeader& data); - - /** - * @brief Record sequence number - */ - unsigned int get_rec_seq() - { - return _rec_seq; - }; - - /** - * @brief First record sub-type code - */ + /** + * @brief Constructor + */ + ErsSarRecordHeader(); + + /** + * @brief Destructor + */ + ~ErsSarRecordHeader(); + + /** + * @brief Copy constructor + */ + ErsSarRecordHeader(const ErsSarRecordHeader& rhs); + + /** + * @brief Copy operator + */ + ErsSarRecordHeader& operator=(const ErsSarRecordHeader& rhs); + /** + * @brief This function write the RecordHeader in a stream + */ + friend std::ostream& operator<<(std::ostream& os, const ErsSarRecordHeader& data); + + /** + * @brief This function read a RecordHeader from a stream + */ + friend std::istream& operator>>(std::istream& is, ErsSarRecordHeader& data); + + /** + * @brief Record sequence number + */ + unsigned int get_rec_seq() + { + return _rec_seq; + }; + + /** + * @brief First record sub-type code + */ unsigned char get_rec_sub1() - { - return _rec_sub1; - }; + { + return _rec_sub1; + }; - /** - * @brief Record type code - */ + /** + * @brief Record type code + */ unsigned char get_rec_type() - { - return _rec_type; - }; + { + return _rec_type; + }; - /** - * @brief Second record sub-type code - */ + /** + * @brief Second record sub-type code + */ unsigned char get_rec_sub2() - { - return _rec_sub2; - }; + { + return _rec_sub2; + }; - /** - * @brief Third record sub-type code - */ + /** + * @brief Third record sub-type code + */ unsigned char get_rec_sub3() - { - return _rec_sub3; - }; + { + return _rec_sub3; + }; - /** - * @brief Length of this record (in bytes) - */ + /** + * @brief Length of this record (in bytes) + */ unsigned int get_length() - { - return _length; - }; + { + return _length; + }; protected: - /** - * @brief This function switch the LSB value and the MSB value of the parameter - */ - void SwitchEndian(unsigned int& value); - - /** - * @brief Record sequence number - */ - unsigned int _rec_seq; - /** - * @brief First record sub-type code - */ + /** + * @brief This function switch the LSB value and the MSB value of the parameter + */ + void SwitchEndian(unsigned int& value); + + /** + * @brief Record sequence number + */ + unsigned int _rec_seq; + /** + * @brief First record sub-type code + */ unsigned char _rec_sub1; - /** - * @brief Record type code - */ + /** + * @brief Record type code + */ unsigned char _rec_type; - /** - * @brief Second record sub-type code - */ + /** + * @brief Second record sub-type code + */ unsigned char _rec_sub2; - /** - * @brief Third record sub-type code - */ + /** + * @brief Third record sub-type code + */ unsigned char _rec_sub3; - /** - * @brief Length of this record (in bytes) - */ + /** + * @brief Length of this record (in bytes) + */ unsigned int _length; private: diff --git a/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.cpp b/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.cpp index 889f50da73fe51237d99dc2bd4fb2f86f1ed50b0..f7f10568b15dcbdacd7ca36ecdb4d34a1856f223 100644 --- a/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.cpp @@ -28,10 +28,10 @@ namespace ossimplugins RTTI_DEF1(ossimCosmoSkymedModel, "ossimCosmoSkymedModel", ossimGeometricSarSensorModel); ossimCosmoSkymedModel::ossimCosmoSkymedModel(): - _nbCol(0), - _SrGr_R0(0), - _sceneCenterRangeTime(0), - _pixel_spacing(0) + _nbCol(0), + _SrGr_R0(0), + _sceneCenterRangeTime(0), + _pixel_spacing(0) { } @@ -41,348 +41,348 @@ ossimCosmoSkymedModel::~ossimCosmoSkymedModel() double ossimCosmoSkymedModel::getSlantRangeFromGeoreferenced(double col) const { - // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range - double relativeGroundRange = _refPoint->get_distance() + _sensor->get_col_direction() * (col-_refPoint->get_pix_col())* _pixel_spacing ; + // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range + double relativeGroundRange = _refPoint->get_distance() + _sensor->get_col_direction() * (col-_refPoint->get_pix_col())* _pixel_spacing ; - double slantRange = _SrGr_coeffs[0] - + _SrGr_coeffs[1]*(relativeGroundRange-_SrGr_R0) - + _SrGr_coeffs[2]*(pow(relativeGroundRange,2)-_SrGr_R0) - + _SrGr_coeffs[3]*(pow(relativeGroundRange,3)-_SrGr_R0) - + _SrGr_coeffs[4]*(pow(relativeGroundRange,4)-_SrGr_R0) - + _SrGr_coeffs[5]*(pow(relativeGroundRange,5)-_SrGr_R0); + double slantRange = _SrGr_coeffs[0] + + _SrGr_coeffs[1]*(relativeGroundRange-_SrGr_R0) + + _SrGr_coeffs[2]*(pow(relativeGroundRange,2)-_SrGr_R0) + + _SrGr_coeffs[3]*(pow(relativeGroundRange,3)-_SrGr_R0) + + _SrGr_coeffs[4]*(pow(relativeGroundRange,4)-_SrGr_R0) + + _SrGr_coeffs[5]*(pow(relativeGroundRange,5)-_SrGr_R0); - return slantRange ; + return slantRange ; } bool ossimCosmoSkymedModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix) { - const char* central_freq_str = kwl.find(prefix,"central_freq"); - double central_freq = atof(central_freq_str); - const char* fr_str = kwl.find(prefix,"fr"); - double fr = atof(fr_str); - const char* fa_str = kwl.find(prefix,"fa"); - double fa = atof(fa_str); - - //number of different looks - const char* n_azilok_str = kwl.find(prefix,"n_azilok"); - double n_azilok = atof(n_azilok_str); - const char* n_rnglok_str = kwl.find(prefix,"n_rnglok"); - double n_rnglok = atof(n_rnglok_str); - - //ellipsoid parameters - const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); - double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m - const char* ellip_min_str = kwl.find(prefix,"ellip_min"); - double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m - - if(_sensor != NULL) - { - delete _sensor; - } - - _sensor = new SensorParams(); - - - /** - * @todo : � voir sur de vrais produits (exemples de DESCENDING et ASCENDING) - */ - const char* orbitDirection_str = kwl.find(prefix,"orbitDirection"); - std::string orbitDirection(orbitDirection_str) ; - int orbitDirectionSign ; - if (orbitDirection=="DESCENDING") orbitDirectionSign = 1 ; - else orbitDirectionSign = - 1 ; - - const char* lookDirection_str = kwl.find(prefix,"lookDirection"); - std::string lookDirection(lookDirection_str) ; - if ((lookDirection == "Right")||(lookDirection == "RIGHT")) _sensor->set_sightDirection(SensorParams::Right) ; - else _sensor->set_sightDirection(SensorParams::Left) ; - - const char* colsOrder_str = kwl.find(prefix,"colsOrder"); - std::string colsOrder(colsOrder_str) ; - const char* linsOrder_str = kwl.find(prefix,"linsOrder"); - std::string linsOrder(linsOrder_str) ; - if (colsOrder=="NEAR-FAR") - _sensor->set_col_direction(orbitDirectionSign); - else _sensor->set_col_direction(-orbitDirectionSign); - if (linsOrder=="NEAR-FAR") - _sensor->set_lin_direction(orbitDirectionSign); - else _sensor->set_lin_direction(-orbitDirectionSign); - - _sensor->set_sf(fr); - const double CLUM = 2.99792458e+8 ; - double wave_length = CLUM / central_freq ; - _sensor->set_rwl(wave_length); - _sensor->set_nAzimuthLook(n_azilok); - _sensor->set_nRangeLook(n_rnglok); - - // fa is the processing PRF - _sensor->set_prf(fa * n_azilok); - - _sensor->set_semiMajorAxis(ellip_maj) ; - _sensor->set_semiMinorAxis(ellip_min) ; - - return true; + const char* central_freq_str = kwl.find(prefix,"central_freq"); + double central_freq = atof(central_freq_str); + const char* fr_str = kwl.find(prefix,"fr"); + double fr = atof(fr_str); + const char* fa_str = kwl.find(prefix,"fa"); + double fa = atof(fa_str); + + //number of different looks + const char* n_azilok_str = kwl.find(prefix,"n_azilok"); + double n_azilok = atof(n_azilok_str); + const char* n_rnglok_str = kwl.find(prefix,"n_rnglok"); + double n_rnglok = atof(n_rnglok_str); + + //ellipsoid parameters + const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); + double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m + const char* ellip_min_str = kwl.find(prefix,"ellip_min"); + double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m + + if(_sensor != NULL) + { + delete _sensor; + } + + _sensor = new SensorParams(); + + + /** + * @todo : � voir sur de vrais produits (exemples de DESCENDING et ASCENDING) + */ + const char* orbitDirection_str = kwl.find(prefix,"orbitDirection"); + std::string orbitDirection(orbitDirection_str) ; + int orbitDirectionSign ; + if (orbitDirection=="DESCENDING") orbitDirectionSign = 1 ; + else orbitDirectionSign = - 1 ; + + const char* lookDirection_str = kwl.find(prefix,"lookDirection"); + std::string lookDirection(lookDirection_str) ; + if ((lookDirection == "Right")||(lookDirection == "RIGHT")) _sensor->set_sightDirection(SensorParams::Right) ; + else _sensor->set_sightDirection(SensorParams::Left) ; + + const char* colsOrder_str = kwl.find(prefix,"colsOrder"); + std::string colsOrder(colsOrder_str) ; + const char* linsOrder_str = kwl.find(prefix,"linsOrder"); + std::string linsOrder(linsOrder_str) ; + if (colsOrder=="NEAR-FAR") + _sensor->set_col_direction(orbitDirectionSign); + else _sensor->set_col_direction(-orbitDirectionSign); + if (linsOrder=="NEAR-FAR") + _sensor->set_lin_direction(orbitDirectionSign); + else _sensor->set_lin_direction(-orbitDirectionSign); + + _sensor->set_sf(fr); + const double CLUM = 2.99792458e+8 ; + double wave_length = CLUM / central_freq ; + _sensor->set_rwl(wave_length); + _sensor->set_nAzimuthLook(n_azilok); + _sensor->set_nRangeLook(n_rnglok); + + // fa is the processing PRF + _sensor->set_prf(fa * n_azilok); + + _sensor->set_semiMajorAxis(ellip_maj) ; + _sensor->set_semiMinorAxis(ellip_min) ; + + return true; } bool ossimCosmoSkymedModel::InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix) { - /* - * Retrieval of ephemerisis number - */ - const char* neph_str = kwl.find(prefix,"neph"); - int neph = atoi(neph_str); - - Ephemeris** ephemeris = new Ephemeris*[neph]; - - /* - * Retrieval of reference date - */ - const char* referenceUTC_str = kwl.find(prefix,"referenceUTC"); - std::string referenceUTC(referenceUTC_str) ; - CivilDateTime ref_civil_date; - if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false; - - /* - * Retrieval of ephemerisis - */ - for (int i=0;i<neph;i++) - { - double pos[3]; - double vit[3]; - char name[64]; - - sprintf(name,"eph%i_date",i); - const char* date_str = kwl.find(prefix,name); - float relative_date = atof(date_str); - - sprintf(name,"eph%i_posX",i); - const char* px_str = kwl.find(prefix,name); - pos[0] = atof(px_str); - - sprintf(name,"eph%i_posY",i); - const char* py_str = kwl.find(prefix,name); - pos[1] = atof(py_str); - - sprintf(name,"eph%i_posZ",i); - const char* pz_str = kwl.find(prefix,name); - pos[2] = atof(pz_str); - - sprintf(name,"eph%i_velX",i); - const char* vx_str = kwl.find(prefix,name); - vit[0] = atof(vx_str) ; - - sprintf(name,"eph%i_velY",i); - const char* vy_str = kwl.find(prefix,name); - vit[1] = atof(vy_str) ; - - sprintf(name,"eph%i_velZ",i); - const char* vz_str = kwl.find(prefix,name); - vit[2] = atof(vz_str) ; - /* - * Conversion to JSD Date - */ - int second = (int) relative_date ; - double decimal = relative_date - second ; - CivilDateTime eph_civil_date(ref_civil_date.get_year(), ref_civil_date.get_month(), ref_civil_date.get_day(), second, decimal); - JSDDateTime eph_jsd_date(eph_civil_date); - - GeographicEphemeris* eph = new GeographicEphemeris(eph_jsd_date,pos,vit); - - ephemeris[i] = eph; - } - - /* - * Creation of the platform position interpolator - */ - if (_platformPosition != NULL) - { - delete _platformPosition; - } - _platformPosition = new PlatformPosition(ephemeris,neph); - - /* - * Free of memory used by ephemerisis list : the constructor copies the ephemerisis - */ - for (int i=0;i<neph;i++) - { - delete ephemeris[i]; - } - delete[] ephemeris; - - return true; + /* + * Retrieval of ephemerisis number + */ + const char* neph_str = kwl.find(prefix,"neph"); + int neph = atoi(neph_str); + + Ephemeris** ephemeris = new Ephemeris*[neph]; + + /* + * Retrieval of reference date + */ + const char* referenceUTC_str = kwl.find(prefix,"referenceUTC"); + std::string referenceUTC(referenceUTC_str) ; + CivilDateTime ref_civil_date; + if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false; + + /* + * Retrieval of ephemerisis + */ + for (int i=0;i<neph;i++) + { + double pos[3]; + double vit[3]; + char name[64]; + + sprintf(name,"eph%i_date",i); + const char* date_str = kwl.find(prefix,name); + float relative_date = atof(date_str); + + sprintf(name,"eph%i_posX",i); + const char* px_str = kwl.find(prefix,name); + pos[0] = atof(px_str); + + sprintf(name,"eph%i_posY",i); + const char* py_str = kwl.find(prefix,name); + pos[1] = atof(py_str); + + sprintf(name,"eph%i_posZ",i); + const char* pz_str = kwl.find(prefix,name); + pos[2] = atof(pz_str); + + sprintf(name,"eph%i_velX",i); + const char* vx_str = kwl.find(prefix,name); + vit[0] = atof(vx_str) ; + + sprintf(name,"eph%i_velY",i); + const char* vy_str = kwl.find(prefix,name); + vit[1] = atof(vy_str) ; + + sprintf(name,"eph%i_velZ",i); + const char* vz_str = kwl.find(prefix,name); + vit[2] = atof(vz_str) ; + /* + * Conversion to JSD Date + */ + int second = (int) relative_date ; + double decimal = relative_date - second ; + CivilDateTime eph_civil_date(ref_civil_date.get_year(), ref_civil_date.get_month(), ref_civil_date.get_day(), second, decimal); + JSDDateTime eph_jsd_date(eph_civil_date); + + GeographicEphemeris* eph = new GeographicEphemeris(eph_jsd_date,pos,vit); + + ephemeris[i] = eph; + } + + /* + * Creation of the platform position interpolator + */ + if (_platformPosition != NULL) + { + delete _platformPosition; + } + _platformPosition = new PlatformPosition(ephemeris,neph); + + /* + * Free of memory used by ephemerisis list : the constructor copies the ephemerisis + */ + for (int i=0;i<neph;i++) + { + delete ephemeris[i]; + } + delete[] ephemeris; + + return true; } bool ossimCosmoSkymedModel::InitRefPoint(const ossimKeywordlist &kwl, const char *prefix) { - const char* sc_lin_str = kwl.find(prefix,"sc_lin"); - double sc_lin = atof(sc_lin_str); + const char* sc_lin_str = kwl.find(prefix,"sc_lin"); + double sc_lin = atof(sc_lin_str); - const char* sc_pix_str = kwl.find(prefix,"sc_pix"); - double sc_pix = atof(sc_pix_str); + const char* sc_pix_str = kwl.find(prefix,"sc_pix"); + double sc_pix = atof(sc_pix_str); - // const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); - // double pixel_spacing = atof(pixel_spacing_str); + // const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); + // double pixel_spacing = atof(pixel_spacing_str); - const char* azimuthStartTime_str = kwl.find(prefix,"azimuthStartTime"); - double azimuthStartTime = atof(azimuthStartTime_str); + const char* azimuthStartTime_str = kwl.find(prefix,"azimuthStartTime"); + double azimuthStartTime = atof(azimuthStartTime_str); - const char* rng_gate_str = kwl.find(prefix,"rng_gate"); - double rng_gate = atof(rng_gate_str); + const char* rng_gate_str = kwl.find(prefix,"rng_gate"); + double rng_gate = atof(rng_gate_str); - const char* referenceUTC_str = kwl.find(prefix,"referenceUTC"); - std::string referenceUTC(referenceUTC_str) ; - CivilDateTime ref_civil_date; - if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false; + const char* referenceUTC_str = kwl.find(prefix,"referenceUTC"); + std::string referenceUTC(referenceUTC_str) ; + CivilDateTime ref_civil_date; + if (! UtcDateTimeStringToCivilDate(referenceUTC, ref_civil_date)) return false; - if(_refPoint == NULL) - { - _refPoint = new RefPoint(); - } + if(_refPoint == NULL) + { + _refPoint = new RefPoint(); + } - _refPoint->set_pix_col(sc_pix); - _refPoint->set_pix_line(sc_lin); + _refPoint->set_pix_col(sc_pix); + _refPoint->set_pix_line(sc_lin); - double relative_date = (azimuthStartTime + sc_lin/_sensor->get_prf()); - int second = (int) relative_date ; - double decimal = relative_date - second ; - CivilDateTime * date = new CivilDateTime(ref_civil_date.get_year(), ref_civil_date.get_month(), ref_civil_date.get_day(), second, decimal); + double relative_date = (azimuthStartTime + sc_lin/_sensor->get_prf()); + int second = (int) relative_date ; + double decimal = relative_date - second ; + CivilDateTime * date = new CivilDateTime(ref_civil_date.get_year(), ref_civil_date.get_month(), ref_civil_date.get_day(), second, decimal); - if(_platformPosition != NULL) - { - Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)*date); - if (ephemeris == NULL) return false ; + if(_platformPosition != NULL) + { + Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)*date); + if (ephemeris == NULL) return false ; - _refPoint->set_ephemeris(ephemeris); + _refPoint->set_ephemeris(ephemeris); - delete ephemeris; - } - else - { - return false; - } + delete ephemeris; + } + else + { + return false; + } - double c = 2.99792458e+8; - double distance = (rng_gate + sc_pix*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); + double c = 2.99792458e+8; + double distance = (rng_gate + sc_pix*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); - // in the case of Georeferenced images, the "relative" ground range is stored in place of the slant range - // (used for SlantRange computation relative to reference point, necessary for optimization) - // here, the pixelDirection is ignored since the CSKS reference point is always at the scene centre - if (_isProductGeoreferenced) { - distance = _refPoint->get_pix_col() * _pixel_spacing ; - } + // in the case of Georeferenced images, the "relative" ground range is stored in place of the slant range + // (used for SlantRange computation relative to reference point, necessary for optimization) + // here, the pixelDirection is ignored since the CSKS reference point is always at the scene centre + if (_isProductGeoreferenced) { + distance = _refPoint->get_pix_col() * _pixel_spacing ; + } - _refPoint->set_distance(distance); + _refPoint->set_distance(distance); - // in order to use ossimSensorModel::lineSampleToWorld - const char* nbCol_str = kwl.find(prefix,"nbCol"); - const char* nbLin_str = kwl.find(prefix,"nbLin"); - theImageSize.x = atoi(nbCol_str); + // in order to use ossimSensorModel::lineSampleToWorld + const char* nbCol_str = kwl.find(prefix,"nbCol"); + const char* nbLin_str = kwl.find(prefix,"nbLin"); + theImageSize.x = atoi(nbCol_str); theImageSize.y = atoi(nbLin_str); theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); - // Ground Control Points extracted from the model : scene center and corners - std::list<ossimGpt> groundGcpCoordinates ; - std::list<ossimDpt> imageGcpCoordinates ; - char name[64]; - for (int k=0 ; k<5 ; k++) { - sprintf(name,"cornersCol%i",k); - const char* i_str = kwl.find(name); - int i = atoi(i_str); - sprintf(name,"cornersLin%i",k); - const char* j_str = kwl.find(name); - int j = atoi(j_str); - sprintf(name,"cornersLon%i",k); - const char* lon_str = kwl.find(name); - double lon = atof(lon_str); - sprintf(name,"cornersLat%i",k); - const char* lat_str = kwl.find(name); - double lat = atof(lat_str); - sprintf(name,"cornersHeight%i",k); - const char* height_str = kwl.find(name); - double height = atof(height_str) ; - - ossimDpt imageGCP(i,j); - ossimGpt groundGCP(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP) ; - imageGcpCoordinates.push_back(imageGCP) ; - } - - // Default optimization - optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; - - return true; + // Ground Control Points extracted from the model : scene center and corners + std::list<ossimGpt> groundGcpCoordinates ; + std::list<ossimDpt> imageGcpCoordinates ; + char name[64]; + for (int k=0 ; k<5 ; k++) { + sprintf(name,"cornersCol%i",k); + const char* i_str = kwl.find(name); + int i = atoi(i_str); + sprintf(name,"cornersLin%i",k); + const char* j_str = kwl.find(name); + int j = atoi(j_str); + sprintf(name,"cornersLon%i",k); + const char* lon_str = kwl.find(name); + double lon = atof(lon_str); + sprintf(name,"cornersLat%i",k); + const char* lat_str = kwl.find(name); + double lat = atof(lat_str); + sprintf(name,"cornersHeight%i",k); + const char* height_str = kwl.find(name); + double height = atof(height_str) ; + + ossimDpt imageGCP(i,j); + ossimGpt groundGCP(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP) ; + imageGcpCoordinates.push_back(imageGCP) ; + } + + // Default optimization + optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; + + return true; } bool ossimCosmoSkymedModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix) { - const char* rangeProjectionType_str = kwl.find(prefix,"rangeProjectionType"); - std::string rangeProjectionType(rangeProjectionType_str); - - const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); - _pixel_spacing= atof(pixel_spacing_str); - - _isProductGeoreferenced = (rangeProjectionType=="GROUNDRANGE") ; - - // Number of columns - const char* nbCol_str = kwl.find(prefix,"nbCol"); - _nbCol = atoi(nbCol_str); - - // SRGR polynomial reference - const char* SrGr_R0_str = kwl.find(prefix,"SrGr_R0"); - _SrGr_R0 = atof(SrGr_R0_str); - - // SRGR coefficients - char name[64]; - double coeff ; - for(int i=0;i<6;i++) - { - sprintf(name,"SrToGr_coeffs_%i",i); - const char* coeff_str = kwl.find(prefix,name); - coeff = atof(coeff_str); - _SrGr_coeffs.push_back(coeff); - } - - return true; + const char* rangeProjectionType_str = kwl.find(prefix,"rangeProjectionType"); + std::string rangeProjectionType(rangeProjectionType_str); + + const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); + _pixel_spacing= atof(pixel_spacing_str); + + _isProductGeoreferenced = (rangeProjectionType=="GROUNDRANGE") ; + + // Number of columns + const char* nbCol_str = kwl.find(prefix,"nbCol"); + _nbCol = atoi(nbCol_str); + + // SRGR polynomial reference + const char* SrGr_R0_str = kwl.find(prefix,"SrGr_R0"); + _SrGr_R0 = atof(SrGr_R0_str); + + // SRGR coefficients + char name[64]; + double coeff ; + for(int i=0;i<6;i++) + { + sprintf(name,"SrToGr_coeffs_%i",i); + const char* coeff_str = kwl.find(prefix,name); + coeff = atof(coeff_str); + _SrGr_coeffs.push_back(coeff); + } + + return true; } bool ossimCosmoSkymedModel::UtcDateTimeStringToCivilDate(const std::string &utcString, CivilDateTime &outputDate) { - // conversion : - // try with date format yyyymmdd - - if (utcString.size() < 8) return false ; - const char* stringUTCDate = utcString.c_str() ; - - char year_str[5]; - for (int i=0;i<4;i++) - { - year_str[i] = stringUTCDate[i]; - } - year_str[4] = '\0'; - - char month_str[3]; - for (int i=4;i<6;i++) - { - month_str[i-4] = stringUTCDate[i]; - } - month_str[2] = '\0'; - - char day_str[3]; - for (int i=6;i<8;i++) - { - day_str[i-6] = stringUTCDate[i]; - } - day_str[2] = '\0'; - - outputDate.set_year(atoi(year_str)); - outputDate.set_month(atoi(month_str)); - outputDate.set_day(atoi(day_str)); - outputDate.set_second(0.0); - outputDate.set_decimal(0.0); - - return true ; + // conversion : + // try with date format yyyymmdd + + if (utcString.size() < 8) return false ; + const char* stringUTCDate = utcString.c_str() ; + + char year_str[5]; + for (int i=0;i<4;i++) + { + year_str[i] = stringUTCDate[i]; + } + year_str[4] = '\0'; + + char month_str[3]; + for (int i=4;i<6;i++) + { + month_str[i-4] = stringUTCDate[i]; + } + month_str[2] = '\0'; + + char day_str[3]; + for (int i=6;i<8;i++) + { + day_str[i-6] = stringUTCDate[i]; + } + day_str[2] = '\0'; + + outputDate.set_year(atoi(year_str)); + outputDate.set_month(atoi(month_str)); + outputDate.set_day(atoi(day_str)); + outputDate.set_second(0.0); + outputDate.set_decimal(0.0); + + return true ; } diff --git a/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.h b/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.h index 1e5d85d9d4149a719387705d8b7863ffb411c343..9408b16f616719bf596233ba1b84ff0cd48289a5 100644 --- a/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.h +++ b/Utilities/otbossimplugins/ossim/ossimCosmoSkymedModel.h @@ -38,58 +38,58 @@ class RefPoint; class ossimCosmoSkymedModel : public ossimGeometricSarSensorModel { public: - /** - * @brief Constructor - */ - ossimCosmoSkymedModel(); + /** + * @brief Constructor + */ + ossimCosmoSkymedModel(); - /** - * @brief Destructor - */ - ~ossimCosmoSkymedModel(); + /** + * @brief Destructor + */ + ~ossimCosmoSkymedModel(); - /** - * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) - * @param col Column coordinate of the image point - */ - virtual double getSlantRangeFromGeoreferenced(double col) const; + /** + * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) + * @param col Column coordinate of the image point + */ + virtual double getSlantRangeFromGeoreferenced(double col) const; protected: - /** - * @brief Number of columns - */ - double _nbCol; - /** - * @brief Slant Range for each Ground Range Projection reference point - */ - double _SrGr_R0 ; - /** - * @brief Slant Range for each Ground Range Projection coefficients - */ - std::vector<double> _SrGr_coeffs ; - /** - * @brief Scene Center range time - */ - double _sceneCenterRangeTime; - /** - * @brief Pixel spacing - */ - double _pixel_spacing ; + /** + * @brief Number of columns + */ + double _nbCol; + /** + * @brief Slant Range for each Ground Range Projection reference point + */ + double _SrGr_R0 ; + /** + * @brief Slant Range for each Ground Range Projection coefficients + */ + std::vector<double> _SrGr_coeffs ; + /** + * @brief Scene Center range time + */ + double _sceneCenterRangeTime; + /** + * @brief Pixel spacing + */ + double _pixel_spacing ; private: - virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Initializes the Slant Range to Ground Range data sets : - * _SrToGr_R0,_SrToGr_coeffs_number,_SrToGr_exponent,_SrToGr_coeffs,_nbCol - */ - virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Initializes the Slant Range to Ground Range data sets : + * _SrToGr_R0,_SrToGr_coeffs_number,_SrToGr_exponent,_SrToGr_coeffs,_nbCol + */ + virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); - bool UtcDateTimeStringToCivilDate(const std::string &utcString, CivilDateTime &outputDate); + bool UtcDateTimeStringToCivilDate(const std::string &utcString, CivilDateTime &outputDate); - TYPE_DATA + TYPE_DATA }; } diff --git a/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.cpp b/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.cpp index 58d6d189f1bd111bba6990a1d72315bbaf7ae7cc..ceba52f41595545327d9b9d44f200b5e2e32b8ae 100644 --- a/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.cpp @@ -31,8 +31,8 @@ namespace ossimplugins RTTI_DEF1(ossimEnvisatAsarModel, "ossimEnvisatAsarModel", ossimGeometricSarSensorModel); ossimEnvisatAsarModel::ossimEnvisatAsarModel(): - _n_srgr(0), - _pixel_spacing(0) + _n_srgr(0), + _pixel_spacing(0) { } @@ -42,153 +42,153 @@ ossimEnvisatAsarModel::~ossimEnvisatAsarModel() double ossimEnvisatAsarModel::getSlantRangeFromGeoreferenced(double col) const { - const double CLUM = 2.99792458e+8 ; + const double CLUM = 2.99792458e+8 ; - double GR, GR0, relativeGroundRange, slantRange, slantrangetime; + double GR, GR0, relativeGroundRange, slantRange, slantrangetime; - if (_n_srgr==0) return(-1) ; + if (_n_srgr==0) return(-1) ; - std::vector<double> coefset = FindSRGRSetNumber((_refPoint->get_ephemeris())->get_date()) ; + std::vector<double> coefset = FindSRGRSetNumber((_refPoint->get_ephemeris())->get_date()) ; - GR = _sensor->get_col_direction() * (col)* _pixel_spacing ; - GR0 = coefset[0]; - relativeGroundRange = GR-GR0; - slantRange = coefset[1] - + coefset[2]*relativeGroundRange - + coefset[3]*pow(relativeGroundRange,2) - + coefset[4]*pow(relativeGroundRange,3) - + coefset[5]*pow(relativeGroundRange,4); + GR = _sensor->get_col_direction() * (col)* _pixel_spacing ; + GR0 = coefset[0]; + relativeGroundRange = GR-GR0; + slantRange = coefset[1] + + coefset[2]*relativeGroundRange + + coefset[3]*pow(relativeGroundRange,2) + + coefset[4]*pow(relativeGroundRange,3) + + coefset[5]*pow(relativeGroundRange,4); - slantrangetime = 2.0*slantRange / (CLUM); - return slantRange ; + slantrangetime = 2.0*slantRange / (CLUM); + return slantRange ; } bool ossimEnvisatAsarModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix) { - const double CLUM = 2.99792458e+8; - const char* wave_length_str = kwl.find(prefix,"wave_length"); - double wave_length = CLUM / atof(wave_length_str); - const char* fr_str = kwl.find(prefix,"range_sampling_rate"); - double fr = atof(fr_str); - - // product type : Slant Range or Ground Range - _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange")); - double fa; - if (!_isProductGeoreferenced) - { - const char* fa_str = kwl.find(prefix,"prf"); - fa = atof(fa_str); - } - else - { - const char* fa_str = kwl.find(prefix,"line_time_interval"); - fa = 1.0/atof(fa_str); - } - - // TODO : v�rifier que ceci est ok pour les produits IMP - const char* time_dir_pix = "INCREASE"; - const char* time_dir_lin = "INCREASE"; - - if(_sensor != NULL) - { - delete _sensor; - } - - _sensor = new SensorParams(); - - if(strcmp(time_dir_pix, "INCREASE") == 0) - { - _sensor->set_col_direction(1); - } - else - { - _sensor->set_col_direction(-1); - } - - if(strcmp(time_dir_lin, "INCREASE") == 0) - { - _sensor->set_lin_direction(1); - } - else - { - _sensor->set_lin_direction(-1); - } - - _sensor->set_prf(fa); - _sensor->set_sf(fr); - _sensor->set_rwl(wave_length); - - return true; + const double CLUM = 2.99792458e+8; + const char* wave_length_str = kwl.find(prefix,"wave_length"); + double wave_length = CLUM / atof(wave_length_str); + const char* fr_str = kwl.find(prefix,"range_sampling_rate"); + double fr = atof(fr_str); + + // product type : Slant Range or Ground Range + _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange")); + double fa; + if (!_isProductGeoreferenced) + { + const char* fa_str = kwl.find(prefix,"prf"); + fa = atof(fa_str); + } + else + { + const char* fa_str = kwl.find(prefix,"line_time_interval"); + fa = 1.0/atof(fa_str); + } + + // TODO : v�rifier que ceci est ok pour les produits IMP + const char* time_dir_pix = "INCREASE"; + const char* time_dir_lin = "INCREASE"; + + if(_sensor != NULL) + { + delete _sensor; + } + + _sensor = new SensorParams(); + + if(strcmp(time_dir_pix, "INCREASE") == 0) + { + _sensor->set_col_direction(1); + } + else + { + _sensor->set_col_direction(-1); + } + + if(strcmp(time_dir_lin, "INCREASE") == 0) + { + _sensor->set_lin_direction(1); + } + else + { + _sensor->set_lin_direction(-1); + } + + _sensor->set_prf(fa); + _sensor->set_sf(fr); + _sensor->set_rwl(wave_length); + + return true; } bool ossimEnvisatAsarModel::InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix) { - const int neph = 5; - // long val_long; - // unsigned long val_ulong1; - // unsigned long val_ulong2; - CivilDateTime ref_civil_date; - - Ephemeris** ephemeris = new Ephemeris*[neph]; - - for (int i=1;i<=neph;i++) - { - double pos[3]; - double vel[3]; - char name[64]; - - /* - * Date de l'ephemeride - */ - sprintf(name,"state_vector_time_%i_day",i); - long day = (long) atof(kwl.find(prefix,name)); - sprintf(name,"state_vector_time_%i_sec",i); - unsigned long sec = (unsigned long) atof(kwl.find(prefix,name)); - sprintf(name,"state_vector_time_%i_microsec",i); - unsigned long microsec = (unsigned long) atof(kwl.find(prefix,name)); - MJDDateTime mjdDate(day, sec, microsec); - JSDDateTime jsd_date(mjdDate); - /* - * Position de l'ephemeride - */ - sprintf(name,"x_pos_%i",i); - pos[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; - sprintf(name,"y_pos_%i",i); - pos[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; - sprintf(name,"z_pos_%i",i); - pos[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; - /* - * Vitesse de l'ephemeride - */ - sprintf(name,"x_vel_%i",i); - vel[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; - sprintf(name,"y_vel_%i",i); - vel[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; - sprintf(name,"z_vel_%i",i); - vel[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; - - GeographicEphemeris* eph = new GeographicEphemeris(jsd_date, pos, vel); - - ephemeris[i-1] = eph; - } - - if (_platformPosition != NULL) - { - delete _platformPosition; - } - _platformPosition = new PlatformPosition(ephemeris,neph); - - /* - * Liberation de la memoire utilis�e par la liste des ephemerides - * ->Le constructeur effectue une copie des ephemerides - */ - for (int i=0;i<neph;i++) - { - delete ephemeris[i]; - } - delete[] ephemeris; - - return true; + const int neph = 5; + // long val_long; + // unsigned long val_ulong1; + // unsigned long val_ulong2; + CivilDateTime ref_civil_date; + + Ephemeris** ephemeris = new Ephemeris*[neph]; + + for (int i=1;i<=neph;i++) + { + double pos[3]; + double vel[3]; + char name[64]; + + /* + * Date de l'ephemeride + */ + sprintf(name,"state_vector_time_%i_day",i); + long day = (long) atof(kwl.find(prefix,name)); + sprintf(name,"state_vector_time_%i_sec",i); + unsigned long sec = (unsigned long) atof(kwl.find(prefix,name)); + sprintf(name,"state_vector_time_%i_microsec",i); + unsigned long microsec = (unsigned long) atof(kwl.find(prefix,name)); + MJDDateTime mjdDate(day, sec, microsec); + JSDDateTime jsd_date(mjdDate); + /* + * Position de l'ephemeride + */ + sprintf(name,"x_pos_%i",i); + pos[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; + sprintf(name,"y_pos_%i",i); + pos[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; + sprintf(name,"z_pos_%i",i); + pos[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-2; + /* + * Vitesse de l'ephemeride + */ + sprintf(name,"x_vel_%i",i); + vel[0] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; + sprintf(name,"y_vel_%i",i); + vel[1] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; + sprintf(name,"z_vel_%i",i); + vel[2] = (double) atoi(kwl.find(prefix,name)) * 1.0e-5; + + GeographicEphemeris* eph = new GeographicEphemeris(jsd_date, pos, vel); + + ephemeris[i-1] = eph; + } + + if (_platformPosition != NULL) + { + delete _platformPosition; + } + _platformPosition = new PlatformPosition(ephemeris,neph); + + /* + * Liberation de la memoire utilis�e par la liste des ephemerides + * ->Le constructeur effectue une copie des ephemerides + */ + for (int i=0;i<neph;i++) + { + delete ephemeris[i]; + } + delete[] ephemeris; + + return true; } @@ -196,176 +196,176 @@ bool ossimEnvisatAsarModel::InitPlatformPosition(const ossimKeywordlist &kwl, co bool ossimEnvisatAsarModel::InitRefPoint(const ossimKeywordlist &kwl, const char *prefix) { - // Reference image position - if(_refPoint == NULL) - { - _refPoint = new RefPoint(); - } - double sc_pix = atof(kwl.find(prefix,"samp_num")) - 1.0; - _refPoint->set_pix_col(sc_pix); - double sc_lin = atof(kwl.find(prefix,"line_num")) - 1.0; - _refPoint->set_pix_line(sc_lin); - - // Reference Point distance - double c = 2.99792458e+8; - double distance = atof(kwl.find(prefix,"slant_range_time")) * (c/2.0) * 1.0e-9; - _refPoint->set_distance(distance); - - - // Reference Point Ephemeris - long day_ref = (long)atof(kwl.find(prefix,"first_zero_doppler_time_day")); - unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_sec")); - unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_microsec")); - - MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref); - JSDDateTime jsd_date_ref(mjdDate_ref); - - if(_platformPosition != NULL) - { - Ephemeris * ephemeris = _platformPosition->Interpolate(jsd_date_ref); - if (ephemeris == NULL) return false ; - _refPoint->set_ephemeris(ephemeris); - delete ephemeris; - } - else return false; - - // Adjustement of the model using the four corner points - // in order to use ossimSensorModel::lineSampleToWorld - const char* nbCol_str = kwl.find(prefix,"num_pix"); - const char* nbLin_str = kwl.find(prefix,"num_lines"); - theImageSize.x = atoi(nbCol_str); - theImageSize.y = atoi(nbLin_str); - theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); - - // Ground Control Points extracted from the model : corner points - std::list<ossimGpt> groundGcpCoordinates ; - std::list<ossimDpt> imageGcpCoordinates ; - double h = atof(kwl.find("avg_scene_height")); - - // first line first pix - double line = atof(kwl.find("UL_line")) - 1; - double col = atof(kwl.find("UL_col")) - 1; - double lon = atof(kwl.find("UL_lon")) * 1e-6; - double lat = atof(kwl.find("UL_lat")) * 1e-6; - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP1(col,line); - ossimGpt groundGCP1(lat, lon, h); - groundGcpCoordinates.push_back(groundGCP1) ; - imageGcpCoordinates.push_back(imageGCP1) ; - // first line last pix - line = atof(kwl.find("UR_line")) - 1; - col = atof(kwl.find("UR_col")) - 1; - lon = atof(kwl.find("UR_lon")) * 1e-6; - lat = atof(kwl.find("UR_lat")) * 1e-6; - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP2(col,line); - ossimGpt groundGCP2(lat, lon, h); - groundGcpCoordinates.push_back(groundGCP2) ; - imageGcpCoordinates.push_back(imageGCP2) ; - // last line last pix - line = atof(kwl.find("LR_line")) - 1; - col = atof(kwl.find("LR_col")) - 1; - lon = atof(kwl.find("LR_lon")) * 1e-6; - lat = atof(kwl.find("LR_lat")) * 1e-6; - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP3(col,line); - ossimGpt groundGCP3(lat, lon, h); - groundGcpCoordinates.push_back(groundGCP3) ; - imageGcpCoordinates.push_back(imageGCP3) ; - // last line first pix - line = atof(kwl.find("LL_line")) - 1; - col = atof(kwl.find("LL_col")) - 1; - lon = atof(kwl.find("LL_lon")) * 1e-6; - lat = atof(kwl.find("LL_lat")) * 1e-6; - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP4(col,line); - ossimGpt groundGCP4(lat, lon, h); - groundGcpCoordinates.push_back(groundGCP4) ; - imageGcpCoordinates.push_back(imageGCP4) ; - - // Default optimization - optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; - - return true; + // Reference image position + if(_refPoint == NULL) + { + _refPoint = new RefPoint(); + } + double sc_pix = atof(kwl.find(prefix,"samp_num")) - 1.0; + _refPoint->set_pix_col(sc_pix); + double sc_lin = atof(kwl.find(prefix,"line_num")) - 1.0; + _refPoint->set_pix_line(sc_lin); + + // Reference Point distance + double c = 2.99792458e+8; + double distance = atof(kwl.find(prefix,"slant_range_time")) * (c/2.0) * 1.0e-9; + _refPoint->set_distance(distance); + + + // Reference Point Ephemeris + long day_ref = (long)atof(kwl.find(prefix,"first_zero_doppler_time_day")); + unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_sec")); + unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,"first_zero_doppler_time_microsec")); + + MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref); + JSDDateTime jsd_date_ref(mjdDate_ref); + + if(_platformPosition != NULL) + { + Ephemeris * ephemeris = _platformPosition->Interpolate(jsd_date_ref); + if (ephemeris == NULL) return false ; + _refPoint->set_ephemeris(ephemeris); + delete ephemeris; + } + else return false; + + // Adjustement of the model using the four corner points + // in order to use ossimSensorModel::lineSampleToWorld + const char* nbCol_str = kwl.find(prefix,"num_pix"); + const char* nbLin_str = kwl.find(prefix,"num_lines"); + theImageSize.x = atoi(nbCol_str); + theImageSize.y = atoi(nbLin_str); + theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); + + // Ground Control Points extracted from the model : corner points + std::list<ossimGpt> groundGcpCoordinates ; + std::list<ossimDpt> imageGcpCoordinates ; + double h = atof(kwl.find("avg_scene_height")); + + // first line first pix + double line = atof(kwl.find("UL_line")) - 1; + double col = atof(kwl.find("UL_col")) - 1; + double lon = atof(kwl.find("UL_lon")) * 1e-6; + double lat = atof(kwl.find("UL_lat")) * 1e-6; + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP1(col,line); + ossimGpt groundGCP1(lat, lon, h); + groundGcpCoordinates.push_back(groundGCP1) ; + imageGcpCoordinates.push_back(imageGCP1) ; + // first line last pix + line = atof(kwl.find("UR_line")) - 1; + col = atof(kwl.find("UR_col")) - 1; + lon = atof(kwl.find("UR_lon")) * 1e-6; + lat = atof(kwl.find("UR_lat")) * 1e-6; + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP2(col,line); + ossimGpt groundGCP2(lat, lon, h); + groundGcpCoordinates.push_back(groundGCP2) ; + imageGcpCoordinates.push_back(imageGCP2) ; + // last line last pix + line = atof(kwl.find("LR_line")) - 1; + col = atof(kwl.find("LR_col")) - 1; + lon = atof(kwl.find("LR_lon")) * 1e-6; + lat = atof(kwl.find("LR_lat")) * 1e-6; + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP3(col,line); + ossimGpt groundGCP3(lat, lon, h); + groundGcpCoordinates.push_back(groundGCP3) ; + imageGcpCoordinates.push_back(imageGCP3) ; + // last line first pix + line = atof(kwl.find("LL_line")) - 1; + col = atof(kwl.find("LL_col")) - 1; + lon = atof(kwl.find("LL_lon")) * 1e-6; + lat = atof(kwl.find("LL_lat")) * 1e-6; + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP4(col,line); + ossimGpt groundGCP4(lat, lon, h); + groundGcpCoordinates.push_back(groundGCP4) ; + imageGcpCoordinates.push_back(imageGCP4) ; + + // Default optimization + optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; + + return true; } bool ossimEnvisatAsarModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix) { - // product type : Slant Range or Ground Range - _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange")); - - // pixel spacing - _pixel_spacing = atof(kwl.find(prefix,"pixel_spacing")); - - // number of SRGR sets - _n_srgr = atoi(kwl.find(prefix,"n_srgr")); - - - char name[64]; - for (int i=0;i<_n_srgr;i++) - { - // SRGR update time - sprintf(name,"srgr_update_day%i",i); - long day_ref = (long)atof(kwl.find(prefix,name)); - sprintf(name,"srgr_update_sec%i",i); - unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,name)); - sprintf(name,"srgr_update_microsec%i",i); - unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,name)); - MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref); - JSDDateTime jsd_date_ref(mjdDate_ref); - _srgr_update.push_back(jsd_date_ref); - - std::vector<double> srgr_set; - // SRGR coefficients - sprintf(name,"srgr_coef%iA",i); - const char* srgr_coef_strA = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strA)); - sprintf(name,"srgr_coef%iB",i); - const char* srgr_coef_strB = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strB)); - sprintf(name,"srgr_coef%iC",i); - const char* srgr_coef_strC = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strC)); - sprintf(name,"srgr_coef%iD",i); - const char* srgr_coef_strD = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strD)); - sprintf(name,"srgr_coef%iE",i); - const char* srgr_coef_strE = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strE)*1e-10); - sprintf(name,"srgr_coef%iF",i); - const char* srgr_coef_strF = kwl.find(prefix,name); - srgr_set.push_back(atof(srgr_coef_strF)*1e-10); - - _srgr_coefset.push_back(srgr_set); - } - - - return true; + // product type : Slant Range or Ground Range + _isProductGeoreferenced = atoi(kwl.find(prefix,"is_groundrange")); + + // pixel spacing + _pixel_spacing = atof(kwl.find(prefix,"pixel_spacing")); + + // number of SRGR sets + _n_srgr = atoi(kwl.find(prefix,"n_srgr")); + + + char name[64]; + for (int i=0;i<_n_srgr;i++) + { + // SRGR update time + sprintf(name,"srgr_update_day%i",i); + long day_ref = (long)atof(kwl.find(prefix,name)); + sprintf(name,"srgr_update_sec%i",i); + unsigned long sec_ref = (unsigned long)atof(kwl.find(prefix,name)); + sprintf(name,"srgr_update_microsec%i",i); + unsigned long microsec_ref = (unsigned long)atof(kwl.find(prefix,name)); + MJDDateTime mjdDate_ref(day_ref, sec_ref, microsec_ref); + JSDDateTime jsd_date_ref(mjdDate_ref); + _srgr_update.push_back(jsd_date_ref); + + std::vector<double> srgr_set; + // SRGR coefficients + sprintf(name,"srgr_coef%iA",i); + const char* srgr_coef_strA = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strA)); + sprintf(name,"srgr_coef%iB",i); + const char* srgr_coef_strB = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strB)); + sprintf(name,"srgr_coef%iC",i); + const char* srgr_coef_strC = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strC)); + sprintf(name,"srgr_coef%iD",i); + const char* srgr_coef_strD = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strD)); + sprintf(name,"srgr_coef%iE",i); + const char* srgr_coef_strE = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strE)*1e-10); + sprintf(name,"srgr_coef%iF",i); + const char* srgr_coef_strF = kwl.find(prefix,name); + srgr_set.push_back(atof(srgr_coef_strF)*1e-10); + + _srgr_coefset.push_back(srgr_set); + } + + + return true; } std::vector<double> ossimEnvisatAsarModel::FindSRGRSetNumber(JSDDateTime date) const { - //if (_n_srgr==0) return NULL ; - - std::vector<double> delays; - double delay; - for (int i=0;i<_n_srgr;i++) - { - JSDDateTime datetmp(_srgr_update.at(i)); - delay = date.get_second()+date.get_decimal() - (datetmp.get_second() + datetmp.get_decimal()); - delays.push_back( fabs(delay) ); - } - - int setNumber = 0 ; - double min_delay = delays[0] ; - for (int i=1;i<_n_srgr;i++) - { - if (delays[i]<min_delay) { - setNumber = i ; - min_delay = delays[i] ; - } - } - - return _srgr_coefset[setNumber]; + //if (_n_srgr==0) return NULL ; + + std::vector<double> delays; + double delay; + for (int i=0;i<_n_srgr;i++) + { + JSDDateTime datetmp(_srgr_update.at(i)); + delay = date.get_second()+date.get_decimal() - (datetmp.get_second() + datetmp.get_decimal()); + delays.push_back( fabs(delay) ); + } + + int setNumber = 0 ; + double min_delay = delays[0] ; + for (int i=1;i<_n_srgr;i++) + { + if (delays[i]<min_delay) { + setNumber = i ; + min_delay = delays[i] ; + } + } + + return _srgr_coefset[setNumber]; } } diff --git a/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.h b/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.h index 4ba36a8dae0550f072a228c5ac42f052ae8742f1..7e82be818dbb35bae00a8d27bc20b95ed93cd98b 100644 --- a/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.h +++ b/Utilities/otbossimplugins/ossim/ossimEnvisatAsarModel.h @@ -36,54 +36,54 @@ class RefPoint; class ossimEnvisatAsarModel : public ossimGeometricSarSensorModel { public: - /** - * @brief Constructor - */ - ossimEnvisatAsarModel(); + /** + * @brief Constructor + */ + ossimEnvisatAsarModel(); - /** - * @brief Destructor - */ - ~ossimEnvisatAsarModel(); + /** + * @brief Destructor + */ + ~ossimEnvisatAsarModel(); - /** - * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) - * @param col Column coordinate of the image point - */ - virtual double getSlantRangeFromGeoreferenced(double col) const; + /** + * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) + * @param col Column coordinate of the image point + */ + virtual double getSlantRangeFromGeoreferenced(double col) const; protected: - /** - * @brief Slant Range to Ground Range (SRGR) number of coefficients sets - */ - int _n_srgr; - /** - * @brief SRGR coefficient sets - */ - std::vector< std::vector<double> > _srgr_coefset; - /** - * @brief SRGR coefficient sets update times - */ - std::vector<JSDDateTime> _srgr_update; - /** - * @brief Pixel spacing - */ - double _pixel_spacing; + /** + * @brief Slant Range to Ground Range (SRGR) number of coefficients sets + */ + int _n_srgr; + /** + * @brief SRGR coefficient sets + */ + std::vector< std::vector<double> > _srgr_coefset; + /** + * @brief SRGR coefficient sets update times + */ + std::vector<JSDDateTime> _srgr_update; + /** + * @brief Pixel spacing + */ + double _pixel_spacing; private: - virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced - */ - virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Finds the SRGR data set which update time is the closest to the center scene time - */ - std::vector<double> FindSRGRSetNumber(JSDDateTime date) const; - TYPE_DATA + virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced + */ + virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Finds the SRGR data set which update time is the closest to the center scene time + */ + std::vector<double> FindSRGRSetNumber(JSDDateTime date) const; + TYPE_DATA }; } diff --git a/Utilities/otbossimplugins/ossim/ossimErsSarModel.cpp b/Utilities/otbossimplugins/ossim/ossimErsSarModel.cpp index 132b92de7796a01c526fdb84391fc012522573cc..e6eaaaa6b7c3f669580d3865e77cf0357d83ad0e 100644 --- a/Utilities/otbossimplugins/ossim/ossimErsSarModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimErsSarModel.cpp @@ -38,8 +38,8 @@ namespace ossimplugins RTTI_DEF1(ossimErsSarModel, "ossimErsSarModel", ossimGeometricSarSensorModel); ossimErsSarModel::ossimErsSarModel(): - _n_srgr(0), - _pixel_spacing(0) + _n_srgr(0), + _pixel_spacing(0) { } @@ -54,73 +54,73 @@ ossimObject* ossimErsSarModel::dup() const double ossimErsSarModel::getSlantRangeFromGeoreferenced(double col) const { - const double c = 2.99792458e+8; - double tn = _srgr_coefset[0][0] + _srgr_coefset[0][1] * col + _srgr_coefset[0][2] * col*col ; - return tn * (c/2.0); + const double c = 2.99792458e+8; + double tn = _srgr_coefset[0][0] + _srgr_coefset[0][1] * col + _srgr_coefset[0][2] * col*col ; + return tn * (c/2.0); } bool ossimErsSarModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix) { - const char* wave_length_str = kwl.find(prefix,"wave_length"); - double wave_length = atof(wave_length_str); - const char* fr_str = kwl.find(prefix,"fr"); - double fr = atof(fr_str)*1e6; - const char* fa_str = kwl.find(prefix,"fa"); - double fa = atof(fa_str); - - ossimString time_dir_pix = kwl.find(prefix,"time_dir_pix"); - time_dir_pix.upcase(); - //std::transform(time_dir_pix.begin(), time_dir_pix.end(), time_dir_pix.begin(), toupper); - ossimString time_dir_lin = kwl.find(prefix,"time_dir_lin"); - time_dir_lin.upcase(); - //std::transform(time_dir_lin.begin(), time_dir_lin.end(), time_dir_lin.begin(), toupper); - - //ellipsoid parameters - const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); - double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m - const char* ellip_min_str = kwl.find(prefix,"ellip_min"); - double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m - - if(_sensor != NULL) - { - delete _sensor; - } - - _sensor = new SensorParams(); - - if(strcmp(time_dir_pix.c_str(), "INCREASE") == 0) - { - _sensor->set_col_direction(1); - } - else - { - _sensor->set_col_direction(-1); - } - - if(strcmp(time_dir_lin.c_str(), "INCREASE") == 0) - { - _sensor->set_lin_direction(1); - } - else - { - _sensor->set_lin_direction(-1); - } - - _sensor->set_sightDirection(SensorParams::Right) ; - - double nlooks_az = atof(kwl.find(prefix,"nlooks_az")); - _sensor->set_nAzimuthLook(nlooks_az); - double n_rnglok = atof(kwl.find(prefix,"n_rnglok")); - _sensor->set_nRangeLook(n_rnglok); - - _sensor->set_prf(fa); - _sensor->set_sf(fr); - _sensor->set_rwl(wave_length); - - _sensor->set_semiMajorAxis(ellip_maj) ; - _sensor->set_semiMinorAxis(ellip_min) ; - - return true; + const char* wave_length_str = kwl.find(prefix,"wave_length"); + double wave_length = atof(wave_length_str); + const char* fr_str = kwl.find(prefix,"fr"); + double fr = atof(fr_str)*1e6; + const char* fa_str = kwl.find(prefix,"fa"); + double fa = atof(fa_str); + + ossimString time_dir_pix = kwl.find(prefix,"time_dir_pix"); + time_dir_pix.upcase(); + //std::transform(time_dir_pix.begin(), time_dir_pix.end(), time_dir_pix.begin(), toupper); + ossimString time_dir_lin = kwl.find(prefix,"time_dir_lin"); + time_dir_lin.upcase(); + //std::transform(time_dir_lin.begin(), time_dir_lin.end(), time_dir_lin.begin(), toupper); + + //ellipsoid parameters + const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); + double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m + const char* ellip_min_str = kwl.find(prefix,"ellip_min"); + double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m + + if(_sensor != NULL) + { + delete _sensor; + } + + _sensor = new SensorParams(); + + if(strcmp(time_dir_pix.c_str(), "INCREASE") == 0) + { + _sensor->set_col_direction(1); + } + else + { + _sensor->set_col_direction(-1); + } + + if(strcmp(time_dir_lin.c_str(), "INCREASE") == 0) + { + _sensor->set_lin_direction(1); + } + else + { + _sensor->set_lin_direction(-1); + } + + _sensor->set_sightDirection(SensorParams::Right) ; + + double nlooks_az = atof(kwl.find(prefix,"nlooks_az")); + _sensor->set_nAzimuthLook(nlooks_az); + double n_rnglok = atof(kwl.find(prefix,"n_rnglok")); + _sensor->set_nRangeLook(n_rnglok); + + _sensor->set_prf(fa); + _sensor->set_sf(fr); + _sensor->set_rwl(wave_length); + + _sensor->set_semiMajorAxis(ellip_maj) ; + _sensor->set_semiMinorAxis(ellip_min) ; + + return true; } bool ossimErsSarModel::open(const ossimFilename& file) @@ -140,13 +140,13 @@ bool ossimErsSarModel::open(const ossimFilename& file) /* * Creation of the class allowing to store Leader file metadata */ - if(_ErsSarleader != NULL) - { - delete _ErsSarleader; - _ErsSarleader = NULL; - } + if(_ErsSarleader != NULL) + { + delete _ErsSarleader; + _ErsSarleader = NULL; + } - _ErsSarleader = new ErsSarLeader(); + _ErsSarleader = new ErsSarLeader(); if ( leaFilename.exists() ) { @@ -206,17 +206,17 @@ bool ossimErsSarModel::saveState(ossimKeywordlist& kwl, bool result; - char name[64]; + char name[64]; - //kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true); + //kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimErsSarModel", true); if (_ErsSarleader == NULL) - { - std::cout << "Error: ErsSarleader is NULL" << std::endl; - return false; - } + { + std::cout << "Error: ErsSarleader is NULL" << std::endl; + return false; + } - result = _ErsSarleader->saveState(kwl); + result = _ErsSarleader->saveState(kwl); if (traceDebug()) { @@ -232,297 +232,297 @@ bool ossimErsSarModel::saveState(ossimKeywordlist& kwl, bool ossimErsSarModel::InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix) { // const double PI = 3.14159265358979323846 ; - CivilDateTime ref_civil_date; - /* - * Ephemerisis reference date retrieval - */ - const char* eph_year_str = kwl.find(prefix,"eph_year"); - int eph_year = atoi(eph_year_str); - const char* eph_month_str = kwl.find(prefix,"eph_month"); - int eph_month = atoi(eph_month_str); - const char* eph_day_str = kwl.find(prefix,"eph_day"); - int eph_day = atoi(eph_day_str); - const char* eph_sec_str = kwl.find(prefix,"eph_sec"); - double eph_sec = atof(eph_sec_str); - - ref_civil_date.set_year(eph_year); - ref_civil_date.set_month(eph_month); - ref_civil_date.set_day(eph_day); - ref_civil_date.set_second((int)eph_sec); - ref_civil_date.set_decimal( eph_sec-(double)((int)eph_sec)); - - JSDDateTime ref_jsd_date(ref_civil_date); - - /* - * Ephemerisis time interval retrieval - */ - const char* eph_int_str = kwl.find(prefix, "eph_int"); - double eph_int = atof(eph_int_str); - /* - * Ephemerisis number retrieval - */ - const char* neph_str = kwl.find(prefix,"neph"); - int neph = atoi(neph_str); - - Ephemeris** ephemeris = new Ephemeris*[neph]; - - /* - * Ephemerisis retrieval - */ - for (int i=0;i<neph;i++) - { - double pos[3]; - double vit[3]; - char name[64]; - - - sprintf(name,"eph%i_posX",i); - const char* px_str = kwl.find(prefix,name); - pos[0] = atof(px_str); - - sprintf(name,"eph%i_posY",i); - const char* py_str = kwl.find(prefix,name); - pos[1] = atof(py_str); - - sprintf(name,"eph%i_posZ",i); - const char* pz_str = kwl.find(prefix,name); - pos[2] = atof(pz_str); - - - sprintf(name,"eph%i_velX",i); - const char* vx_str = kwl.find(prefix,name); - vit[0] = atof(vx_str); - - sprintf(name,"eph%i_velY",i); - const char* vy_str = kwl.find(prefix,name); - vit[1] = atof(vy_str); - - sprintf(name,"eph%i_velZ",i); - const char* vz_str = kwl.find(prefix,name); - vit[2] = atof(vz_str); - - /* - * Ephemerisis date - */ - JSDDateTime date(ref_jsd_date); - date.set_second(date.get_second() + i * eph_int); - date.NormDate(); - - GeographicEphemeris* eph = new GeographicEphemeris(date, pos, vit); - - ephemeris[i] = eph; - } - - /* - * Antenna position interpolator creation - */ - if (_platformPosition != NULL) - { - delete _platformPosition; - } - _platformPosition = new PlatformPosition(ephemeris,neph); - - /* - * Free of memory used by the ephemerisis list - */ - for (int i=0;i<neph;i++) - { - delete ephemeris[i]; - } - delete[] ephemeris; - - return true; + CivilDateTime ref_civil_date; + /* + * Ephemerisis reference date retrieval + */ + const char* eph_year_str = kwl.find(prefix,"eph_year"); + int eph_year = atoi(eph_year_str); + const char* eph_month_str = kwl.find(prefix,"eph_month"); + int eph_month = atoi(eph_month_str); + const char* eph_day_str = kwl.find(prefix,"eph_day"); + int eph_day = atoi(eph_day_str); + const char* eph_sec_str = kwl.find(prefix,"eph_sec"); + double eph_sec = atof(eph_sec_str); + + ref_civil_date.set_year(eph_year); + ref_civil_date.set_month(eph_month); + ref_civil_date.set_day(eph_day); + ref_civil_date.set_second((int)eph_sec); + ref_civil_date.set_decimal( eph_sec-(double)((int)eph_sec)); + + JSDDateTime ref_jsd_date(ref_civil_date); + + /* + * Ephemerisis time interval retrieval + */ + const char* eph_int_str = kwl.find(prefix, "eph_int"); + double eph_int = atof(eph_int_str); + /* + * Ephemerisis number retrieval + */ + const char* neph_str = kwl.find(prefix,"neph"); + int neph = atoi(neph_str); + + Ephemeris** ephemeris = new Ephemeris*[neph]; + + /* + * Ephemerisis retrieval + */ + for (int i=0;i<neph;i++) + { + double pos[3]; + double vit[3]; + char name[64]; + + + sprintf(name,"eph%i_posX",i); + const char* px_str = kwl.find(prefix,name); + pos[0] = atof(px_str); + + sprintf(name,"eph%i_posY",i); + const char* py_str = kwl.find(prefix,name); + pos[1] = atof(py_str); + + sprintf(name,"eph%i_posZ",i); + const char* pz_str = kwl.find(prefix,name); + pos[2] = atof(pz_str); + + + sprintf(name,"eph%i_velX",i); + const char* vx_str = kwl.find(prefix,name); + vit[0] = atof(vx_str); + + sprintf(name,"eph%i_velY",i); + const char* vy_str = kwl.find(prefix,name); + vit[1] = atof(vy_str); + + sprintf(name,"eph%i_velZ",i); + const char* vz_str = kwl.find(prefix,name); + vit[2] = atof(vz_str); + + /* + * Ephemerisis date + */ + JSDDateTime date(ref_jsd_date); + date.set_second(date.get_second() + i * eph_int); + date.NormDate(); + + GeographicEphemeris* eph = new GeographicEphemeris(date, pos, vit); + + ephemeris[i] = eph; + } + + /* + * Antenna position interpolator creation + */ + if (_platformPosition != NULL) + { + delete _platformPosition; + } + _platformPosition = new PlatformPosition(ephemeris,neph); + + /* + * Free of memory used by the ephemerisis list + */ + for (int i=0;i<neph;i++) + { + delete ephemeris[i]; + } + delete[] ephemeris; + + return true; } bool ossimErsSarModel::InitRefPoint(const ossimKeywordlist &kwl, const char *prefix) { - const char* sc_lin_str = kwl.find(prefix,"sc_lin"); - double sc_lin = atof(sc_lin_str); - - const char* sc_pix_str = kwl.find(prefix,"sc_pix"); - double sc_pix = atof(sc_pix_str); - - const char* inp_sctim_str = kwl.find(prefix,"inp_sctim"); - - const char* rng_gate_str = kwl.find(prefix,"zero_dop_range_time_f_pixel"); - double rng_gate = atof(rng_gate_str); - - if(_refPoint == NULL) - { - _refPoint = new RefPoint(); - } - - _refPoint->set_pix_col(sc_pix); - _refPoint->set_pix_line(sc_lin); - - char year_str[5]; - for (int i=0;i<4;i++) - { - year_str[i] = inp_sctim_str[i]; - } - year_str[4] = '\0'; - - char month_str[3]; - for (int i=4;i<6;i++) - { - month_str[i-4] = inp_sctim_str[i]; - } - month_str[2] = '\0'; - - char day_str[3]; - for (int i=6;i<8;i++) - { - day_str[i-6] = inp_sctim_str[i]; - } - day_str[2] = '\0'; - - char hour_str[3]; - for (int i=8;i<10;i++) - { - hour_str[i-8] = inp_sctim_str[i]; - } - hour_str[2] = '\0'; - - char min_str[3]; - for (int i=10;i<12;i++) - { - min_str[i-10] = inp_sctim_str[i]; - } - min_str[2] = '\0'; - - char sec_str[3]; - for (int i=12;i<14;i++) - { - sec_str[i-12] = inp_sctim_str[i]; - } - sec_str[2] = '\0'; - - char mili_str[4]; - for (int i=14;i<17;i++) - { - mili_str[i-14] = inp_sctim_str[i]; - } - mili_str[3] = '\0'; - - int year = atoi(year_str); - int month = atoi(month_str); - int day = atoi(day_str); - int hour = atoi(hour_str); - int min = atoi(min_str); - int sec = atoi(sec_str); - double mili = atof(mili_str); - - - CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili/1000.0); - - if(_platformPosition != NULL) - { - Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date); - if (ephemeris == NULL) return false ; - _refPoint->set_ephemeris(ephemeris); - - delete ephemeris; - } - else - { - return false; - } - - double c = 2.99792458e+8; - - double distance = (rng_gate*1e-3 + ((double)sc_pix)*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); - - _refPoint->set_distance(distance); - - // in order to use ossimSensorModel::lineSampleToWorld - const char* nbCol_str = kwl.find(prefix,"num_pix"); - const char* nbLin_str = kwl.find(prefix,"num_lines"); - theImageSize.x = atoi(nbCol_str); - theImageSize.y = atoi(nbLin_str); - theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); - - // Ground Control Points extracted from the model : corner points - std::list<ossimGpt> groundGcpCoordinates ; - std::list<ossimDpt> imageGcpCoordinates ; - // first line first pix - const char* lon_str = kwl.find("first_line_first_pixel_lon"); - double lon = atof(lon_str); - const char* lat_str = kwl.find("first_line_first_pixel_lat"); - double lat = atof(lat_str); - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP1(0,0); - ossimGpt groundGCP1(lat, lon, 0.0); - groundGcpCoordinates.push_back(groundGCP1) ; - imageGcpCoordinates.push_back(imageGCP1) ; - // first line last pix - lon_str = kwl.find("first_line_last_pixel_lon"); - lon = atof(lon_str); - lat_str = kwl.find("first_line_last_pixel_lat"); - lat = atof(lat_str); - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP2(theImageSize.x-1, 0); - ossimGpt groundGCP2(lat, lon, 0.0); - groundGcpCoordinates.push_back(groundGCP2) ; - imageGcpCoordinates.push_back(imageGCP2) ; - // last line last pix - lon_str = kwl.find("last_line_last_pixel_lon"); - lon = atof(lon_str); - lat_str = kwl.find("last_line_last_pixel_lat"); - lat = atof(lat_str); - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP3(theImageSize.x-1,theImageSize.y-1); - ossimGpt groundGCP3(lat, lon, 0.0); - groundGcpCoordinates.push_back(groundGCP3) ; - imageGcpCoordinates.push_back(imageGCP3) ; - // last line first pix - lon_str = kwl.find("last_line_first_pixel_lon"); - lon = atof(lon_str); - lat_str = kwl.find("last_line_first_pixel_lat"); - lat = atof(lat_str); - if (lon > 180.0) lon -= 360.0; - ossimDpt imageGCP4(0,theImageSize.y-1); - ossimGpt groundGCP4(lat, lon, 0.0); - groundGcpCoordinates.push_back(groundGCP4) ; - imageGcpCoordinates.push_back(imageGCP4) ; - - // Default optimization - optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; - - return true; + const char* sc_lin_str = kwl.find(prefix,"sc_lin"); + double sc_lin = atof(sc_lin_str); + + const char* sc_pix_str = kwl.find(prefix,"sc_pix"); + double sc_pix = atof(sc_pix_str); + + const char* inp_sctim_str = kwl.find(prefix,"inp_sctim"); + + const char* rng_gate_str = kwl.find(prefix,"zero_dop_range_time_f_pixel"); + double rng_gate = atof(rng_gate_str); + + if(_refPoint == NULL) + { + _refPoint = new RefPoint(); + } + + _refPoint->set_pix_col(sc_pix); + _refPoint->set_pix_line(sc_lin); + + char year_str[5]; + for (int i=0;i<4;i++) + { + year_str[i] = inp_sctim_str[i]; + } + year_str[4] = '\0'; + + char month_str[3]; + for (int i=4;i<6;i++) + { + month_str[i-4] = inp_sctim_str[i]; + } + month_str[2] = '\0'; + + char day_str[3]; + for (int i=6;i<8;i++) + { + day_str[i-6] = inp_sctim_str[i]; + } + day_str[2] = '\0'; + + char hour_str[3]; + for (int i=8;i<10;i++) + { + hour_str[i-8] = inp_sctim_str[i]; + } + hour_str[2] = '\0'; + + char min_str[3]; + for (int i=10;i<12;i++) + { + min_str[i-10] = inp_sctim_str[i]; + } + min_str[2] = '\0'; + + char sec_str[3]; + for (int i=12;i<14;i++) + { + sec_str[i-12] = inp_sctim_str[i]; + } + sec_str[2] = '\0'; + + char mili_str[4]; + for (int i=14;i<17;i++) + { + mili_str[i-14] = inp_sctim_str[i]; + } + mili_str[3] = '\0'; + + int year = atoi(year_str); + int month = atoi(month_str); + int day = atoi(day_str); + int hour = atoi(hour_str); + int min = atoi(min_str); + int sec = atoi(sec_str); + double mili = atof(mili_str); + + + CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili/1000.0); + + if(_platformPosition != NULL) + { + Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date); + if (ephemeris == NULL) return false ; + _refPoint->set_ephemeris(ephemeris); + + delete ephemeris; + } + else + { + return false; + } + + double c = 2.99792458e+8; + + double distance = (rng_gate*1e-3 + ((double)sc_pix)*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); + + _refPoint->set_distance(distance); + + // in order to use ossimSensorModel::lineSampleToWorld + const char* nbCol_str = kwl.find(prefix,"num_pix"); + const char* nbLin_str = kwl.find(prefix,"num_lines"); + theImageSize.x = atoi(nbCol_str); + theImageSize.y = atoi(nbLin_str); + theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); + + // Ground Control Points extracted from the model : corner points + std::list<ossimGpt> groundGcpCoordinates ; + std::list<ossimDpt> imageGcpCoordinates ; + // first line first pix + const char* lon_str = kwl.find("first_line_first_pixel_lon"); + double lon = atof(lon_str); + const char* lat_str = kwl.find("first_line_first_pixel_lat"); + double lat = atof(lat_str); + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP1(0,0); + ossimGpt groundGCP1(lat, lon, 0.0); + groundGcpCoordinates.push_back(groundGCP1) ; + imageGcpCoordinates.push_back(imageGCP1) ; + // first line last pix + lon_str = kwl.find("first_line_last_pixel_lon"); + lon = atof(lon_str); + lat_str = kwl.find("first_line_last_pixel_lat"); + lat = atof(lat_str); + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP2(theImageSize.x-1, 0); + ossimGpt groundGCP2(lat, lon, 0.0); + groundGcpCoordinates.push_back(groundGCP2) ; + imageGcpCoordinates.push_back(imageGCP2) ; + // last line last pix + lon_str = kwl.find("last_line_last_pixel_lon"); + lon = atof(lon_str); + lat_str = kwl.find("last_line_last_pixel_lat"); + lat = atof(lat_str); + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP3(theImageSize.x-1,theImageSize.y-1); + ossimGpt groundGCP3(lat, lon, 0.0); + groundGcpCoordinates.push_back(groundGCP3) ; + imageGcpCoordinates.push_back(imageGCP3) ; + // last line first pix + lon_str = kwl.find("last_line_first_pixel_lon"); + lon = atof(lon_str); + lat_str = kwl.find("last_line_first_pixel_lat"); + lat = atof(lat_str); + if (lon > 180.0) lon -= 360.0; + ossimDpt imageGCP4(0,theImageSize.y-1); + ossimGpt groundGCP4(lat, lon, 0.0); + groundGcpCoordinates.push_back(groundGCP4) ; + imageGcpCoordinates.push_back(imageGCP4) ; + + // Default optimization + optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; + + return true; } bool ossimErsSarModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix) { - // Product type = PRI - ossimString filename(kwl.find("filename")); - filename.upcase(); - //std::transform(filename.begin(), filename.end(), filename.begin(), toupper); - string::size_type loc = filename.find("PRI"); - if( loc != string::npos ) { + // Product type = PRI + ossimString filename(kwl.find("filename")); + filename.upcase(); + //std::transform(filename.begin(), filename.end(), filename.begin(), toupper); + string::size_type loc = filename.find("PRI"); + if( loc != string::npos ) { _isProductGeoreferenced = true; } else { _isProductGeoreferenced = false; } - // Number of SRGR Coef - _n_srgr = 3; + // Number of SRGR Coef + _n_srgr = 3; - // Range time for first mid and last pixel - double t1 = atof(kwl.find("zero_dop_range_time_f_pixel"))*1e-3; - double t2 = atof(kwl.find("zero_dop_range_time_c_pixel"))*1e-3; - double t3 = atof(kwl.find("zero_dop_range_time_l_pixel"))*1e-3; + // Range time for first mid and last pixel + double t1 = atof(kwl.find("zero_dop_range_time_f_pixel"))*1e-3; + double t2 = atof(kwl.find("zero_dop_range_time_c_pixel"))*1e-3; + double t3 = atof(kwl.find("zero_dop_range_time_l_pixel"))*1e-3; - // Range pixels numbers corresponding - // Todo : check if it works with "DECREASING LINE TIME" - // double x1 = 0.0; - double x2 = atof(kwl.find("sc_pix")) - 1.0; - double x3 = 2.0*(x2+1.0) -1.0 ; + // Range pixels numbers corresponding + // Todo : check if it works with "DECREASING LINE TIME" + // double x1 = 0.0; + double x2 = atof(kwl.find("sc_pix")) - 1.0; + double x3 = 2.0*(x2+1.0) -1.0 ; - _srgr_coefset[0][0] = t1; - _srgr_coefset[0][1] = ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3)); - _srgr_coefset[0][2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3); + _srgr_coefset[0][0] = t1; + _srgr_coefset[0][1] = ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3)); + _srgr_coefset[0][2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3); - return true; + return true; } bool ossimErsSarModel::isErsLeader(const ossimFilename& file) const diff --git a/Utilities/otbossimplugins/ossim/ossimErsSarModel.h b/Utilities/otbossimplugins/ossim/ossimErsSarModel.h index f35b700db00e4f116b130359d7728f804bfa1b62..cf2c6243f409480ad45ffa814dec4cdadc40f321 100644 --- a/Utilities/otbossimplugins/ossim/ossimErsSarModel.h +++ b/Utilities/otbossimplugins/ossim/ossimErsSarModel.h @@ -37,26 +37,26 @@ class ErsSarLeader; class ossimErsSarModel : public ossimGeometricSarSensorModel { public: - /** - * @brief Constructor - */ - ossimErsSarModel(); + /** + * @brief Constructor + */ + ossimErsSarModel(); - /** - * @brief Destructor - */ - ~ossimErsSarModel(); + /** + * @brief Destructor + */ + ~ossimErsSarModel(); /** * @brief Returns pointer to a new instance, copy of this. */ virtual ossimObject* dup() const; - /** - * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) - * @param col Column coordinate of the image point - */ - virtual double getSlantRangeFromGeoreferenced(double col) const; + /** + * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) + * @param col Column coordinate of the image point + */ + virtual double getSlantRangeFromGeoreferenced(double col) const; /** * @brief Method to instantiate model from the leader file. @@ -75,38 +75,38 @@ public: const char* prefix=0) const; protected: - /** - * @brief Slant Range for each Ground Range (SRGR) number of coefficients sets - */ - int _n_srgr; - /** - * @brief SRGR coefficient sets - */ - double _srgr_coefset[1][3]; - /** - * @brief Pixel spacing - */ - double _pixel_spacing; - - /** - * @brief List of metadata contained in the Leader file - */ - ErsSarLeader *_ErsSarleader; + /** + * @brief Slant Range for each Ground Range (SRGR) number of coefficients sets + */ + int _n_srgr; + /** + * @brief SRGR coefficient sets + */ + double _srgr_coefset[1][3]; + /** + * @brief Pixel spacing + */ + double _pixel_spacing; + + /** + * @brief List of metadata contained in the Leader file + */ + ErsSarLeader *_ErsSarleader; private: - virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced - */ - virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); - - virtual bool isErsLeader(const ossimFilename& file) const; + virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced + */ + virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); + + virtual bool isErsLeader(const ossimFilename& file) const; virtual ossimFilename findErsLeader(const ossimFilename& file) const; - TYPE_DATA + TYPE_DATA }; diff --git a/Utilities/otbossimplugins/ossim/ossimGeometricSarSensorModel.cpp b/Utilities/otbossimplugins/ossim/ossimGeometricSarSensorModel.cpp index f60abd14a15f61cf57ce5dd4f99b12a7deaf6a9c..4b4d097fb17f4b7952200a26e34c448ee745617a 100644 --- a/Utilities/otbossimplugins/ossim/ossimGeometricSarSensorModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimGeometricSarSensorModel.cpp @@ -248,12 +248,12 @@ bool ossimGeometricSarSensorModel::optimizeModel(const std::list<ossimGpt> & gro //std::list<ossimDpt>::iterator itEstimatedCoords = inverseLocResults.begin() ; //while ((itActualCoords != imageCoordinates.end())&&(itEstimatedCoords != inverseLocResults.end())) { // - // columnBias += (itActualCoords->x - itEstimatedCoords->x ) ; - // lineBias += (itActualCoords->y - itEstimatedCoords->y ) ; + // columnBias += (itActualCoords->x - itEstimatedCoords->x ) ; + // lineBias += (itActualCoords->y - itEstimatedCoords->y ) ; // - // nbPtsUsed++; - // itActualCoords++; - // itEstimatedCoords++; + // nbPtsUsed++; + // itActualCoords++; + // itEstimatedCoords++; //} //// Computation of bias in line and column : mean deviations diff --git a/Utilities/otbossimplugins/ossim/ossimPluginProjectionFactory.cpp b/Utilities/otbossimplugins/ossim/ossimPluginProjectionFactory.cpp index 8015d67e3a1494a920f0c57d72cb011547d7aa1a..e2becab843295629fa9d3cddb6bda48becb447b0 100644 --- a/Utilities/otbossimplugins/ossim/ossimPluginProjectionFactory.cpp +++ b/Utilities/otbossimplugins/ossim/ossimPluginProjectionFactory.cpp @@ -86,19 +86,19 @@ ossimProjection* ossimPluginProjectionFactory::createProjection( { // if (name == STATIC_TYPE_NAME(ossimRadarSatModel)) // { -// return new ossimRadarSatModel; +// return new ossimRadarSatModel; // } // else if (name == STATIC_TYPE_NAME(ossimEnvisatAsarModel)) // { -// return new ossimEnvisatAsarModel; +// return new ossimEnvisatAsarModel; // } -// else if (name == STATIC_TYPE_NAME(ossimTerraSarModel)) +// else if (name == STATIC_TYPE_NAME(ossimTerraSarModel)) // { -// return new ossimTerraSarModel; +// return new ossimTerraSarModel; // } - // else if (name == STATIC_TYPE_NAME(ossimCosmoSkymedModel)) + // else if (name == STATIC_TYPE_NAME(ossimCosmoSkymedModel)) // { - // return new ossimCosmoSkymedModel; + // return new ossimCosmoSkymedModel; // } if (name == STATIC_TYPE_NAME(ossimRadarSat2Model)) { diff --git a/Utilities/otbossimplugins/ossim/ossimRadarSat2Model.cpp b/Utilities/otbossimplugins/ossim/ossimRadarSat2Model.cpp index 225aeae5335947db1a75f42bfc61de7802a16fed..eb2fffd2a7b19684e78a37131fc24fd87859e649 100644 --- a/Utilities/otbossimplugins/ossim/ossimRadarSat2Model.cpp +++ b/Utilities/otbossimplugins/ossim/ossimRadarSat2Model.cpp @@ -344,7 +344,7 @@ bool ossimRadarSat2Model::InitSensorParams(const ossimKeywordlist &kwl, //ellipsoid parameters const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); - double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m + double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m const char* ellip_min_str = kwl.find(prefix,"ellip_min"); double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m @@ -487,8 +487,8 @@ bool ossimRadarSat2Model::InitRefPoint(const ossimKeywordlist &kwl, _refPoint = new RefPoint(); } - _refPoint->set_pix_col(0); // upper left corner - _refPoint->set_pix_line(0); // upper left corner + _refPoint->set_pix_col(0); // upper left corner + _refPoint->set_pix_line(0); // upper left corner const char* zeroDopplerTimeFirstLine_str = kwl.find(prefix,"zeroDopplerTimeFirstLine"); std::string zeroDopplerTimeFirstLine(zeroDopplerTimeFirstLine_str); @@ -852,7 +852,7 @@ bool ossimRadarSat2Model::initRefPoint(const ossimXmlDocument* xdoc, // no reference point (e.g. scene center) is given in the annotation file // we choose to use the upper left corner as reference point _refPoint->set_pix_col(0); // upper left corner - _refPoint->set_pix_line(0); // upper left corner + _refPoint->set_pix_line(0); // upper left corner } ossimString s; diff --git a/Utilities/otbossimplugins/ossim/ossimRadarSat2ProductDoc.cpp b/Utilities/otbossimplugins/ossim/ossimRadarSat2ProductDoc.cpp index 1221db539c766e885ad3c2d252d9a36eb518dbed..94806f4d51164cc45fbb5bc36c41f4d731e49ebe 100644 --- a/Utilities/otbossimplugins/ossim/ossimRadarSat2ProductDoc.cpp +++ b/Utilities/otbossimplugins/ossim/ossimRadarSat2ProductDoc.cpp @@ -218,7 +218,7 @@ bool ossimRadarSat2ProductDoc::initPlatformPosition( ephemeris[i] = eph; ++nbrData; - } // matches: for (int i = 0 ; i < nbrData; ++i) + } // matches: for (int i = 0 ; i < nbrData; ++i) if (result) { diff --git a/Utilities/otbossimplugins/ossim/ossimRadarSatModel.cpp b/Utilities/otbossimplugins/ossim/ossimRadarSatModel.cpp index e080eaaf10ea65cc9b7cf2f60730387dc10bcc92..053b9f89d871a7acd5437731b93fc641712c6abf 100644 --- a/Utilities/otbossimplugins/ossim/ossimRadarSatModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimRadarSatModel.cpp @@ -33,8 +33,8 @@ namespace ossimplugins RTTI_DEF1(ossimRadarSatModel, "ossimRadarSatModel", ossimGeometricSarSensorModel); ossimRadarSatModel::ossimRadarSatModel(): - _n_srgr(0), - _pixel_spacing(0) + _n_srgr(0), + _pixel_spacing(0) { } @@ -49,535 +49,535 @@ ossimString ossimRadarSatModel::getClassName() const double ossimRadarSatModel::getSlantRangeFromGeoreferenced(double col) const { - if (_n_srgr==0) return(-1) ; + if (_n_srgr==0) return(-1) ; - double relativeGroundRange ; + double relativeGroundRange ; - // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range - relativeGroundRange = _refPoint->get_distance() + _sensor->get_col_direction() * (col-_refPoint->get_pix_col())* _pixel_spacing ; + // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range + relativeGroundRange = _refPoint->get_distance() + _sensor->get_col_direction() * (col-_refPoint->get_pix_col())* _pixel_spacing ; - int numSet = FindSRGRSetNumber((_refPoint->get_ephemeris())->get_date()) ; - /** - * @todo : could be improved (date choice) - */ + int numSet = FindSRGRSetNumber((_refPoint->get_ephemeris())->get_date()) ; + /** + * @todo : could be improved (date choice) + */ - double slantRange = _srgr_coefset[numSet][0] - + _srgr_coefset[numSet][1]*relativeGroundRange - + _srgr_coefset[numSet][2]*pow(relativeGroundRange,2) - + _srgr_coefset[numSet][3]*pow(relativeGroundRange,3) - + _srgr_coefset[numSet][4]*pow(relativeGroundRange,4) - + _srgr_coefset[numSet][5]*pow(relativeGroundRange,5); + double slantRange = _srgr_coefset[numSet][0] + + _srgr_coefset[numSet][1]*relativeGroundRange + + _srgr_coefset[numSet][2]*pow(relativeGroundRange,2) + + _srgr_coefset[numSet][3]*pow(relativeGroundRange,3) + + _srgr_coefset[numSet][4]*pow(relativeGroundRange,4) + + _srgr_coefset[numSet][5]*pow(relativeGroundRange,5); - return slantRange ; + return slantRange ; } bool ossimRadarSatModel::InitSensorParams(const ossimKeywordlist &kwl, const char *prefix) { - const char* wave_length_str = kwl.find(prefix,"wave_length"); - double wave_length = atof(wave_length_str); - const char* fr_str = kwl.find(prefix,"fr"); - double fr = atof(fr_str); - const char* fa_str = kwl.find(prefix,"fa"); - double fa = atof(fa_str); - - /* //number of different looks - const char* n_azilok_str = kwl.find(prefix,"n_azilok"); - double n_azilok = atof(n_azilok_str); - const char* n_rnglok_str = kwl.find(prefix,"n_rnglok"); - double n_rnglok = atof(n_rnglok_str); - */ - - // look bandwidth rate (for localisation purpose) - const char* bnd_azilok_str = kwl.find(prefix,"bnd_azilok"); - double bnd_azilok = atof(bnd_azilok_str); - const char* bnd_rnglok_str = kwl.find(prefix,"bnd_rnglok"); - double bnd_rnglok = atof(bnd_rnglok_str); - const char* bnd_azi_str = kwl.find(prefix,"bnd_azi"); - double bnd_azi = atof(bnd_azi_str); - const char* bnd_rng_str = kwl.find(prefix,"bnd_rng"); - double bnd_rng = atof(bnd_rng_str); - - double n_azilok = bnd_azi/bnd_azilok; - double n_rnglok = bnd_rng/bnd_rnglok; - - const char* time_dir_pix = kwl.find(prefix,"time_dir_pix"); - const char* time_dir_lin = kwl.find(prefix,"time_dir_lin"); - - //ellipsoid parameters - const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); - double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m - const char* ellip_min_str = kwl.find(prefix,"ellip_min"); - double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m - - if(_sensor != NULL) - { - delete _sensor; - } - - _sensor = new SensorParams(); - - if(strcmp(time_dir_pix, "INCREASE") == 0) - { - _sensor->set_col_direction(1); - } - else - { - _sensor->set_col_direction(-1); - } - - if(strcmp(time_dir_lin, "INCREASE") == 0) - { - _sensor->set_lin_direction(1); - } - else - { - _sensor->set_lin_direction(-1); - } - - const char* lookDirection_str = kwl.find(prefix,"lookDirection"); - ossimString lookDirection(lookDirection_str) ; - lookDirection.trim(" ") ; // eliminates trailing blanks - if (lookDirection == "NORMAL") _sensor->set_sightDirection(SensorParams::Right) ; - else _sensor->set_sightDirection(SensorParams::Left) ; - - _sensor->set_prf(fa); - _sensor->set_sf(fr); - _sensor->set_rwl(wave_length); - _sensor->set_nAzimuthLook(n_azilok); - _sensor->set_nRangeLook(n_rnglok); - - _sensor->set_semiMajorAxis(ellip_maj) ; - _sensor->set_semiMinorAxis(ellip_min) ; - - return true; + const char* wave_length_str = kwl.find(prefix,"wave_length"); + double wave_length = atof(wave_length_str); + const char* fr_str = kwl.find(prefix,"fr"); + double fr = atof(fr_str); + const char* fa_str = kwl.find(prefix,"fa"); + double fa = atof(fa_str); + + /* //number of different looks + const char* n_azilok_str = kwl.find(prefix,"n_azilok"); + double n_azilok = atof(n_azilok_str); + const char* n_rnglok_str = kwl.find(prefix,"n_rnglok"); + double n_rnglok = atof(n_rnglok_str); + */ + + // look bandwidth rate (for localisation purpose) + const char* bnd_azilok_str = kwl.find(prefix,"bnd_azilok"); + double bnd_azilok = atof(bnd_azilok_str); + const char* bnd_rnglok_str = kwl.find(prefix,"bnd_rnglok"); + double bnd_rnglok = atof(bnd_rnglok_str); + const char* bnd_azi_str = kwl.find(prefix,"bnd_azi"); + double bnd_azi = atof(bnd_azi_str); + const char* bnd_rng_str = kwl.find(prefix,"bnd_rng"); + double bnd_rng = atof(bnd_rng_str); + + double n_azilok = bnd_azi/bnd_azilok; + double n_rnglok = bnd_rng/bnd_rnglok; + + const char* time_dir_pix = kwl.find(prefix,"time_dir_pix"); + const char* time_dir_lin = kwl.find(prefix,"time_dir_lin"); + + //ellipsoid parameters + const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); + double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m + const char* ellip_min_str = kwl.find(prefix,"ellip_min"); + double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m + + if(_sensor != NULL) + { + delete _sensor; + } + + _sensor = new SensorParams(); + + if(strcmp(time_dir_pix, "INCREASE") == 0) + { + _sensor->set_col_direction(1); + } + else + { + _sensor->set_col_direction(-1); + } + + if(strcmp(time_dir_lin, "INCREASE") == 0) + { + _sensor->set_lin_direction(1); + } + else + { + _sensor->set_lin_direction(-1); + } + + const char* lookDirection_str = kwl.find(prefix,"lookDirection"); + ossimString lookDirection(lookDirection_str) ; + lookDirection.trim(" ") ; // eliminates trailing blanks + if (lookDirection == "NORMAL") _sensor->set_sightDirection(SensorParams::Right) ; + else _sensor->set_sightDirection(SensorParams::Left) ; + + _sensor->set_prf(fa); + _sensor->set_sf(fr); + _sensor->set_rwl(wave_length); + _sensor->set_nAzimuthLook(n_azilok); + _sensor->set_nRangeLook(n_rnglok); + + _sensor->set_semiMajorAxis(ellip_maj) ; + _sensor->set_semiMinorAxis(ellip_min) ; + + return true; } bool ossimRadarSatModel::InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix) { - const double _PI = 3.14159265358979323846 ; - CivilDateTime ref_civil_date; - /* - * Ephemerisis reference date retrieval - */ - const char* eph_year_str = kwl.find(prefix,"eph_year"); - int eph_year = atoi(eph_year_str); - const char* eph_month_str = kwl.find(prefix,"eph_month"); - int eph_month = atoi(eph_month_str); - const char* eph_day_str = kwl.find(prefix,"eph_day"); - int eph_day = atoi(eph_day_str); - const char* eph_sec_str = kwl.find(prefix,"eph_sec"); - double eph_sec = atof(eph_sec_str); - - ref_civil_date.set_year(eph_year); - ref_civil_date.set_month(eph_month); - ref_civil_date.set_day(eph_day); - ref_civil_date.set_second((int)eph_sec); - ref_civil_date.set_decimal( eph_sec-(double)((int)eph_sec)); - - - JSDDateTime ref_jsd_date(ref_civil_date); - - const char* eph_int_str = kwl.find(prefix, "eph_int"); - double eph_int = atof(eph_int_str); - /* - * Ephemerisis number retrieval - */ - const char* neph_str = kwl.find(prefix,"neph"); - int neph = atoi(neph_str); - - Ephemeris** ephemeris = new Ephemeris*[neph]; - - const char* hr_angle_str = kwl.find(prefix,"hr_angle"); - double greenwich_mha_ref = atof(hr_angle_str); - - GMSTDateTime * greenwich_mha_ref2000 = new GMSTDateTime(); - greenwich_mha_ref2000->set_origine(GMSTDateTime::AN2000); - ref_civil_date.AsGMSTDateTime(greenwich_mha_ref2000); - - /* - * Ephemerisis retrieval - */ - for (int i=0;i<neph;i++) - { - double pos[3]; - double vit[3]; - char name[64]; - - - sprintf(name,"eph%i_posX",i); - const char* px_str = kwl.find(prefix,name); - pos[0] = atof(px_str); - - sprintf(name,"eph%i_posY",i); - const char* py_str = kwl.find(prefix,name); - pos[1] = atof(py_str); - - sprintf(name,"eph%i_posZ",i); - const char* pz_str = kwl.find(prefix,name); - pos[2] = atof(pz_str); - - - sprintf(name,"eph%i_velX",i); - const char* vx_str = kwl.find(prefix,name); - vit[0] = atof(vx_str) * 1.0e-3;; - - sprintf(name,"eph%i_velY",i); - const char* vy_str = kwl.find(prefix,name); - vit[1] = atof(vy_str) * 1.0e-3;; - - sprintf(name,"eph%i_velZ",i); - const char* vz_str = kwl.find(prefix,name); - vit[2] = atof(vz_str) * 1.0e-3;; - - /* - * Ephemerisis date - */ - JSDDateTime date(ref_jsd_date); - date.set_second(date.get_second() + i * eph_int); - date.NormDate(); - - /* - * Date creation for referential change - */ - GMSTDateTime * greenwich_mha = new GMSTDateTime(); - greenwich_mha->set_origine(GMSTDateTime::AN2000); - date.AsGMSTDateTime(greenwich_mha); - - double angle = greenwich_mha_ref+(greenwich_mha->get_tms()-greenwich_mha_ref2000->get_tms())*180.0/_PI; - angle = fmod(angle,360.0); - - /* - * Referential change - */ - GalileanEphemeris * tmpEphemeris = new GalileanEphemeris(date,pos,vit); - GeographicEphemeris* eph = new GeographicEphemeris(); - - tmpEphemeris->ToGeographic(angle,eph); - ephemeris[i] = eph; - - delete tmpEphemeris; - - } - - /* - * Antenna position interpolator creation - */ - if (_platformPosition != NULL) - { - delete _platformPosition; - } - _platformPosition = new PlatformPosition(ephemeris,neph); - - /* - * Free of memory used by the ephemerisis list - */ - for (int i=0;i<neph;i++) - { - delete ephemeris[i]; - } - delete[] ephemeris; - - return true; + const double _PI = 3.14159265358979323846 ; + CivilDateTime ref_civil_date; + /* + * Ephemerisis reference date retrieval + */ + const char* eph_year_str = kwl.find(prefix,"eph_year"); + int eph_year = atoi(eph_year_str); + const char* eph_month_str = kwl.find(prefix,"eph_month"); + int eph_month = atoi(eph_month_str); + const char* eph_day_str = kwl.find(prefix,"eph_day"); + int eph_day = atoi(eph_day_str); + const char* eph_sec_str = kwl.find(prefix,"eph_sec"); + double eph_sec = atof(eph_sec_str); + + ref_civil_date.set_year(eph_year); + ref_civil_date.set_month(eph_month); + ref_civil_date.set_day(eph_day); + ref_civil_date.set_second((int)eph_sec); + ref_civil_date.set_decimal( eph_sec-(double)((int)eph_sec)); + + + JSDDateTime ref_jsd_date(ref_civil_date); + + const char* eph_int_str = kwl.find(prefix, "eph_int"); + double eph_int = atof(eph_int_str); + /* + * Ephemerisis number retrieval + */ + const char* neph_str = kwl.find(prefix,"neph"); + int neph = atoi(neph_str); + + Ephemeris** ephemeris = new Ephemeris*[neph]; + + const char* hr_angle_str = kwl.find(prefix,"hr_angle"); + double greenwich_mha_ref = atof(hr_angle_str); + + GMSTDateTime * greenwich_mha_ref2000 = new GMSTDateTime(); + greenwich_mha_ref2000->set_origine(GMSTDateTime::AN2000); + ref_civil_date.AsGMSTDateTime(greenwich_mha_ref2000); + + /* + * Ephemerisis retrieval + */ + for (int i=0;i<neph;i++) + { + double pos[3]; + double vit[3]; + char name[64]; + + + sprintf(name,"eph%i_posX",i); + const char* px_str = kwl.find(prefix,name); + pos[0] = atof(px_str); + + sprintf(name,"eph%i_posY",i); + const char* py_str = kwl.find(prefix,name); + pos[1] = atof(py_str); + + sprintf(name,"eph%i_posZ",i); + const char* pz_str = kwl.find(prefix,name); + pos[2] = atof(pz_str); + + + sprintf(name,"eph%i_velX",i); + const char* vx_str = kwl.find(prefix,name); + vit[0] = atof(vx_str) * 1.0e-3;; + + sprintf(name,"eph%i_velY",i); + const char* vy_str = kwl.find(prefix,name); + vit[1] = atof(vy_str) * 1.0e-3;; + + sprintf(name,"eph%i_velZ",i); + const char* vz_str = kwl.find(prefix,name); + vit[2] = atof(vz_str) * 1.0e-3;; + + /* + * Ephemerisis date + */ + JSDDateTime date(ref_jsd_date); + date.set_second(date.get_second() + i * eph_int); + date.NormDate(); + + /* + * Date creation for referential change + */ + GMSTDateTime * greenwich_mha = new GMSTDateTime(); + greenwich_mha->set_origine(GMSTDateTime::AN2000); + date.AsGMSTDateTime(greenwich_mha); + + double angle = greenwich_mha_ref+(greenwich_mha->get_tms()-greenwich_mha_ref2000->get_tms())*180.0/_PI; + angle = fmod(angle,360.0); + + /* + * Referential change + */ + GalileanEphemeris * tmpEphemeris = new GalileanEphemeris(date,pos,vit); + GeographicEphemeris* eph = new GeographicEphemeris(); + + tmpEphemeris->ToGeographic(angle,eph); + ephemeris[i] = eph; + + delete tmpEphemeris; + + } + + /* + * Antenna position interpolator creation + */ + if (_platformPosition != NULL) + { + delete _platformPosition; + } + _platformPosition = new PlatformPosition(ephemeris,neph); + + /* + * Free of memory used by the ephemerisis list + */ + for (int i=0;i<neph;i++) + { + delete ephemeris[i]; + } + delete[] ephemeris; + + return true; } bool ossimRadarSatModel::InitRefPoint(const ossimKeywordlist &kwl, const char *prefix) { - const char* sc_lin_str = kwl.find(prefix,"sc_lin"); - double sc_lin = atof(sc_lin_str); - - const char* sc_pix_str = kwl.find(prefix,"sc_pix"); - double sc_pix = atof(sc_pix_str); - - const char* inp_sctim_str = kwl.find(prefix,"inp_sctim"); - - const char* rng_gate_str = kwl.find(prefix,"rng_gate"); - double rng_gate = atof(rng_gate_str); - - if(_refPoint == NULL) - { - _refPoint = new RefPoint(); - } - - _refPoint->set_pix_col(sc_pix); - _refPoint->set_pix_line(sc_lin); - - char year_str[5]; - for (int i=0;i<4;i++) - { - year_str[i] = inp_sctim_str[i]; - } - year_str[4] = '\0'; - - char month_str[3]; - for (int i=4;i<6;i++) - { - month_str[i-4] = inp_sctim_str[i]; - } - month_str[2] = '\0'; - - char day_str[3]; - for (int i=6;i<8;i++) - { - day_str[i-6] = inp_sctim_str[i]; - } - day_str[2] = '\0'; - - char hour_str[3]; - for (int i=8;i<10;i++) - { - hour_str[i-8] = inp_sctim_str[i]; - } - hour_str[2] = '\0'; - - char min_str[3]; - for (int i=10;i<12;i++) - { - min_str[i-10] = inp_sctim_str[i]; - } - min_str[2] = '\0'; - - char sec_str[3]; - for (int i=12;i<14;i++) - { - sec_str[i-12] = inp_sctim_str[i]; - } - sec_str[2] = '\0'; - - char mili_str[4]; - for (int i=14;i<17;i++) - { - mili_str[i-14] = inp_sctim_str[i]; - } - mili_str[3] = '\0'; - - int year = atoi(year_str); - int month = atoi(month_str); - int day = atoi(day_str); - int hour = atoi(hour_str); - int min = atoi(min_str); - int sec = atoi(sec_str); - double mili = atof(mili_str); - - - CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili/1000.0); - - if(_platformPosition != NULL) - { - Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date); - if (ephemeris == NULL) return false ; - - _refPoint->set_ephemeris(ephemeris); - - delete ephemeris; - } - else - { - return false; - } - - double c = 2.99792458e+8; - - double distance = (rng_gate + ((double)sc_pix)*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); - - // in the case of Georeferenced images, the "relative" ground range is stored in place of the slant range - // (used for SlantRange computation relative to reference point, necessary for optimization) - // here, the pixelDirection is ignored since the RDS reference point is always at the scene centre - if (_isProductGeoreferenced) { - distance = _refPoint->get_pix_col() * _pixel_spacing ; - } - - _refPoint->set_distance(distance); + const char* sc_lin_str = kwl.find(prefix,"sc_lin"); + double sc_lin = atof(sc_lin_str); + + const char* sc_pix_str = kwl.find(prefix,"sc_pix"); + double sc_pix = atof(sc_pix_str); + + const char* inp_sctim_str = kwl.find(prefix,"inp_sctim"); + + const char* rng_gate_str = kwl.find(prefix,"rng_gate"); + double rng_gate = atof(rng_gate_str); + + if(_refPoint == NULL) + { + _refPoint = new RefPoint(); + } + + _refPoint->set_pix_col(sc_pix); + _refPoint->set_pix_line(sc_lin); + + char year_str[5]; + for (int i=0;i<4;i++) + { + year_str[i] = inp_sctim_str[i]; + } + year_str[4] = '\0'; + + char month_str[3]; + for (int i=4;i<6;i++) + { + month_str[i-4] = inp_sctim_str[i]; + } + month_str[2] = '\0'; + + char day_str[3]; + for (int i=6;i<8;i++) + { + day_str[i-6] = inp_sctim_str[i]; + } + day_str[2] = '\0'; + + char hour_str[3]; + for (int i=8;i<10;i++) + { + hour_str[i-8] = inp_sctim_str[i]; + } + hour_str[2] = '\0'; + + char min_str[3]; + for (int i=10;i<12;i++) + { + min_str[i-10] = inp_sctim_str[i]; + } + min_str[2] = '\0'; + + char sec_str[3]; + for (int i=12;i<14;i++) + { + sec_str[i-12] = inp_sctim_str[i]; + } + sec_str[2] = '\0'; + + char mili_str[4]; + for (int i=14;i<17;i++) + { + mili_str[i-14] = inp_sctim_str[i]; + } + mili_str[3] = '\0'; + + int year = atoi(year_str); + int month = atoi(month_str); + int day = atoi(day_str); + int hour = atoi(hour_str); + int min = atoi(min_str); + int sec = atoi(sec_str); + double mili = atof(mili_str); + + + CivilDateTime date(year, month, day, hour * 3600 + min * 60 + sec, mili/1000.0); + + if(_platformPosition != NULL) + { + Ephemeris * ephemeris = _platformPosition->Interpolate((JSDDateTime)date); + if (ephemeris == NULL) return false ; + + _refPoint->set_ephemeris(ephemeris); + + delete ephemeris; + } + else + { + return false; + } + + double c = 2.99792458e+8; + + double distance = (rng_gate + ((double)sc_pix)*_sensor->get_nRangeLook()/_sensor->get_sf()) * (c/2.0); + + // in the case of Georeferenced images, the "relative" ground range is stored in place of the slant range + // (used for SlantRange computation relative to reference point, necessary for optimization) + // here, the pixelDirection is ignored since the RDS reference point is always at the scene centre + if (_isProductGeoreferenced) { + distance = _refPoint->get_pix_col() * _pixel_spacing ; + } + + _refPoint->set_distance(distance); //// essai : line spacing et vitesse satellite -// const char* line_spacing_str = kwl.find(prefix,"line_spacing"); -// double line_spacing = atof(line_spacing_str); -// Ephemeris * ephemeris = _refPoint->get_ephemeris() ; -// double velSat = sqrt(pow(ephemeris->get_vitesse()[0], 2)+ pow(ephemeris->get_vitesse()[1], 2)+ pow(ephemeris->get_vitesse()[2], 2)); -// double prfeq = velSat / line_spacing ; -// _sensor->set_prf(prfeq); -// _sensor->set_nAzimuthLook(1.0); +// const char* line_spacing_str = kwl.find(prefix,"line_spacing"); +// double line_spacing = atof(line_spacing_str); +// Ephemeris * ephemeris = _refPoint->get_ephemeris() ; +// double velSat = sqrt(pow(ephemeris->get_vitesse()[0], 2)+ pow(ephemeris->get_vitesse()[1], 2)+ pow(ephemeris->get_vitesse()[2], 2)); +// double prfeq = velSat / line_spacing ; +// _sensor->set_prf(prfeq); +// _sensor->set_nAzimuthLook(1.0); ///** // * @todo : effacer // */ - // in order to use ossimSensorModel::lineSampleToWorld - const char* nbCol_str = kwl.find(prefix,"nbCol"); - const char* nbLin_str = kwl.find(prefix,"nbLin"); - theImageSize.x = atoi(nbCol_str); + // in order to use ossimSensorModel::lineSampleToWorld + const char* nbCol_str = kwl.find(prefix,"nbCol"); + const char* nbLin_str = kwl.find(prefix,"nbLin"); + theImageSize.x = atoi(nbCol_str); theImageSize.y = atoi(nbLin_str); theImageClipRect = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1); - // sensor PRF update in the case of ground projected products - if (_isProductGeoreferenced) { - const char* acq_msec_first_str = kwl.find("acq_msec_first"); - double acq_msec_first = atof(acq_msec_first_str); - const char* acq_msec_last_str = kwl.find("acq_msec_last"); - double acq_msec_last = atof(acq_msec_last_str); - - double actualPRF = 1000.0*theImageSize.y/(acq_msec_last-acq_msec_first) ; - _sensor->set_nAzimuthLook(_sensor->get_prf()/actualPRF); - } - - // Ground Control Points extracted from the model : scene center - std::list<ossimGpt> groundGcpCoordinates ; - std::list<ossimDpt> imageGcpCoordinates ; - const char* lon_str = kwl.find("pro_long"); - double lon = atof(lon_str); - const char* lat_str = kwl.find("pro_lat"); - double lat = atof(lat_str); - //const char* height_str = kwl.find("terrain_height"); - double height = 0 ; //atof(height_str) ; - - ossimDpt imageGCP(sc_pix,sc_lin); - ossimGpt groundGCP(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP) ; - imageGcpCoordinates.push_back(imageGCP) ; - - // Ground Control Points extracted from the model : scene corners - // upper left corner - lon = atof(kwl.find("cornersLon0")); - lat = atof(kwl.find("cornersLat0")); - ossimDpt imageGCP0(0,0); - ossimGpt groundGCP0(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP0) ; - imageGcpCoordinates.push_back(imageGCP0) ; - // upper right corner - lon = atof(kwl.find("cornersLon1")); - lat = atof(kwl.find("cornersLat1")); - ossimDpt imageGCP1(theImageSize.x-1,0); - ossimGpt groundGCP1(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP1) ; - imageGcpCoordinates.push_back(imageGCP1) ; - // lower left corner - lon = atof(kwl.find("cornersLon2")); - lat = atof(kwl.find("cornersLat2")); - ossimDpt imageGCP2(0,theImageSize.y-1); - ossimGpt groundGCP2(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP2) ; - imageGcpCoordinates.push_back(imageGCP2) ; - // lower right corner - lon = atof(kwl.find("cornersLon3")); - lat = atof(kwl.find("cornersLat3")); - ossimDpt imageGCP3(theImageSize.x-1,theImageSize.y-1); - ossimGpt groundGCP3(lat, lon, height); - groundGcpCoordinates.push_back(groundGCP3) ; - imageGcpCoordinates.push_back(imageGCP3) ; - - // Default optimization - optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; - - return true; + // sensor PRF update in the case of ground projected products + if (_isProductGeoreferenced) { + const char* acq_msec_first_str = kwl.find("acq_msec_first"); + double acq_msec_first = atof(acq_msec_first_str); + const char* acq_msec_last_str = kwl.find("acq_msec_last"); + double acq_msec_last = atof(acq_msec_last_str); + + double actualPRF = 1000.0*theImageSize.y/(acq_msec_last-acq_msec_first) ; + _sensor->set_nAzimuthLook(_sensor->get_prf()/actualPRF); + } + + // Ground Control Points extracted from the model : scene center + std::list<ossimGpt> groundGcpCoordinates ; + std::list<ossimDpt> imageGcpCoordinates ; + const char* lon_str = kwl.find("pro_long"); + double lon = atof(lon_str); + const char* lat_str = kwl.find("pro_lat"); + double lat = atof(lat_str); + //const char* height_str = kwl.find("terrain_height"); + double height = 0 ; //atof(height_str) ; + + ossimDpt imageGCP(sc_pix,sc_lin); + ossimGpt groundGCP(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP) ; + imageGcpCoordinates.push_back(imageGCP) ; + + // Ground Control Points extracted from the model : scene corners + // upper left corner + lon = atof(kwl.find("cornersLon0")); + lat = atof(kwl.find("cornersLat0")); + ossimDpt imageGCP0(0,0); + ossimGpt groundGCP0(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP0) ; + imageGcpCoordinates.push_back(imageGCP0) ; + // upper right corner + lon = atof(kwl.find("cornersLon1")); + lat = atof(kwl.find("cornersLat1")); + ossimDpt imageGCP1(theImageSize.x-1,0); + ossimGpt groundGCP1(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP1) ; + imageGcpCoordinates.push_back(imageGCP1) ; + // lower left corner + lon = atof(kwl.find("cornersLon2")); + lat = atof(kwl.find("cornersLat2")); + ossimDpt imageGCP2(0,theImageSize.y-1); + ossimGpt groundGCP2(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP2) ; + imageGcpCoordinates.push_back(imageGCP2) ; + // lower right corner + lon = atof(kwl.find("cornersLon3")); + lat = atof(kwl.find("cornersLat3")); + ossimDpt imageGCP3(theImageSize.x-1,theImageSize.y-1); + ossimGpt groundGCP3(lat, lon, height); + groundGcpCoordinates.push_back(groundGCP3) ; + imageGcpCoordinates.push_back(imageGCP3) ; + + // Default optimization + optimizeModel(groundGcpCoordinates, imageGcpCoordinates) ; + + return true; } bool ossimRadarSatModel::InitSRGR(const ossimKeywordlist &kwl, const char *prefix) { - // product type : format "RSAT-1-SAR-{SLC,SGG,SGC,...}-..." - const char* file_name_str = kwl.find(prefix,"file_name"); - char format[4] ; - // product type (SLC,SGG,SGC,...) extraction - for (int j=11;j<14;j++) - { - format[j-11] = file_name_str[j]; - } - format[3] = '\0'; - std::string format_str(format); - - _isProductGeoreferenced = (format_str=="SGX") || (format_str=="SGF"); - - // pixel spacing - const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); - _pixel_spacing = atof(pixel_spacing_str); - - // number of SRGR sets - const char* n_srgr_str = kwl.find(prefix,"n_srgr"); - _n_srgr = atoi(n_srgr_str); - - char name[64]; - for (int i=0;i<_n_srgr;i++) - { - // SRGR update time, format : YYYY-DDD-HH:MM:SS.SSS - sprintf(name,"srgr_update%i",i); - const char* srgr_update_str = kwl.find(prefix,name); - - // years and days are ignored in the following (conversion from CivilDate to JSDDate requires a YYYY-MM-DD format) - // could be improved - char hour_str[3]; - for (int j=9;j<11;j++) - { - hour_str[j-9] = srgr_update_str[j]; - } - hour_str[2] = '\0'; - - char min_str[3]; - for (int j=12;j<14;j++) - { - min_str[j-12] = srgr_update_str[j]; - } - min_str[2] = '\0'; - - char sec_str[3]; - for (int j=15;j<17;j++) - { - sec_str[j-15] = srgr_update_str[j]; - } - sec_str[2] = '\0'; - - char mili_str[4]; - for (int j=18;j<21;j++) - { - mili_str[j-18] = srgr_update_str[j]; - } - mili_str[3] = '\0'; - - int hour = atoi(hour_str); - int min = atoi(min_str); - int sec = atoi(sec_str); - double mili = atof(mili_str); - _srgr_update[i] = hour * 3600 + min * 60 + sec + mili/1000.0 ; - - // SRGR coefficients - sprintf(name,"srgr_coef%iA",i); - const char* srgr_coef_strA = kwl.find(prefix,name); - _srgr_coefset[i][0] = atof(srgr_coef_strA); - sprintf(name,"srgr_coef%iB",i); - const char* srgr_coef_strB = kwl.find(prefix,name); - _srgr_coefset[i][1] = atof(srgr_coef_strB); - sprintf(name,"srgr_coef%iC",i); - const char* srgr_coef_strC = kwl.find(prefix,name); - _srgr_coefset[i][2] = atof(srgr_coef_strC); - sprintf(name,"srgr_coef%iD",i); - const char* srgr_coef_strD = kwl.find(prefix,name); - _srgr_coefset[i][3] = atof(srgr_coef_strD); - sprintf(name,"srgr_coef%iE",i); - const char* srgr_coef_strE = kwl.find(prefix,name); - _srgr_coefset[i][4] = atof(srgr_coef_strE); - sprintf(name,"srgr_coef%iF",i); - const char* srgr_coef_strF = kwl.find(prefix,name); - _srgr_coefset[i][5] = atof(srgr_coef_strF); - } - return true; + // product type : format "RSAT-1-SAR-{SLC,SGG,SGC,...}-..." + const char* file_name_str = kwl.find(prefix,"file_name"); + char format[4] ; + // product type (SLC,SGG,SGC,...) extraction + for (int j=11;j<14;j++) + { + format[j-11] = file_name_str[j]; + } + format[3] = '\0'; + std::string format_str(format); + + _isProductGeoreferenced = (format_str=="SGX") || (format_str=="SGF"); + + // pixel spacing + const char* pixel_spacing_str = kwl.find(prefix,"pixel_spacing"); + _pixel_spacing = atof(pixel_spacing_str); + + // number of SRGR sets + const char* n_srgr_str = kwl.find(prefix,"n_srgr"); + _n_srgr = atoi(n_srgr_str); + + char name[64]; + for (int i=0;i<_n_srgr;i++) + { + // SRGR update time, format : YYYY-DDD-HH:MM:SS.SSS + sprintf(name,"srgr_update%i",i); + const char* srgr_update_str = kwl.find(prefix,name); + + // years and days are ignored in the following (conversion from CivilDate to JSDDate requires a YYYY-MM-DD format) + // could be improved + char hour_str[3]; + for (int j=9;j<11;j++) + { + hour_str[j-9] = srgr_update_str[j]; + } + hour_str[2] = '\0'; + + char min_str[3]; + for (int j=12;j<14;j++) + { + min_str[j-12] = srgr_update_str[j]; + } + min_str[2] = '\0'; + + char sec_str[3]; + for (int j=15;j<17;j++) + { + sec_str[j-15] = srgr_update_str[j]; + } + sec_str[2] = '\0'; + + char mili_str[4]; + for (int j=18;j<21;j++) + { + mili_str[j-18] = srgr_update_str[j]; + } + mili_str[3] = '\0'; + + int hour = atoi(hour_str); + int min = atoi(min_str); + int sec = atoi(sec_str); + double mili = atof(mili_str); + _srgr_update[i] = hour * 3600 + min * 60 + sec + mili/1000.0 ; + + // SRGR coefficients + sprintf(name,"srgr_coef%iA",i); + const char* srgr_coef_strA = kwl.find(prefix,name); + _srgr_coefset[i][0] = atof(srgr_coef_strA); + sprintf(name,"srgr_coef%iB",i); + const char* srgr_coef_strB = kwl.find(prefix,name); + _srgr_coefset[i][1] = atof(srgr_coef_strB); + sprintf(name,"srgr_coef%iC",i); + const char* srgr_coef_strC = kwl.find(prefix,name); + _srgr_coefset[i][2] = atof(srgr_coef_strC); + sprintf(name,"srgr_coef%iD",i); + const char* srgr_coef_strD = kwl.find(prefix,name); + _srgr_coefset[i][3] = atof(srgr_coef_strD); + sprintf(name,"srgr_coef%iE",i); + const char* srgr_coef_strE = kwl.find(prefix,name); + _srgr_coefset[i][4] = atof(srgr_coef_strE); + sprintf(name,"srgr_coef%iF",i); + const char* srgr_coef_strF = kwl.find(prefix,name); + _srgr_coefset[i][5] = atof(srgr_coef_strF); + } + return true; } int ossimRadarSatModel::FindSRGRSetNumber(JSDDateTime date) const { - if (_n_srgr==0) return(-1) ; - - double delays[20]; - for (int i=0;i<_n_srgr;i++) - { - delays[i] = fabs(date.get_second()+date.get_decimal()-_srgr_update[i]) ; - } - - int setNumber = 0 ; - double min_delay = delays[0] ; - for (int i=1;i<_n_srgr;i++) - { - if (delays[i]<min_delay) { - setNumber = i ; - min_delay = delays[i] ; - } - } - return setNumber ; + if (_n_srgr==0) return(-1) ; + + double delays[20]; + for (int i=0;i<_n_srgr;i++) + { + delays[i] = fabs(date.get_second()+date.get_decimal()-_srgr_update[i]) ; + } + + int setNumber = 0 ; + double min_delay = delays[0] ; + for (int i=1;i<_n_srgr;i++) + { + if (delays[i]<min_delay) { + setNumber = i ; + min_delay = delays[i] ; + } + } + return setNumber ; } } diff --git a/Utilities/otbossimplugins/ossim/ossimRadarSatModel.h b/Utilities/otbossimplugins/ossim/ossimRadarSatModel.h index 7d64990cfc46b2daacaed72296a094029e669d0d..b25e5bca99b91a7991849123958a70fc7a9d1412 100644 --- a/Utilities/otbossimplugins/ossim/ossimRadarSatModel.h +++ b/Utilities/otbossimplugins/ossim/ossimRadarSatModel.h @@ -36,11 +36,11 @@ class RefPoint; class ossimRadarSatModel : public ossimGeometricSarSensorModel { public: - /** @brief Constructor */ - ossimRadarSatModel(); + /** @brief Constructor */ + ossimRadarSatModel(); - /** @brief Destructor */ - virtual ~ossimRadarSatModel(); + /** @brief Destructor */ + virtual ~ossimRadarSatModel(); /** * @brief Method to return the class name. @@ -48,44 +48,44 @@ public: */ virtual ossimString getClassName() const; - /** - * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) - * @param col Column coordinate of the image point - */ - virtual double getSlantRangeFromGeoreferenced(double col) const; + /** + * @brief This function associates an image column number to a slant range when the image is georeferenced (ground projected) + * @param col Column coordinate of the image point + */ + virtual double getSlantRangeFromGeoreferenced(double col) const; protected: - /** - * @brief Slant Range for each Ground Range (SRGR) number of coefficients sets - */ - int _n_srgr; - /** - * @brief SRGR coefficient sets - */ - double _srgr_coefset[20][6]; - /** - * @brief SRGR coefficient sets update times - */ - double _srgr_update[20]; - /** - * @brief Pixel spacing - */ - double _pixel_spacing; + /** + * @brief Slant Range for each Ground Range (SRGR) number of coefficients sets + */ + int _n_srgr; + /** + * @brief SRGR coefficient sets + */ + double _srgr_coefset[20][6]; + /** + * @brief SRGR coefficient sets update times + */ + double _srgr_update[20]; + /** + * @brief Pixel spacing + */ + double _pixel_spacing; private: - virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); - virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced - */ - virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); - /** - * @brief Finds the SRGR data set which update time is the closest to the center scene time - */ - int FindSRGRSetNumber(JSDDateTime date) const; - TYPE_DATA + virtual bool InitPlatformPosition(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitSensorParams(const ossimKeywordlist &kwl, const char *prefix); + virtual bool InitRefPoint(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Initializes the Slant Range for each Ground Range data sets : _n_srgr,_srgr_coefset,_srgr_update,_pixel_spacing,_isProductGeoreferenced + */ + virtual bool InitSRGR(const ossimKeywordlist &kwl, const char *prefix); + /** + * @brief Finds the SRGR data set which update time is the closest to the center scene time + */ + int FindSRGRSetNumber(JSDDateTime date) const; + TYPE_DATA }; } diff --git a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp index b2519b64a93969bd9733d140a00eb165c768ef68..4f40c18351d696b11871787ada755dd3529398ad 100644 --- a/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp +++ b/Utilities/otbossimplugins/ossim/ossimTerraSarModel.cpp @@ -91,9 +91,9 @@ ossimObject* ossimplugins::ossimTerraSarModel::dup() const } // Note : ground range to slant range coputation could be performed in three ways : -// (1) Slant Range to Ground Range polynomial inversion (coefficients given at mid-scene) -// (2) use of a parabolic model from three geolocated points -// (3) interpolation from the geolocation grid (separate file, most precise technique) +// (1) Slant Range to Ground Range polynomial inversion (coefficients given at mid-scene) +// (2) use of a parabolic model from three geolocated points +// (3) interpolation from the geolocation grid (separate file, most precise technique) // In this version, (1) and (2) were implemented but (1) is imprecise on the test products. double ossimplugins::ossimTerraSarModel::getSlantRangeFromGeoreferenced(double col) const { @@ -611,41 +611,41 @@ std::ostream& ossimplugins::ossimTerraSarModel::print(std::ostream& out) const } /* -// Version (1) +// Version (1) double ossimplugins::ossimTerraSarModel::getSlantRangeFromGeoreferenced(double col) const { - // iterative polynomial inversion - const double CLUM = 2.99792458e+8 ; - double EPSILON = 0.0000001 ; - double iterError = 1.0 ; - int maxIter = 50, nIter=0 ; - double estimatedGroundRange, estimatedSlantRangeTime, actualGroundRange, estimatedSlantRange ; - - - // actual ground range computation relative to the image near side - // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range - actualGroundRange = _refPoint->get_distance() - _sensor->get_col_direction() * (col-_refPoint->get_pix_col()) * _SrToGr_scaling_factor ; - - estimatedSlantRangeTime = _sceneCenterRangeTime ; - while ((fabs(iterError)>EPSILON)&& (nIter<maxIter)) { - // estimated ground range computation from SrToGr - estimatedGroundRange = 0.0 ; - for (int i=0; i<_SrToGr_coeffs.size(); i++) { - estimatedGroundRange += _SrToGr_coeffs[i]*pow(estimatedSlantRangeTime-_SrToGr_R0,_SrToGr_exponent[i]); - } - - // comparison between the estimated ground range and the actual ground range - iterError = actualGroundRange - estimatedGroundRange ; - - // estimated slant range update - estimatedSlantRangeTime += iterError * 2.0 / CLUM ; - - nIter++; - } - - estimatedSlantRange = estimatedSlantRangeTime* CLUM / 2.0 ; - - return estimatedSlantRange ; + // iterative polynomial inversion + const double CLUM = 2.99792458e+8 ; + double EPSILON = 0.0000001 ; + double iterError = 1.0 ; + int maxIter = 50, nIter=0 ; + double estimatedGroundRange, estimatedSlantRangeTime, actualGroundRange, estimatedSlantRange ; + + + // actual ground range computation relative to the image near side + // in the case of Georeferenced images, _refPoint->get_distance() contains the ground range + actualGroundRange = _refPoint->get_distance() - _sensor->get_col_direction() * (col-_refPoint->get_pix_col()) * _SrToGr_scaling_factor ; + + estimatedSlantRangeTime = _sceneCenterRangeTime ; + while ((fabs(iterError)>EPSILON)&& (nIter<maxIter)) { + // estimated ground range computation from SrToGr + estimatedGroundRange = 0.0 ; + for (int i=0; i<_SrToGr_coeffs.size(); i++) { + estimatedGroundRange += _SrToGr_coeffs[i]*pow(estimatedSlantRangeTime-_SrToGr_R0,_SrToGr_exponent[i]); + } + + // comparison between the estimated ground range and the actual ground range + iterError = actualGroundRange - estimatedGroundRange ; + + // estimated slant range update + estimatedSlantRangeTime += iterError * 2.0 / CLUM ; + + nIter++; + } + + estimatedSlantRange = estimatedSlantRangeTime* CLUM / 2.0 ; + + return estimatedSlantRange ; } */ @@ -667,7 +667,7 @@ bool ossimplugins::ossimTerraSarModel::InitSensorParams( //ellipsoid parameters const char* ellip_maj_str = kwl.find(prefix,"ellip_maj"); - double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m + double ellip_maj = atof(ellip_maj_str) * 1000.0; // km -> m const char* ellip_min_str = kwl.find(prefix,"ellip_min"); double ellip_min = atof(ellip_min_str) * 1000.0; // km -> m @@ -796,7 +796,7 @@ bool ossimplugins::ossimTerraSarModel::InitPlatformPosition( ephemeris[i] = eph; } - + /* * Creation of the platform position interpolator */ @@ -895,7 +895,7 @@ bool ossimplugins::ossimTerraSarModel::InitRefPoint(const ossimKeywordlist &kwl, double actualPRF = theImageSize.y/(acq_msec_last-acq_msec_first) ; _sensor->set_nAzimuthLook(_sensor->get_prf()/actualPRF); } - else + else _sensor->set_nAzimuthLook(1.0); // Ground Control Points extracted from the model : scene center and corners @@ -985,7 +985,7 @@ bool ossimplugins::ossimTerraSarModel::InitSRGR(const ossimKeywordlist &kwl, con _alt_srgr_coefset[0] = t1; _alt_srgr_coefset[1] = ((t2-t1)/(x2*x2)+(t1-t3)/(x3*x3))/((1.0/x2)-(1.0/x3)); _alt_srgr_coefset[2] = ((t2-t1)/x2 + (t1-t3)/x3)/(x2-x3); - + return true; } @@ -1407,5 +1407,5 @@ bool ossimplugins::ossimTerraSarModel::initRefPoint( return true; } - - + + diff --git a/Utilities/otbossimplugins/ossim/ossimTerraSarProductDoc.cpp b/Utilities/otbossimplugins/ossim/ossimTerraSarProductDoc.cpp index b9befb77fc66c6c9b325912ca464960e42a81a4e..e215d2270c0a7652cd9c848220b92b34b5aaddc8 100644 --- a/Utilities/otbossimplugins/ossim/ossimTerraSarProductDoc.cpp +++ b/Utilities/otbossimplugins/ossim/ossimTerraSarProductDoc.cpp @@ -223,7 +223,7 @@ bool ossimplugins::ossimTerraSarProductDoc::initPlatformPosition( ++nbrData; } // matches: if (s == "1") - } // matches: for (ossim_uint32 i = 0 ; i < COUNT; ++i) + } // matches: for (ossim_uint32 i = 0 ; i < COUNT; ++i) if (result && ev.size()) { diff --git a/Utilities/otbossimplugins/ossim/otb/Arithmetic.h b/Utilities/otbossimplugins/ossim/otb/Arithmetic.h index 13f228458261e09e20c7caf9b4b5ae96f564c95a..dc47a6900ea38666b02332d14be8d900a3c40bc5 100644 --- a/Utilities/otbossimplugins/ossim/otb/Arithmetic.h +++ b/Utilities/otbossimplugins/ossim/otb/Arithmetic.h @@ -20,7 +20,7 @@ namespace ossimplugins /*-------------------------------------------------------------------------*/ -/* "closest integer" function, returns long */ +/* "closest integer" function, returns long */ /*-------------------------------------------------------------------------*/ long inint (double x) @@ -29,7 +29,7 @@ namespace ossimplugins } /*-------------------------------------------------------------------------*/ -/* "closest integer" function, returns double */ +/* "closest integer" function, returns double */ /*-------------------------------------------------------------------------*/ double fnint (double x) @@ -38,7 +38,7 @@ namespace ossimplugins } /*-------------------------------------------------------------------------*/ -/* Greatest Common Divisor */ +/* Greatest Common Divisor */ /*-------------------------------------------------------------------------*/ long pgcd ( long n , long p ) @@ -75,7 +75,7 @@ namespace ossimplugins } /*-------------------------------------------------------------------------*/ -/* Least Common Multiple */ +/* Least Common Multiple */ /*-------------------------------------------------------------------------*/ long ppcm ( long n , long p ) diff --git a/Utilities/otbossimplugins/ossim/otb/CivilDateTime.cpp b/Utilities/otbossimplugins/ossim/otb/CivilDateTime.cpp index fcf0f8b8f51ac65c2d68f3572ce5c1511a164abb..62468d391728f94f874248eaa3265f64c0092aa3 100644 --- a/Utilities/otbossimplugins/ossim/otb/CivilDateTime.cpp +++ b/Utilities/otbossimplugins/ossim/otb/CivilDateTime.cpp @@ -27,31 +27,31 @@ namespace ossimplugins const double CivilDateTime::JOURCIVIL_LENGTH = 86400.0 ; CivilDateTime::CivilDateTime(): - _year(0), - _month(0), - _day(0), - _second(0), - _decimal(0.0) + _year(0), + _month(0), + _day(0), + _second(0), + _decimal(0.0) { } CivilDateTime::CivilDateTime(int year, int month, int day, int second, double decimal): - _year(year), - _month(month), - _day(day), - _second(second), - _decimal(decimal) + _year(year), + _month(month), + _day(day), + _second(second), + _decimal(decimal) { } CivilDateTime::CivilDateTime(char* Utc) { - SetUtcDateTime(Utc); + SetUtcDateTime(Utc); } CivilDateTime::CivilDateTime(const char* Utc) { - SetUtcDateTime(Utc); + SetUtcDateTime(Utc); } CivilDateTime::~CivilDateTime() @@ -59,374 +59,374 @@ CivilDateTime::~CivilDateTime() } CivilDateTime::CivilDateTime(const CivilDateTime& rhs): - _year(rhs._year), - _month(rhs._month), - _day(rhs._day), - _second(rhs._second), - _decimal(rhs._decimal) + _year(rhs._year), + _month(rhs._month), + _day(rhs._day), + _second(rhs._second), + _decimal(rhs._decimal) { } CivilDateTime& CivilDateTime::operator=(const CivilDateTime& rhs) { - _year = rhs._year; - _month = rhs._month; - _day = rhs._day; - _second = rhs._second; - _decimal = rhs._decimal; + _year = rhs._year; + _month = rhs._month; + _day = rhs._day; + _second = rhs._second; + _decimal = rhs._decimal; - return *this; + return *this; } int CivilDateTime::AsJulianDate(JulianDate* julianDate) { - int etat , test ; - int an , mois , i , j ; - double b , d ; - - if (_month > 2) - { - an = _year ; - mois = _month ; - } - else - { - an = _year - 1 ; - mois = _month + 12 ; - } - - test = _year * 10000 + _month * 100 + _day ; - if ((test > 15821004) && (test < 15821015)) - etat = 1 ; - else - { - etat = 0 ; - d = (an < 0) ? 0.75 : 0.0 ; - if (test >= 15821015) - { - i = an / 100 ; - j = 2 - i + i/4 ; - b = (double)j + 1720994.5 ; - } - else - b = 1720994.5 ; - - i = (int) (365.25 * (double)an - d) ; - j = (int) (30.6001 * (double)(mois + 1)) ; - double jourJulien = (double)(i + j) + (double)_day + int etat , test ; + int an , mois , i , j ; + double b , d ; + + if (_month > 2) + { + an = _year ; + mois = _month ; + } + else + { + an = _year - 1 ; + mois = _month + 12 ; + } + + test = _year * 10000 + _month * 100 + _day ; + if ((test > 15821004) && (test < 15821015)) + etat = 1 ; + else + { + etat = 0 ; + d = (an < 0) ? 0.75 : 0.0 ; + if (test >= 15821015) + { + i = an / 100 ; + j = 2 - i + i/4 ; + b = (double)j + 1720994.5 ; + } + else + b = 1720994.5 ; + + i = (int) (365.25 * (double)an - d) ; + j = (int) (30.6001 * (double)(mois + 1)) ; + double jourJulien = (double)(i + j) + (double)_day + ((double)_second + _decimal) / JOURCIVIL_LENGTH + b ; - julianDate->set_julianDate(jourJulien); - } + julianDate->set_julianDate(jourJulien); + } - return etat; + return etat; } int CivilDateTime::SetUtcDateTime(char* Utc) { - char str_an[5]; - char str_day[3]; - char str_month[4]; - char str_hour[3]; - char str_min[3]; - char str_sec[3]; - char str_micro[7]; - int i; - double exposant; - - /* - * year extraction - */ - for (i = 0; i < 4; i++) - { - str_an[i] = Utc[i+7]; - } - - str_an[4] = '\0'; - _year = atoi(str_an); - if ( (_year > 2050) || (_year < 1950) ) + char str_an[5]; + char str_day[3]; + char str_month[4]; + char str_hour[3]; + char str_min[3]; + char str_sec[3]; + char str_micro[7]; + int i; + double exposant; + + /* + * year extraction + */ + for (i = 0; i < 4; i++) + { + str_an[i] = Utc[i+7]; + } + + str_an[4] = '\0'; + _year = atoi(str_an); + if ( (_year > 2050) || (_year < 1950) ) { - return 1; + return 1; } - /* - * month extraction - */ - for (i = 0; i < 3; i++) - { - str_month[i] = Utc[i+3]; - } - - str_month[3] = '\0'; - if (!strcmp(str_month, "JAN")) _month = 1; - else if (!strcmp(str_month, "FEV")) _month = 2; - else if (!strcmp(str_month, "MAR")) _month = 3; - else if (!strcmp(str_month, "APR")) _month = 4; - else if (!strcmp(str_month, "MAY")) _month = 5; - else if (!strcmp(str_month, "JUN")) _month = 6; - else if (!strcmp(str_month, "JUL")) _month = 7; - else if (!strcmp(str_month, "AUG")) _month = 8; - else if (!strcmp(str_month, "SEP")) _month = 9; - else if (!strcmp(str_month, "OCT")) _month = 10; - else if (!strcmp(str_month, "NOV")) _month = 11; - else if (!strcmp(str_month, "DEC")) _month = 12; - else - { - return 1; - } - - /* - * day extraction - */ - for (i = 0; i < 2; i++) - { - str_day[i] = Utc[i]; - } - - str_day[2] = '\0'; - _day = atoi(str_day); - if ( (_day < 1) || (_day > 31) ) - { - return 1; - } - - /* - * seconds extraction - */ - for (i = 0; i < 2; i++) + /* + * month extraction + */ + for (i = 0; i < 3; i++) + { + str_month[i] = Utc[i+3]; + } + + str_month[3] = '\0'; + if (!strcmp(str_month, "JAN")) _month = 1; + else if (!strcmp(str_month, "FEV")) _month = 2; + else if (!strcmp(str_month, "MAR")) _month = 3; + else if (!strcmp(str_month, "APR")) _month = 4; + else if (!strcmp(str_month, "MAY")) _month = 5; + else if (!strcmp(str_month, "JUN")) _month = 6; + else if (!strcmp(str_month, "JUL")) _month = 7; + else if (!strcmp(str_month, "AUG")) _month = 8; + else if (!strcmp(str_month, "SEP")) _month = 9; + else if (!strcmp(str_month, "OCT")) _month = 10; + else if (!strcmp(str_month, "NOV")) _month = 11; + else if (!strcmp(str_month, "DEC")) _month = 12; + else + { + return 1; + } + + /* + * day extraction + */ + for (i = 0; i < 2; i++) + { + str_day[i] = Utc[i]; + } + + str_day[2] = '\0'; + _day = atoi(str_day); + if ( (_day < 1) || (_day > 31) ) + { + return 1; + } + + /* + * seconds extraction + */ + for (i = 0; i < 2; i++) { - str_hour[i] = Utc[i+12]; - str_min[i] = Utc[i+15]; - str_sec[i] = Utc[i+18]; + str_hour[i] = Utc[i+12]; + str_min[i] = Utc[i+15]; + str_sec[i] = Utc[i+18]; } - str_hour[2] = '\0';if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) ) - { - return 1; - } - - str_min[2] = '\0';if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) ) - { - return 1; - } - str_sec[2] = '\0';if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) ) - { - return 1; - } - _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec); - - /* - * microseconds extraction - */ - for (i = 0; i < 6; i++) - { - str_micro[i] = Utc[i+21]; - } - - str_micro[6] = '\0'; - i = 0; - exposant = 10e-6; - while ((unsigned int)i < strlen(str_micro) ) + str_hour[2] = '\0';if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) ) + { + return 1; + } + + str_min[2] = '\0';if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) ) + { + return 1; + } + str_sec[2] = '\0';if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) ) + { + return 1; + } + _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec); + + /* + * microseconds extraction + */ + for (i = 0; i < 6; i++) + { + str_micro[i] = Utc[i+21]; + } + + str_micro[6] = '\0'; + i = 0; + exposant = 10e-6; + while ((unsigned int)i < strlen(str_micro) ) { - if (str_micro[i] == '0') exposant = exposant * 0.1; - i++; + if (str_micro[i] == '0') exposant = exposant * 0.1; + i++; } - _decimal = exposant * (double) atoi(str_micro); - if ( (_decimal < 0) || (_decimal >= 1) ) - { - return 1; - } + _decimal = exposant * (double) atoi(str_micro); + if ( (_decimal < 0) || (_decimal >= 1) ) + { + return 1; + } - return 0; + return 0; } int CivilDateTime::SetUtcDateTime(const char* Utc) { - char str_an[5]; - char str_day[3]; - char str_month[4]; - char str_hour[3]; - char str_min[3]; - char str_sec[3]; - char str_micro[7]; - int i; - double exposant; - - /* - * year extraction - */ - for (i = 0; i < 4; i++) - { - str_an[i] = Utc[i+7]; - } - - str_an[4] = '\0'; - _year = atoi(str_an); - if ( (_year > 2050) || (_year < 1950) ) + char str_an[5]; + char str_day[3]; + char str_month[4]; + char str_hour[3]; + char str_min[3]; + char str_sec[3]; + char str_micro[7]; + int i; + double exposant; + + /* + * year extraction + */ + for (i = 0; i < 4; i++) + { + str_an[i] = Utc[i+7]; + } + + str_an[4] = '\0'; + _year = atoi(str_an); + if ( (_year > 2050) || (_year < 1950) ) { - return 1; + return 1; } - /* - * month extraction - */ - for (i = 0; i < 3; i++) - { - str_month[i] = Utc[i+3]; - } - - str_month[3] = '\0'; - if (!strcmp(str_month, "JAN")) _month = 1; - else if (!strcmp(str_month, "FEV")) _month = 2; - else if (!strcmp(str_month, "MAR")) _month = 3; - else if (!strcmp(str_month, "APR")) _month = 4; - else if (!strcmp(str_month, "MAY")) _month = 5; - else if (!strcmp(str_month, "JUN")) _month = 6; - else if (!strcmp(str_month, "JUL")) _month = 7; - else if (!strcmp(str_month, "AUG")) _month = 8; - else if (!strcmp(str_month, "SEP")) _month = 9; - else if (!strcmp(str_month, "OCT")) _month = 10; - else if (!strcmp(str_month, "NOV")) _month = 11; - else if (!strcmp(str_month, "DEC")) _month = 12; - else - { - return 1; - } - - /* - * day extraction - */ - for (i = 0; i < 2; i++) - { - str_day[i] = Utc[i]; - } - - str_day[2] = '\0'; - _day = atoi(str_day); - if ( (_day < 1) || (_day > 31) ) - { - return 1; - } - - /* - * seconds extraction - */ - for (i = 0; i < 2; i++) + /* + * month extraction + */ + for (i = 0; i < 3; i++) + { + str_month[i] = Utc[i+3]; + } + + str_month[3] = '\0'; + if (!strcmp(str_month, "JAN")) _month = 1; + else if (!strcmp(str_month, "FEV")) _month = 2; + else if (!strcmp(str_month, "MAR")) _month = 3; + else if (!strcmp(str_month, "APR")) _month = 4; + else if (!strcmp(str_month, "MAY")) _month = 5; + else if (!strcmp(str_month, "JUN")) _month = 6; + else if (!strcmp(str_month, "JUL")) _month = 7; + else if (!strcmp(str_month, "AUG")) _month = 8; + else if (!strcmp(str_month, "SEP")) _month = 9; + else if (!strcmp(str_month, "OCT")) _month = 10; + else if (!strcmp(str_month, "NOV")) _month = 11; + else if (!strcmp(str_month, "DEC")) _month = 12; + else + { + return 1; + } + + /* + * day extraction + */ + for (i = 0; i < 2; i++) + { + str_day[i] = Utc[i]; + } + + str_day[2] = '\0'; + _day = atoi(str_day); + if ( (_day < 1) || (_day > 31) ) + { + return 1; + } + + /* + * seconds extraction + */ + for (i = 0; i < 2; i++) { - str_hour[i] = Utc[i+12]; - str_min[i] = Utc[i+15]; - str_sec[i] = Utc[i+18]; + str_hour[i] = Utc[i+12]; + str_min[i] = Utc[i+15]; + str_sec[i] = Utc[i+18]; } - str_hour[2] = '\0';if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) ) - { - return 1; - } - - str_min[2] = '\0';if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) ) - { - return 1; - } - str_sec[2] = '\0';if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) ) - { - return 1; - } - _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec); - - /* - * microseconds extraction - */ - for (i = 0; i < 6; i++) - { - str_micro[i] = Utc[i+21]; - } - - str_micro[6] = '\0'; - i = 0; - exposant = 10e-6; - while ((unsigned int)i < strlen(str_micro) ) + str_hour[2] = '\0';if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) ) + { + return 1; + } + + str_min[2] = '\0';if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) ) + { + return 1; + } + str_sec[2] = '\0';if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) ) + { + return 1; + } + _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec); + + /* + * microseconds extraction + */ + for (i = 0; i < 6; i++) + { + str_micro[i] = Utc[i+21]; + } + + str_micro[6] = '\0'; + i = 0; + exposant = 10e-6; + while ((unsigned int)i < strlen(str_micro) ) { - if (str_micro[i] == '0') exposant = exposant * 0.1; - i++; + if (str_micro[i] == '0') exposant = exposant * 0.1; + i++; } - _decimal = exposant * (double) atoi(str_micro); - if ( (_decimal < 0) || (_decimal >= 1) ) - { - return 1; - } + _decimal = exposant * (double) atoi(str_micro); + if ( (_decimal < 0) || (_decimal >= 1) ) + { + return 1; + } - return 0; + return 0; } int CivilDateTime::AsJSDDateTime(JSDDateTime* JSDdate) { - int etat , k ; - JulianDate jourJulien; - double r ; + int etat , k ; + JulianDate jourJulien; + double r ; - etat = AsJulianDate(&jourJulien ); - if (etat == 0) - { - k = (int)(jourJulien.get_julianDate() - 0.5) ; + etat = AsJulianDate(&jourJulien ); + if (etat == 0) + { + k = (int)(jourJulien.get_julianDate() - 0.5) ; - double day0hTU = (double)k + 0.5; - JSDdate->set_day0hTU(JulianDate(day0hTU)); + double day0hTU = (double)k + 0.5; + JSDdate->set_day0hTU(JulianDate(day0hTU)); - r = (jourJulien.get_julianDate() - day0hTU) * JOURCIVIL_LENGTH ; - JSDdate->set_second(floor (r)) ; - JSDdate->set_decimal(r - JSDdate->get_second()) ; - } + r = (jourJulien.get_julianDate() - day0hTU) * JOURCIVIL_LENGTH ; + JSDdate->set_second(floor (r)) ; + JSDdate->set_decimal(r - JSDdate->get_second()) ; + } - return etat ; + return etat ; } int CivilDateTime::AsGMSTDateTime(GMSTDateTime* GMST) { - const double DEUXPI = 6.28318530717958647693 ; - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - int etat ; - JulianDate jourJulien; - double t=0.0; + const double DEUXPI = 6.28318530717958647693 ; + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + int etat ; + JulianDate jourJulien; + double t=0.0; double tsm0hTU=0.0; - double tsm; - CivilDateTime date0hTU(_year, _month, _day, 0, 0.0); - - - etat = date0hTU.AsJulianDate(&jourJulien ); - if (etat == 0) - { - if (GMST->get_origine() == GMSTDateTime::AN1900) - { - t = (jourJulien.get_julianDate() - 2415020.0) / 36525.0 ; - tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; - tsm0hTU = tsm0hTU * DEUXPI / JOURCIVIL_LENGTH ; - } - else if (GMST->get_origine() == GMSTDateTime::AN1950) - { - t = jourJulien.get_julianDate() - 2433281.5 ; - tsm0hTU = 1.72944494 + t * 6.3003880987 ; - } - else if (GMST->get_origine() == GMSTDateTime::AN2000) - { - t = (jourJulien.get_julianDate() - 2451545.0) / 36525.0 ; - tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ; - tsm0hTU = tsm0hTU * DEUXPI / JOURCIVIL_LENGTH ; - } - t = tsm0hTU + ((double)_second + _decimal) * OMEGATERRE ; - tsm = fmod (t, DEUXPI) ; - - if (tsm < 0.0) - { - tsm = tsm + DEUXPI ; - } - GMST->set_tms(tsm); - } + double tsm; + CivilDateTime date0hTU(_year, _month, _day, 0, 0.0); + + + etat = date0hTU.AsJulianDate(&jourJulien ); + if (etat == 0) + { + if (GMST->get_origine() == GMSTDateTime::AN1900) + { + t = (jourJulien.get_julianDate() - 2415020.0) / 36525.0 ; + tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; + tsm0hTU = tsm0hTU * DEUXPI / JOURCIVIL_LENGTH ; + } + else if (GMST->get_origine() == GMSTDateTime::AN1950) + { + t = jourJulien.get_julianDate() - 2433281.5 ; + tsm0hTU = 1.72944494 + t * 6.3003880987 ; + } + else if (GMST->get_origine() == GMSTDateTime::AN2000) + { + t = (jourJulien.get_julianDate() - 2451545.0) / 36525.0 ; + tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ; + tsm0hTU = tsm0hTU * DEUXPI / JOURCIVIL_LENGTH ; + } + t = tsm0hTU + ((double)_second + _decimal) * OMEGATERRE ; + tsm = fmod (t, DEUXPI) ; + + if (tsm < 0.0) + { + tsm = tsm + DEUXPI ; + } + GMST->set_tms(tsm); + } return etat ; } @@ -434,23 +434,23 @@ int CivilDateTime::AsGMSTDateTime(GMSTDateTime* GMST) CivilDateTime::operator JulianDate() { - JulianDate date; - AsJulianDate(&date); - return date; + JulianDate date; + AsJulianDate(&date); + return date; } CivilDateTime::operator JSDDateTime() { - JSDDateTime date; - AsJSDDateTime(&date); - return date; + JSDDateTime date; + AsJSDDateTime(&date); + return date; } CivilDateTime::operator GMSTDateTime() { - GMSTDateTime date; - AsGMSTDateTime(&date); - return date; + GMSTDateTime date; + AsGMSTDateTime(&date); + return date; } std::ostream& CivilDateTime::print(std::ostream& out) const diff --git a/Utilities/otbossimplugins/ossim/otb/Coordinate.cpp b/Utilities/otbossimplugins/ossim/otb/Coordinate.cpp index 5ef7a2ae986af828b33d9443a80280eb2c355221..00ea2ee48f3a1e97d555c4cc6fc02b441a7b117c 100644 --- a/Utilities/otbossimplugins/ossim/otb/Coordinate.cpp +++ b/Utilities/otbossimplugins/ossim/otb/Coordinate.cpp @@ -18,9 +18,9 @@ namespace ossimplugins Coordinate::Coordinate(): - _x(0.0), - _y(0.0), - _z(0.0) + _x(0.0), + _y(0.0), + _z(0.0) { } @@ -29,33 +29,33 @@ Coordinate::~Coordinate() } Coordinate::Coordinate(double x, double y, double z): - _x(x), - _y(y), - _z(z) + _x(x), + _y(y), + _z(z) { } Coordinate::Coordinate(const Coordinate& rhs): - _x(rhs._x), - _y(rhs._y), - _z(rhs._z) + _x(rhs._x), + _y(rhs._y), + _z(rhs._z) { } Coordinate& Coordinate::operator=(const Coordinate& rhs) { - _x = rhs._x; - _y = rhs._y; - _z = rhs._z; + _x = rhs._x; + _y = rhs._y; + _z = rhs._z; - return *this; + return *this; } void Coordinate::set_coordinates(double x, double y, double z) { - _x = x; - _y = y; - _z = z; + _x = x; + _y = y; + _z = z; } } diff --git a/Utilities/otbossimplugins/ossim/otb/Ephemeris.cpp b/Utilities/otbossimplugins/ossim/otb/Ephemeris.cpp index dc35da9582f7501de5cd24011ee84f1997cdd3e0..dad0ee288ba0d291d756f571f30db4995d6fa91c 100644 --- a/Utilities/otbossimplugins/ossim/otb/Ephemeris.cpp +++ b/Utilities/otbossimplugins/ossim/otb/Ephemeris.cpp @@ -28,12 +28,12 @@ static const char VELOCITY_KW[] = "velocity"; Ephemeris::Ephemeris() { - _position[0] = 0.0; - _position[1] = 0.0; - _position[2] = 0.0; - _vitesse[0] = 0.0; - _vitesse[1] = 0.0; - _vitesse[2] = 0.0; + _position[0] = 0.0; + _position[1] = 0.0; + _position[2] = 0.0; + _vitesse[0] = 0.0; + _vitesse[1] = 0.0; + _vitesse[2] = 0.0; } Ephemeris::~Ephemeris() @@ -41,38 +41,38 @@ Ephemeris::~Ephemeris() } Ephemeris::Ephemeris(JSDDateTime date, double pos[3], double vitesse[3]): - _date(date) + _date(date) { - _position[0] = pos[0]; - _position[1] = pos[1]; - _position[2] = pos[2]; - _vitesse[0] = vitesse[0]; - _vitesse[1] = vitesse[1]; - _vitesse[2] = vitesse[2]; + _position[0] = pos[0]; + _position[1] = pos[1]; + _position[2] = pos[2]; + _vitesse[0] = vitesse[0]; + _vitesse[1] = vitesse[1]; + _vitesse[2] = vitesse[2]; } Ephemeris::Ephemeris(const Ephemeris& rhs): - _date(rhs._date) + _date(rhs._date) { - _position[0] = rhs._position[0]; - _position[1] = rhs._position[1]; - _position[2] = rhs._position[2]; - _vitesse[0] = rhs._vitesse[0]; - _vitesse[1] = rhs._vitesse[1]; - _vitesse[2] = rhs._vitesse[2]; + _position[0] = rhs._position[0]; + _position[1] = rhs._position[1]; + _position[2] = rhs._position[2]; + _vitesse[0] = rhs._vitesse[0]; + _vitesse[1] = rhs._vitesse[1]; + _vitesse[2] = rhs._vitesse[2]; } Ephemeris& Ephemeris::operator=(const Ephemeris& rhs) { - _position[0] = rhs._position[0]; - _position[1] = rhs._position[1]; - _position[2] = rhs._position[2]; - _vitesse[0] = rhs._vitesse[0]; - _vitesse[1] = rhs._vitesse[1]; - _vitesse[2] = rhs._vitesse[2]; - _date = rhs._date; - - return *this; + _position[0] = rhs._position[0]; + _position[1] = rhs._position[1]; + _position[2] = rhs._position[2]; + _vitesse[0] = rhs._vitesse[0]; + _vitesse[1] = rhs._vitesse[1]; + _vitesse[2] = rhs._vitesse[2]; + _date = rhs._date; + + return *this; } bool Ephemeris::saveState(ossimKeywordlist& kwl, const char* prefix) const diff --git a/Utilities/otbossimplugins/ossim/otb/Equation.cpp b/Utilities/otbossimplugins/ossim/otb/Equation.cpp index ab4bee50f36c066327267064dc5d10b55ff67d71..50736a6421c84369988952cbcae4f9b65a4e66f1 100644 --- a/Utilities/otbossimplugins/ossim/otb/Equation.cpp +++ b/Utilities/otbossimplugins/ossim/otb/Equation.cpp @@ -28,12 +28,12 @@ Equation::Equation(): Equation::~Equation() { - if (_coefficients != NULL) - delete _coefficients; - if(_order != NULL) - delete _order; - if(_solutions != NULL) - delete _solutions; + if (_coefficients != NULL) + delete _coefficients; + if(_order != NULL) + delete _order; + if(_solutions != NULL) + delete _solutions; } Equation::Equation(int degree, std::complex<double>* coefficients): @@ -43,911 +43,911 @@ Equation::Equation(int degree, std::complex<double>* coefficients): _order(NULL), _solutions(NULL) { - CreateEquation(degree, coefficients); + CreateEquation(degree, coefficients); } void Equation::CreateEquation(int degree, std::complex<double>* coefficients) { - if (_coefficients != NULL) - { - delete _coefficients; - } - - if(_order != NULL) - delete _order; - if(_solutions != NULL) - delete _solutions; - - _coefficients = new std::complex<double>[degree+1]; - _degree = degree; - - for (int i=0;i<=degree;i++) - { - _coefficients[i] = coefficients[i]; - } + if (_coefficients != NULL) + { + delete _coefficients; + } + + if(_order != NULL) + delete _order; + if(_solutions != NULL) + delete _solutions; + + _coefficients = new std::complex<double>[degree+1]; + _degree = degree; + + for (int i=0;i<=degree;i++) + { + _coefficients[i] = coefficients[i]; + } } Equation::Equation(const Equation& rhs) { - CreateEquation(rhs._degree, rhs._coefficients); + CreateEquation(rhs._degree, rhs._coefficients); } Equation& Equation::operator=(const Equation& rhs) { - CreateEquation(rhs._degree, rhs._coefficients); - return *this; + CreateEquation(rhs._degree, rhs._coefficients); + return *this; } void Equation::ComputeTrueDegree() { - double r = 0.0; - _trueDegree = _degree +1; - while (r <= Epsilon && _trueDegree > 0) - { - _trueDegree = _trueDegree - 1 ; - r = abs(_coefficients[_trueDegree]); - } + double r = 0.0; + _trueDegree = _degree +1; + while (r <= Epsilon && _trueDegree > 0) + { + _trueDegree = _trueDegree - 1 ; + r = abs(_coefficients[_trueDegree]); + } } void Equation::Normalisation() { - int i; - - for (i=0;i<_trueDegree;i++) - { - _coefficients[i] = _coefficients[i] / _coefficients[_trueDegree]; - } - _coefficients[_trueDegree] = std::complex<double>(1.0,0.0); - - int eMax = 0; - int eMin = 0; - int e; - double r; - - /* - * Normalisation par a power of 10 - */ - for (i = 0 ; i < _trueDegree ; i++) - { - r = abs(_coefficients[i]) ; - if (r >= Epsilon) - { - r = log (r) ; - r = r / log (10.0) ; - e = ((int)r) / ((int)(_trueDegree - i)) ; - if (e > eMax) - eMax = e ; - if (e < eMin) - eMin = e ; - } - } - - /* - * Normalisation for big values - */ - if (eMax > 0) - { - /* Normalisation of the unknown for big values */ - _normalisationType = GreatValues; - _normalisationCoefficient = pow (10.0, (double)eMax) ; - r = 1.0 ; - for (i = _trueDegree-1 ; i >= 0 ; i--) - { - r = r * _normalisationCoefficient ; - _coefficients[i] = _coefficients[i] / std::complex<double>(r,0.0); - } - } - else if (eMin < 0) - { - /* Normalisation of the unknown for small */ - _normalisationType = SmallValues; - _normalisationCoefficient = pow(10.0,(double)(-eMin)) ; - r = 1.0 ; - for (i = _trueDegree-1 ; i >= 0 ; i--) - { - r = r * _normalisationCoefficient ; - _coefficients[i] = _coefficients[i] * std::complex<double>(r,0.0); - } - } + int i; + + for (i=0;i<_trueDegree;i++) + { + _coefficients[i] = _coefficients[i] / _coefficients[_trueDegree]; + } + _coefficients[_trueDegree] = std::complex<double>(1.0,0.0); + + int eMax = 0; + int eMin = 0; + int e; + double r; + + /* + * Normalisation par a power of 10 + */ + for (i = 0 ; i < _trueDegree ; i++) + { + r = abs(_coefficients[i]) ; + if (r >= Epsilon) + { + r = log (r) ; + r = r / log (10.0) ; + e = ((int)r) / ((int)(_trueDegree - i)) ; + if (e > eMax) + eMax = e ; + if (e < eMin) + eMin = e ; + } + } + + /* + * Normalisation for big values + */ + if (eMax > 0) + { + /* Normalisation of the unknown for big values */ + _normalisationType = GreatValues; + _normalisationCoefficient = pow (10.0, (double)eMax) ; + r = 1.0 ; + for (i = _trueDegree-1 ; i >= 0 ; i--) + { + r = r * _normalisationCoefficient ; + _coefficients[i] = _coefficients[i] / std::complex<double>(r,0.0); + } + } + else if (eMin < 0) + { + /* Normalisation of the unknown for small */ + _normalisationType = SmallValues; + _normalisationCoefficient = pow(10.0,(double)(-eMin)) ; + r = 1.0 ; + for (i = _trueDegree-1 ; i >= 0 ; i--) + { + r = r * _normalisationCoefficient ; + _coefficients[i] = _coefficients[i] * std::complex<double>(r,0.0); + } + } } void Equation::DeNormalisation() { - if (_normalisationType == GreatValues) - { - for (int i=0;i<_nbrSol;i++) - { - _solutions[i] = _solutions[i] * std::complex<double>(_normalisationCoefficient,0.0); - } - } - else - { - for (int i=0;i<_nbrSol;i++) - { - _solutions[i] = _solutions[i] / std::complex<double>(_normalisationCoefficient,0.0); - } - } + if (_normalisationType == GreatValues) + { + for (int i=0;i<_nbrSol;i++) + { + _solutions[i] = _solutions[i] * std::complex<double>(_normalisationCoefficient,0.0); + } + } + else + { + for (int i=0;i<_nbrSol;i++) + { + _solutions[i] = _solutions[i] / std::complex<double>(_normalisationCoefficient,0.0); + } + } } std::complex<double> Equation::Proche(std::complex<double> z, double epsilon) { - double x, y, ax, ay ; - std::complex<double> result ; - - x = z.real(); - y = z.imag(); - ax = fabs(x); - ay = fabs(y); - - if (ax < epsilon && ay < epsilon) - result = std::complex<double>(0.0, 0.0) ; - else if (ay < epsilon) - result = std::complex<double>(x, 0.0) ; - else if (ax < epsilon) - result = std::complex<double>(0.0, y) ; - else - { - if ((ay / ax) < epsilon) - result = std::complex<double>(x, 0.0) ; - else if ((ax / ay) < epsilon) - result = std::complex<double>(0.0,y) ; - else - result = z ; - } - - return result ; + double x, y, ax, ay ; + std::complex<double> result ; + + x = z.real(); + y = z.imag(); + ax = fabs(x); + ay = fabs(y); + + if (ax < epsilon && ay < epsilon) + result = std::complex<double>(0.0, 0.0) ; + else if (ay < epsilon) + result = std::complex<double>(x, 0.0) ; + else if (ax < epsilon) + result = std::complex<double>(0.0, y) ; + else + { + if ((ay / ax) < epsilon) + result = std::complex<double>(x, 0.0) ; + else if ((ax / ay) < epsilon) + result = std::complex<double>(0.0,y) ; + else + result = z ; + } + + return result ; } void Equation::Solve() { - ComputeTrueDegree(); - Normalisation(); - - if(_trueDegree == 1) - { - Solve1(); - } - else if(_trueDegree == 2) - { - Solve2(); - } - else if(_trueDegree == 3) - { - Solve3(); - } - else if(_trueDegree == 4) - { - Solve4(); - } - DeNormalisation(); + ComputeTrueDegree(); + Normalisation(); + + if(_trueDegree == 1) + { + Solve1(); + } + else if(_trueDegree == 2) + { + Solve2(); + } + else if(_trueDegree == 3) + { + Solve3(); + } + else if(_trueDegree == 4) + { + Solve4(); + } + DeNormalisation(); } void Equation::Solve1() { - _nbrSol = 1; - if(_order != NULL) - delete _order; + _nbrSol = 1; + if(_order != NULL) + delete _order; - _order = new int[1]; - _order[0] = 1; + _order = new int[1]; + _order[0] = 1; - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[1]; - _solutions[0] = Proche(-_coefficients[0], Epsilon); + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[1]; + _solutions[0] = Proche(-_coefficients[0], Epsilon); } void Equation::Solve2() { - double r1, r2 ; - // double epsilon = 1.e-12 ; - std::complex<double> t1, t2, d, z ; - std::complex<double> aa[2] ; - - aa[0] = _coefficients[0]/ _coefficients[2]; - aa[1] = _coefficients[1]/ _coefficients[2]; - - t1 = aa[1]* aa[1] ; - t2 = aa[0]* std::complex<double>(4.0, 0.0) ; - r1 = abs(t1) ; - r2 = abs(t2) ; - if (r2 > r1) - r1 = r2 ; - if (r1 > Epsilon) - { - d = t1- t2 ; - t1 = d/std::complex<double>(r1, 0.0) ; - } - else - { - d = std::complex<double>(0.0, 0.0) ; - t1 = std::complex<double>(0.0, 0.0) ; - } - r1 = abs (t1) ; - - if (r1 <= Epsilon) - { - /* 1 double root */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[1]; - - if(_order != NULL) - delete _order; - _order = new int[1]; - - - _nbrSol = 1 ; - z = aa[1]/std::complex<double>(-2.0, 0.0); - _solutions[0] = Proche (z, Epsilon) ; - _order[0] = 2 ; - } - else - { - /* 2 simple roots */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[2]; - - if(_order != NULL) - delete _order; - _order = new int[2]; - - - _nbrSol = 2 ; - d = sqrt(d) ; - z = (d-aa[1])/std::complex<double>(2.0, 0.0) ; - _solutions[0] = Proche (z, Epsilon) ; - z = (d+aa[1])/std::complex<double>(-2.0, 0.0); - _solutions[1] = Proche (z, Epsilon) ; - _order[0] = 1 ; - _order[1] = 1 ; - } + double r1, r2 ; + // double epsilon = 1.e-12 ; + std::complex<double> t1, t2, d, z ; + std::complex<double> aa[2] ; + + aa[0] = _coefficients[0]/ _coefficients[2]; + aa[1] = _coefficients[1]/ _coefficients[2]; + + t1 = aa[1]* aa[1] ; + t2 = aa[0]* std::complex<double>(4.0, 0.0) ; + r1 = abs(t1) ; + r2 = abs(t2) ; + if (r2 > r1) + r1 = r2 ; + if (r1 > Epsilon) + { + d = t1- t2 ; + t1 = d/std::complex<double>(r1, 0.0) ; + } + else + { + d = std::complex<double>(0.0, 0.0) ; + t1 = std::complex<double>(0.0, 0.0) ; + } + r1 = abs (t1) ; + + if (r1 <= Epsilon) + { + /* 1 double root */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[1]; + + if(_order != NULL) + delete _order; + _order = new int[1]; + + + _nbrSol = 1 ; + z = aa[1]/std::complex<double>(-2.0, 0.0); + _solutions[0] = Proche (z, Epsilon) ; + _order[0] = 2 ; + } + else + { + /* 2 simple roots */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[2]; + + if(_order != NULL) + delete _order; + _order = new int[2]; + + + _nbrSol = 2 ; + d = sqrt(d) ; + z = (d-aa[1])/std::complex<double>(2.0, 0.0) ; + _solutions[0] = Proche (z, Epsilon) ; + z = (d+aa[1])/std::complex<double>(-2.0, 0.0); + _solutions[1] = Proche (z, Epsilon) ; + _order[0] = 1 ; + _order[1] = 1 ; + } } void Equation::Solve3(int d4) { - int i1, i2, i3 ; - int d3_1r3 , d3_1r2_1r1 ; - double r1, r2, ra[3] ; - // double epsilon = 1.e-12 ; - std::complex<double> j, j2 ; - std::complex<double> d, q, r, s, t, u, v, w ; - std::complex<double> aa[3], zProv[3][3] ; - - - j = std::complex<double>(-0.5, sqrt (3.0) / 2.0) ; - j2 = std::complex<double>(-0.5, -sqrt (3.0) / 2.0) ; - - /* Normalisation of coefficients */ - for (i1 = 0; i1 < 3; i1++) - aa[i1] = _coefficients[i1]/_coefficients[3]; - - if ( d4 == 0 ) - { - /* Test of existence of a triple root */ - d3_1r3 = TestDegree3Triple(aa, Epsilon) ; - - /* Test of existence of 1 doubleroot + 1 simple root */ - d3_1r2_1r1 = TestDegree3SimpleDouble(aa, Epsilon) ; - } - else - { - d3_1r3 = 0 ; - d3_1r2_1r1 = 0 ; - } - - - if (d3_1r3 == 1) - { - /* 1 triple root */ - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[1]; - - if(_order != NULL) - delete _order; - _order = new int[1]; - - _nbrSol = 1 ; - _solutions[0] = Proche (aa[2]/std::complex<double>(-3.0, 0.0) , Epsilon) ; - _order[0] = 3 ; - } - else if (d3_1r2_1r1 == 1) - { - /* 1 simple root + 1 double root */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[2]; - - if(_order != NULL) - delete _order; - _order = new int[2]; - - u = (aa[1]* aa[2])/ std::complex<double>(6.0, 0.0) ; - v = aa[0]/ std::complex<double> (2.0, 0.0); - w = pow(aa[2], 3.0)/ std::complex<double>(27.0, 0.0); - r = (u-v)- w ; - u = pow (r, 1.0 / 3.0) ; - w = aa[2]/ std::complex<double>(3.0, 0.0); - zProv[0][0] = -u; - zProv[0][1] = u * std::complex<double>(2.0,0.0); - zProv[1][0] = u * (j + std::complex<double>(1.0, 0.0)); - zProv[1][1] = u * (j2* std::complex<double>(2.0, 0.0)); - zProv[2][0] = u * (j2+ std::complex<double>(1.0, 0.0)); - zProv[2][1] = u * (j * std::complex<double>(2.0, 0.0)); - for (i1 = 0; i1 <= 2; i1++) - { - zProv[i1][0] = zProv[i1][0]- w; - zProv[i1][1] = zProv[i1][1]- w; - } - for (i2 = 0; i2 < 3; i2++) - { - u = std::complex<double>(1.0, 0.0) ; - - for (i1 = 2; i1 >= 0; i1--) - u = u*zProv[i2][0]+aa[i1] ; - - r1 = abs (u) ; - u = std::complex<double>(1.0, 0.0) ; - - for (i1 = 2; i1 >= 0; i1--) - u = u*zProv[i2][1]+ aa[i1] ; - - r2 = abs (u) ; - ra[i2] = r1 * r1 + r2 * r2 ; - } - i3 = IndiceMin(3, ra) ; - _solutions[0] = Proche ( zProv[i3][0] , Epsilon ) ; - _solutions[1] = Proche ( zProv[i3][1] , Epsilon ) ; - _nbrSol = 2 ; - _order[0] = 2 ; - _order[1] = 1 ; - } - else - { - /* 3 simple roots */ - u = aa[1]/ std::complex<double>(3.0, 0.0); - v = (aa[2]* aa[2]) / std::complex<double>(9.0, 0.0) ; - q = u- v ; - u = (aa[1]* aa[2]) / std::complex<double>(6.0, 0.0) ; - v = aa[0]/ std::complex<double>(2.0, 0.0) ; - w = pow (aa[2], 3.0) / std::complex<double>(27.0, 0.0); - r = (u-v) - w ; - d = sqrt(pow (q, 3.0) + pow (r, 2.0)) ; - s = pow ((r+ d) , 1.0 / 3.0) ; - t = pow ((r- d) , 1.0 / 3.0) ; - w = aa[2]/ std::complex<double>(3.0, 0.0); - - zProv[0][0] = s+ t; - zProv[0][1] = (j* s) + (j2* t) ; - zProv[0][2] = (j2* s) + (j* t) ; - zProv[1][0] = s + (j* t); - zProv[1][1] = (j* s) + t; - zProv[1][2] = j2 * (s+ t) ; - zProv[2][0] = s + (j2* t) ; - zProv[2][1] = j * (s+ t); - zProv[2][2] = (j2* s) + t; - for (i1 = 0; i1 < 3; i1++) - { - for (i2 = 0; i2 < 3; i2++) - zProv[i1][i2] = zProv[i1][i2]- w; - } - for (i3 = 0; i3 < 3; i3++) - { - ra[i3] = 0.0 ; - for (i2 = 0; i2 < 3; i2++) - { - u = std::complex<double>(1.0, 0.0) ; - for (i1 = 2; i1 >= 0; i1--) - u = (u* zProv[i3][i2]) + aa[i1] ; - - r1 = abs (u) ; - ra[i3] = ra[i3] + r1 * r1 ; - } - } - i1 = IndiceMin(3, ra) ; - - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[3]; - - if(_order != NULL) - delete _order; - _order = new int[3]; - - _nbrSol = 3 ; - for (i3 = 0; i3 < 3; i3++) - _solutions[i3] = Proche (zProv[i1][i3] , Epsilon) ; - _order[0] = 1 ; - _order[1] = 1 ; - _order[2] = 1 ; - } + int i1, i2, i3 ; + int d3_1r3 , d3_1r2_1r1 ; + double r1, r2, ra[3] ; + // double epsilon = 1.e-12 ; + std::complex<double> j, j2 ; + std::complex<double> d, q, r, s, t, u, v, w ; + std::complex<double> aa[3], zProv[3][3] ; + + + j = std::complex<double>(-0.5, sqrt (3.0) / 2.0) ; + j2 = std::complex<double>(-0.5, -sqrt (3.0) / 2.0) ; + + /* Normalisation of coefficients */ + for (i1 = 0; i1 < 3; i1++) + aa[i1] = _coefficients[i1]/_coefficients[3]; + + if ( d4 == 0 ) + { + /* Test of existence of a triple root */ + d3_1r3 = TestDegree3Triple(aa, Epsilon) ; + + /* Test of existence of 1 doubleroot + 1 simple root */ + d3_1r2_1r1 = TestDegree3SimpleDouble(aa, Epsilon) ; + } + else + { + d3_1r3 = 0 ; + d3_1r2_1r1 = 0 ; + } + + + if (d3_1r3 == 1) + { + /* 1 triple root */ + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[1]; + + if(_order != NULL) + delete _order; + _order = new int[1]; + + _nbrSol = 1 ; + _solutions[0] = Proche (aa[2]/std::complex<double>(-3.0, 0.0) , Epsilon) ; + _order[0] = 3 ; + } + else if (d3_1r2_1r1 == 1) + { + /* 1 simple root + 1 double root */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[2]; + + if(_order != NULL) + delete _order; + _order = new int[2]; + + u = (aa[1]* aa[2])/ std::complex<double>(6.0, 0.0) ; + v = aa[0]/ std::complex<double> (2.0, 0.0); + w = pow(aa[2], 3.0)/ std::complex<double>(27.0, 0.0); + r = (u-v)- w ; + u = pow (r, 1.0 / 3.0) ; + w = aa[2]/ std::complex<double>(3.0, 0.0); + zProv[0][0] = -u; + zProv[0][1] = u * std::complex<double>(2.0,0.0); + zProv[1][0] = u * (j + std::complex<double>(1.0, 0.0)); + zProv[1][1] = u * (j2* std::complex<double>(2.0, 0.0)); + zProv[2][0] = u * (j2+ std::complex<double>(1.0, 0.0)); + zProv[2][1] = u * (j * std::complex<double>(2.0, 0.0)); + for (i1 = 0; i1 <= 2; i1++) + { + zProv[i1][0] = zProv[i1][0]- w; + zProv[i1][1] = zProv[i1][1]- w; + } + for (i2 = 0; i2 < 3; i2++) + { + u = std::complex<double>(1.0, 0.0) ; + + for (i1 = 2; i1 >= 0; i1--) + u = u*zProv[i2][0]+aa[i1] ; + + r1 = abs (u) ; + u = std::complex<double>(1.0, 0.0) ; + + for (i1 = 2; i1 >= 0; i1--) + u = u*zProv[i2][1]+ aa[i1] ; + + r2 = abs (u) ; + ra[i2] = r1 * r1 + r2 * r2 ; + } + i3 = IndiceMin(3, ra) ; + _solutions[0] = Proche ( zProv[i3][0] , Epsilon ) ; + _solutions[1] = Proche ( zProv[i3][1] , Epsilon ) ; + _nbrSol = 2 ; + _order[0] = 2 ; + _order[1] = 1 ; + } + else + { + /* 3 simple roots */ + u = aa[1]/ std::complex<double>(3.0, 0.0); + v = (aa[2]* aa[2]) / std::complex<double>(9.0, 0.0) ; + q = u- v ; + u = (aa[1]* aa[2]) / std::complex<double>(6.0, 0.0) ; + v = aa[0]/ std::complex<double>(2.0, 0.0) ; + w = pow (aa[2], 3.0) / std::complex<double>(27.0, 0.0); + r = (u-v) - w ; + d = sqrt(pow (q, 3.0) + pow (r, 2.0)) ; + s = pow ((r+ d) , 1.0 / 3.0) ; + t = pow ((r- d) , 1.0 / 3.0) ; + w = aa[2]/ std::complex<double>(3.0, 0.0); + + zProv[0][0] = s+ t; + zProv[0][1] = (j* s) + (j2* t) ; + zProv[0][2] = (j2* s) + (j* t) ; + zProv[1][0] = s + (j* t); + zProv[1][1] = (j* s) + t; + zProv[1][2] = j2 * (s+ t) ; + zProv[2][0] = s + (j2* t) ; + zProv[2][1] = j * (s+ t); + zProv[2][2] = (j2* s) + t; + for (i1 = 0; i1 < 3; i1++) + { + for (i2 = 0; i2 < 3; i2++) + zProv[i1][i2] = zProv[i1][i2]- w; + } + for (i3 = 0; i3 < 3; i3++) + { + ra[i3] = 0.0 ; + for (i2 = 0; i2 < 3; i2++) + { + u = std::complex<double>(1.0, 0.0) ; + for (i1 = 2; i1 >= 0; i1--) + u = (u* zProv[i3][i2]) + aa[i1] ; + + r1 = abs (u) ; + ra[i3] = ra[i3] + r1 * r1 ; + } + } + i1 = IndiceMin(3, ra) ; + + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[3]; + + if(_order != NULL) + delete _order; + _order = new int[3]; + + _nbrSol = 3 ; + for (i3 = 0; i3 < 3; i3++) + _solutions[i3] = Proche (zProv[i1][i3] , Epsilon) ; + _order[0] = 1 ; + _order[1] = 1 ; + _order[2] = 1 ; + } } void Equation::Solve4() { - int i1, i2 ; - int d4_1r4, d4_2r2, d4_1r3_1r1, d4_1r2_2r1 ; - int d4 = 1 ; - double epsilon = 1.e-12 ; - double r, h[4] ; - std::complex<double> d, u, v, w, x, y ; - std::complex<double> aa[4], k[4], b[4], zProv[2][4] ; - - - /* Normalisation of coefficients */ - for (i1 = 0; i1 < 4; i1++) - aa[i1] = _coefficients[i1]/ _coefficients[4]; - - /* Equation reduction : on the form */ - /* (x-s)**4 + p(x-s)**2 + q(x-s) + r = 0 */ - /* these coefficients are inserted into table k : */ - /* k[0] = s */ - /* k[1] = p */ - /* k[2] = q */ - /* k[3] = r */ - k[0] = aa[3]/ std::complex<double>(-4.0, 0.0) ; - u = aa[2] ; - v = ((aa[3]* std::complex<double>(3.0, 0.0)) * (aa[3]/ std::complex<double>(8.0, 0.0))) ; - h[0] = abs (u) ; - h[1] = abs (v) ; - - if (h[0] < h[1]) - h[0] = h[1] ; - if (h[0] > Epsilon) - k[1] = u- v; - else - k[1] = std::complex<double>(0.0, 0.0) ; - - u = aa[1] ; - v = (aa[2]* aa[3]) / std::complex<double>(2.0, 0.0) ; - w = pow (aa[3], 3.0) / std::complex<double>(8.0, 0.0) ; - h[0] = abs (u) ; - h[1] = abs (v) ; - h[2] = abs (w) ; - h[0] = h[IndiceMax(3, h)] ; - if (h[0] > Epsilon) - k[2] = (u- v)+ w ; - else - k[2] = std::complex<double>(0.0, 0.0) ; - u = aa[0] ; - v = (aa[1]* aa[3]) / std::complex<double>(4.0, 0.0); - w = (aa[2]* aa[3]) * (aa[3]/ std::complex<double>(16.0, 0.0)) ; - x = pow (aa[3], 4.0) * std::complex<double>(3.0 / 256.0, 0.0) ; - h[0] = abs (u) ; - h[1] = abs (v) ; - h[2] = abs (w) ; - h[3] = abs (x) ; - h[0] = h[IndiceMax(4, h)] ; - - if (h[0]>Epsilon) - k[3] = (u- v) + (w- x) ; - else - k[3] = std::complex<double>(0.0, 0.0) ; - - /* Test of existence of a quadruple root */ - d4_1r4 = TestDegree4Quad (k, epsilon) ; - - /* Test of existence of 2 double roots */ - d4_2r2 = TestDegree4DoubleDouble (aa, k, epsilon) ; - - /* Test of existence of 1 triple root + 1 simple root */ - d4_1r3_1r1 = TestDegree4SimpleTriple (aa, k, epsilon) ; - - /* Test of existence of 1 double root + 2 simple roots */ - d4_1r2_2r1 = TestDegreeSimpleSimpleDouble (k, epsilon) ; - - - if (d4_1r4 == 1) - { - /* 1 quadruple root */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[1]; - - if(_order != NULL) - delete _order; - _order = new int[1]; - - _nbrSol = 1 ; - _solutions[0] = Proche (k[0], Epsilon) ; - _order[0] = 4 ; - } - else if (d4_2r2 == 1) - { - /* 2 double roots */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[2]; - - if(_order != NULL) - delete _order; - _order = new int[2]; - - u = sqrt (k[1]/ std::complex<double>(-2.0, 0.0)) ; - _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; - _solutions[1] = Proche ((k[0]- u) , Epsilon) ; - _nbrSol = 2 ; - _order[0] = 2 ; - _order[1] = 2 ; - } - else if (d4_1r3_1r1 == 1) - { - /* 1 triple root + 1 simple root */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[2]; - - if(_order != NULL) - delete _order; - _order = new int[2]; - - u = (k[2]* std::complex<double>(-3.0, 0.0)) / (k[1]* std::complex<double>(4.0, 0.0)) ; - v = u * std::complex<double>(-3.0, 0.0); - _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; - _solutions[1] = Proche ((k[0]+ v) , Epsilon) ; - _nbrSol = 2 ; - _order[0] = 3 ; - _order[1] = 1 ; - } - else if (d4_1r2_2r1 == 1) - { - /* 1 double root + 2 simple roots */ - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[3]; - - if(_order != NULL) - delete _order; - _order = new int[3]; - - if (abs (k[1]) <= Epsilon) - { - u = (k[3]* std::complex<double>(-4.0, 0.0)) / (k[2]* std::complex<double>(3.0, 0.0)); - v = sqrt ((u* std::complex<double>(-2.0, 0.0)) * u) ; - _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; - _solutions[1] = Proche ((k[0] + (v- u)) , Epsilon) ; - _solutions[2] = Proche ((k[0] - (v+ u)) , Epsilon) ; - } - else - { - v = (k[2]* k[2]) * std::complex<double>(9.0, 0.0) ; - w = (k[1]* k[3]) * std::complex<double>(32.0, 0.0) ; - u = sqrt((v- w)) ; - v = (k[2] * std::complex<double>(-3.0, 0.0)) ; - w = (k[1] * std::complex<double>(4.0, 0.0)) ; - x = ((v+ u) / w) ; - y = ((v- u) / w) ; - u = ((x* x) * std::complex<double>(-2.0, 0.0)) ; - u = sqrt((u- k[1])) ; - v = ((y* y) * std::complex<double>(-2.0, 0.0)) ; - v = sqrt((v- k[1])) ; - zProv[0][0] = (k[0]+ x) ; - zProv[0][1] = (k[0] - (x- u)) ; - zProv[0][2] = (k[0] - (x+ u)) ; - zProv[1][0] = (k[0]+ y) ; - zProv[1][1] = (k[0] - (y- v)) ; - zProv[1][2] = (k[0] - (y+ v)) ; - h[0] = 0.0 ; - h[1] = 0.0 ; - for (i1 = 0; i1 < 3; i1++) - { - u = std::complex<double>(1.0, 0.0) ; - for (i2 = 3; i2 >= 0; i2--) - u = ((u* zProv[0][i1])+ aa[i2]) ; - - r = abs (u) ; - h[0] = h[0] + r * r ; - u = std::complex<double>(1.0, 0.0) ; - for (i2 = 3; i2 >= 0; i2--) - u = ((u* zProv[1][i1])+ aa[i2]) ; - r = abs (u) ; - h[1] = h[1] + r * r ; - } - i1 = IndiceMin (2, h) ; - for (i2 = 0; i2 < 3; i2++) - _solutions[i2] = Proche (zProv[i1][i2] , Epsilon) ; - } - _nbrSol = 3 ; - _order[0] = 2 ; - _order[1] = 1 ; - _order[2] = 1 ; - } - else - { - /* 4 simple roots */ - u = ((aa[0]* aa[2]) * std::complex<double>(4.0, 0.0)) ; - v = (aa[1] * aa[1]) ; - w = ((aa[0]* aa[3]) * aa[3]) ; - b[0] = (u - (v+ w)) ; - b[1] = ((aa[1]* aa[3]) - (aa[0]* std::complex<double>(4.0, 0.0))) ; - b[2] = -aa[2] ; - b[3] = std::complex<double>(1.0, 0.0) ; - - /* The third degree equation is solved by forcing 3 distinct roots (computation precision problem) */ - Equation eq(3,b); - eq.Solve3(d4); - - //Solve3(d4); - h[0] = abs ((eq.get_solutions()[1]- eq.get_solutions()[2])) ; /* the root the most distant to */ - h[1] = abs ((eq.get_solutions()[0]- eq.get_solutions()[2])) ; /* the 2 others is selected */ - h[2] = abs ((eq.get_solutions()[0]- eq.get_solutions()[1])) ; - i1 = IndiceMin (3, h) ; - u = eq.get_solutions()[i1] ; - v = ((aa[2]- u) * std::complex<double>(4.0, 0.0)) ; - v = sqrt(((aa[3]* aa[3]) - v)) ; - w = sqrt(((u* u) - (aa[0]* std::complex<double>(4.0, 0.0)))) ; - x = ((aa[3]+ v) / std::complex<double>(2.0, 0.0)) ; - y = ((u+ w) / std::complex<double>(2.0, 0.0)) ; - d = sqrt(((x* x) - (y* std::complex<double>(4.0, 0.0)))) ; - zProv[0][0] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; - zProv[0][1] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; - - x = ((aa[3]- v) / std::complex<double>(2.0, 0.0)) ; - y = ((u- w) / std::complex<double>(2.0, 0.0)) ; - d = sqrt((x*x) - (y* std::complex<double>(4.0, 0.0))) ; - zProv[0][2] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; - zProv[0][3] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; - - x = ((aa[3]+ v) / std::complex<double>(2.0, 0.0)) ; - y = ((u- w) / std::complex<double>(2.0, 0.0)) ; - d = sqrt(((x*x) - (y* std::complex<double>(4.0, 0.0)))) ; - zProv[1][0] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; - zProv[1][1] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; - - x = ((aa[3]- v) / std::complex<double>(2.0, 0.0)) ; - y = ((u+ w) / std::complex<double>(2.0, 0.0)) ; - d = sqrt((x*x) - (y* std::complex<double>(4.0, 0.0))) ; - zProv[1][2] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; - zProv[1][3] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; - - h[0] = 0.0 ; - h[1] = 0.0 ; - for (i1 = 0; i1 < 4; i1++) - { - u = std::complex<double>(1.0, 0.0) ; - - for (i2 = 3; i2 >= 0; i2--) - u = ((u* zProv[0][i1])+ aa[i2]) ; - - r = abs (u) ; - h[0] = h[0] + r * r ; - u = std::complex<double>(1.0, 0.0) ; - - for (i2 = 3; i2 >= 0; i2--) - u = ((u* zProv[1][i1])+ aa[i2]) ; - - r = abs(u) ; - h[1] = h[1] + r * r ; - } - i1 = IndiceMin (2, h) ; - - if(_solutions != NULL) - delete _solutions; - _solutions = new std::complex<double>[4]; - - if(_order != NULL) - delete _order; - _order = new int[4]; - - for (i2 = 0; i2 < 4; i2++) - { - _solutions[i2] = Proche (zProv[i1][i2] , Epsilon) ; - _order[i2] = 1 ; - } - _nbrSol = 4 ; - } + int i1, i2 ; + int d4_1r4, d4_2r2, d4_1r3_1r1, d4_1r2_2r1 ; + int d4 = 1 ; + double epsilon = 1.e-12 ; + double r, h[4] ; + std::complex<double> d, u, v, w, x, y ; + std::complex<double> aa[4], k[4], b[4], zProv[2][4] ; + + + /* Normalisation of coefficients */ + for (i1 = 0; i1 < 4; i1++) + aa[i1] = _coefficients[i1]/ _coefficients[4]; + + /* Equation reduction : on the form */ + /* (x-s)**4 + p(x-s)**2 + q(x-s) + r = 0 */ + /* these coefficients are inserted into table k : */ + /* k[0] = s */ + /* k[1] = p */ + /* k[2] = q */ + /* k[3] = r */ + k[0] = aa[3]/ std::complex<double>(-4.0, 0.0) ; + u = aa[2] ; + v = ((aa[3]* std::complex<double>(3.0, 0.0)) * (aa[3]/ std::complex<double>(8.0, 0.0))) ; + h[0] = abs (u) ; + h[1] = abs (v) ; + + if (h[0] < h[1]) + h[0] = h[1] ; + if (h[0] > Epsilon) + k[1] = u- v; + else + k[1] = std::complex<double>(0.0, 0.0) ; + + u = aa[1] ; + v = (aa[2]* aa[3]) / std::complex<double>(2.0, 0.0) ; + w = pow (aa[3], 3.0) / std::complex<double>(8.0, 0.0) ; + h[0] = abs (u) ; + h[1] = abs (v) ; + h[2] = abs (w) ; + h[0] = h[IndiceMax(3, h)] ; + if (h[0] > Epsilon) + k[2] = (u- v)+ w ; + else + k[2] = std::complex<double>(0.0, 0.0) ; + u = aa[0] ; + v = (aa[1]* aa[3]) / std::complex<double>(4.0, 0.0); + w = (aa[2]* aa[3]) * (aa[3]/ std::complex<double>(16.0, 0.0)) ; + x = pow (aa[3], 4.0) * std::complex<double>(3.0 / 256.0, 0.0) ; + h[0] = abs (u) ; + h[1] = abs (v) ; + h[2] = abs (w) ; + h[3] = abs (x) ; + h[0] = h[IndiceMax(4, h)] ; + + if (h[0]>Epsilon) + k[3] = (u- v) + (w- x) ; + else + k[3] = std::complex<double>(0.0, 0.0) ; + + /* Test of existence of a quadruple root */ + d4_1r4 = TestDegree4Quad (k, epsilon) ; + + /* Test of existence of 2 double roots */ + d4_2r2 = TestDegree4DoubleDouble (aa, k, epsilon) ; + + /* Test of existence of 1 triple root + 1 simple root */ + d4_1r3_1r1 = TestDegree4SimpleTriple (aa, k, epsilon) ; + + /* Test of existence of 1 double root + 2 simple roots */ + d4_1r2_2r1 = TestDegreeSimpleSimpleDouble (k, epsilon) ; + + + if (d4_1r4 == 1) + { + /* 1 quadruple root */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[1]; + + if(_order != NULL) + delete _order; + _order = new int[1]; + + _nbrSol = 1 ; + _solutions[0] = Proche (k[0], Epsilon) ; + _order[0] = 4 ; + } + else if (d4_2r2 == 1) + { + /* 2 double roots */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[2]; + + if(_order != NULL) + delete _order; + _order = new int[2]; + + u = sqrt (k[1]/ std::complex<double>(-2.0, 0.0)) ; + _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; + _solutions[1] = Proche ((k[0]- u) , Epsilon) ; + _nbrSol = 2 ; + _order[0] = 2 ; + _order[1] = 2 ; + } + else if (d4_1r3_1r1 == 1) + { + /* 1 triple root + 1 simple root */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[2]; + + if(_order != NULL) + delete _order; + _order = new int[2]; + + u = (k[2]* std::complex<double>(-3.0, 0.0)) / (k[1]* std::complex<double>(4.0, 0.0)) ; + v = u * std::complex<double>(-3.0, 0.0); + _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; + _solutions[1] = Proche ((k[0]+ v) , Epsilon) ; + _nbrSol = 2 ; + _order[0] = 3 ; + _order[1] = 1 ; + } + else if (d4_1r2_2r1 == 1) + { + /* 1 double root + 2 simple roots */ + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[3]; + + if(_order != NULL) + delete _order; + _order = new int[3]; + + if (abs (k[1]) <= Epsilon) + { + u = (k[3]* std::complex<double>(-4.0, 0.0)) / (k[2]* std::complex<double>(3.0, 0.0)); + v = sqrt ((u* std::complex<double>(-2.0, 0.0)) * u) ; + _solutions[0] = Proche ((k[0]+ u) , Epsilon) ; + _solutions[1] = Proche ((k[0] + (v- u)) , Epsilon) ; + _solutions[2] = Proche ((k[0] - (v+ u)) , Epsilon) ; + } + else + { + v = (k[2]* k[2]) * std::complex<double>(9.0, 0.0) ; + w = (k[1]* k[3]) * std::complex<double>(32.0, 0.0) ; + u = sqrt((v- w)) ; + v = (k[2] * std::complex<double>(-3.0, 0.0)) ; + w = (k[1] * std::complex<double>(4.0, 0.0)) ; + x = ((v+ u) / w) ; + y = ((v- u) / w) ; + u = ((x* x) * std::complex<double>(-2.0, 0.0)) ; + u = sqrt((u- k[1])) ; + v = ((y* y) * std::complex<double>(-2.0, 0.0)) ; + v = sqrt((v- k[1])) ; + zProv[0][0] = (k[0]+ x) ; + zProv[0][1] = (k[0] - (x- u)) ; + zProv[0][2] = (k[0] - (x+ u)) ; + zProv[1][0] = (k[0]+ y) ; + zProv[1][1] = (k[0] - (y- v)) ; + zProv[1][2] = (k[0] - (y+ v)) ; + h[0] = 0.0 ; + h[1] = 0.0 ; + for (i1 = 0; i1 < 3; i1++) + { + u = std::complex<double>(1.0, 0.0) ; + for (i2 = 3; i2 >= 0; i2--) + u = ((u* zProv[0][i1])+ aa[i2]) ; + + r = abs (u) ; + h[0] = h[0] + r * r ; + u = std::complex<double>(1.0, 0.0) ; + for (i2 = 3; i2 >= 0; i2--) + u = ((u* zProv[1][i1])+ aa[i2]) ; + r = abs (u) ; + h[1] = h[1] + r * r ; + } + i1 = IndiceMin (2, h) ; + for (i2 = 0; i2 < 3; i2++) + _solutions[i2] = Proche (zProv[i1][i2] , Epsilon) ; + } + _nbrSol = 3 ; + _order[0] = 2 ; + _order[1] = 1 ; + _order[2] = 1 ; + } + else + { + /* 4 simple roots */ + u = ((aa[0]* aa[2]) * std::complex<double>(4.0, 0.0)) ; + v = (aa[1] * aa[1]) ; + w = ((aa[0]* aa[3]) * aa[3]) ; + b[0] = (u - (v+ w)) ; + b[1] = ((aa[1]* aa[3]) - (aa[0]* std::complex<double>(4.0, 0.0))) ; + b[2] = -aa[2] ; + b[3] = std::complex<double>(1.0, 0.0) ; + + /* The third degree equation is solved by forcing 3 distinct roots (computation precision problem) */ + Equation eq(3,b); + eq.Solve3(d4); + + //Solve3(d4); + h[0] = abs ((eq.get_solutions()[1]- eq.get_solutions()[2])) ; /* the root the most distant to */ + h[1] = abs ((eq.get_solutions()[0]- eq.get_solutions()[2])) ; /* the 2 others is selected */ + h[2] = abs ((eq.get_solutions()[0]- eq.get_solutions()[1])) ; + i1 = IndiceMin (3, h) ; + u = eq.get_solutions()[i1] ; + v = ((aa[2]- u) * std::complex<double>(4.0, 0.0)) ; + v = sqrt(((aa[3]* aa[3]) - v)) ; + w = sqrt(((u* u) - (aa[0]* std::complex<double>(4.0, 0.0)))) ; + x = ((aa[3]+ v) / std::complex<double>(2.0, 0.0)) ; + y = ((u+ w) / std::complex<double>(2.0, 0.0)) ; + d = sqrt(((x* x) - (y* std::complex<double>(4.0, 0.0)))) ; + zProv[0][0] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; + zProv[0][1] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; + + x = ((aa[3]- v) / std::complex<double>(2.0, 0.0)) ; + y = ((u- w) / std::complex<double>(2.0, 0.0)) ; + d = sqrt((x*x) - (y* std::complex<double>(4.0, 0.0))) ; + zProv[0][2] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; + zProv[0][3] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; + + x = ((aa[3]+ v) / std::complex<double>(2.0, 0.0)) ; + y = ((u- w) / std::complex<double>(2.0, 0.0)) ; + d = sqrt(((x*x) - (y* std::complex<double>(4.0, 0.0)))) ; + zProv[1][0] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; + zProv[1][1] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; + + x = ((aa[3]- v) / std::complex<double>(2.0, 0.0)) ; + y = ((u+ w) / std::complex<double>(2.0, 0.0)) ; + d = sqrt((x*x) - (y* std::complex<double>(4.0, 0.0))) ; + zProv[1][2] = ((x- d) / std::complex<double>(-2.0, 0.0)) ; + zProv[1][3] = ((x+ d) / std::complex<double>(-2.0, 0.0)) ; + + h[0] = 0.0 ; + h[1] = 0.0 ; + for (i1 = 0; i1 < 4; i1++) + { + u = std::complex<double>(1.0, 0.0) ; + + for (i2 = 3; i2 >= 0; i2--) + u = ((u* zProv[0][i1])+ aa[i2]) ; + + r = abs (u) ; + h[0] = h[0] + r * r ; + u = std::complex<double>(1.0, 0.0) ; + + for (i2 = 3; i2 >= 0; i2--) + u = ((u* zProv[1][i1])+ aa[i2]) ; + + r = abs(u) ; + h[1] = h[1] + r * r ; + } + i1 = IndiceMin (2, h) ; + + if(_solutions != NULL) + delete _solutions; + _solutions = new std::complex<double>[4]; + + if(_order != NULL) + delete _order; + _order = new int[4]; + + for (i2 = 0; i2 < 4; i2++) + { + _solutions[i2] = Proche (zProv[i1][i2] , Epsilon) ; + _order[i2] = 1 ; + } + _nbrSol = 4 ; + } } int Equation::TestDegree3Triple(std::complex<double>* a, double epsilon) { - double d, dp[2], q, r ; - std::complex<double> u, v ; - - - u = a[2]* a[2] ; - v = a[1]*std::complex<double>(3.0, 0.0) ; - dp[0] = abs (u) ; - dp[1] = abs (v) ; - d = (dp[0] > dp[1]) ? dp[0] : dp[1] ; - q = (d > epsilon) ? abs((u- v)/ std::complex<double> (d, 0.0)) - : 0.0 ; - - u = a[1]* a[2]; - v = a[0]* std::complex<double>(9.0, 0.0) ; - dp[0] = abs (u) ; - dp[1] = abs (v) ; - d = (dp[0] > dp[1]) ? dp[0] : dp[1] ; - r = (d > epsilon) ? abs ((u-v)/std::complex<double>(d, 0.0)) - : 0.0 ; - - return ((q <= epsilon) && (r <= epsilon)) ? 1 : 0 ; + double d, dp[2], q, r ; + std::complex<double> u, v ; + + + u = a[2]* a[2] ; + v = a[1]*std::complex<double>(3.0, 0.0) ; + dp[0] = abs (u) ; + dp[1] = abs (v) ; + d = (dp[0] > dp[1]) ? dp[0] : dp[1] ; + q = (d > epsilon) ? abs((u- v)/ std::complex<double> (d, 0.0)) + : 0.0 ; + + u = a[1]* a[2]; + v = a[0]* std::complex<double>(9.0, 0.0) ; + dp[0] = abs (u) ; + dp[1] = abs (v) ; + d = (dp[0] > dp[1]) ? dp[0] : dp[1] ; + r = (d > epsilon) ? abs ((u-v)/std::complex<double>(d, 0.0)) + : 0.0 ; + + return ((q <= epsilon) && (r <= epsilon)) ? 1 : 0 ; } int Equation::TestDegree3SimpleDouble(std::complex<double>* a, double epsilon) { - int i ; - double d, k, r[5] ; - std::complex<double> u, t[5] ; + int i ; + double d, k, r[5] ; + std::complex<double> u, t[5] ; - u = a[1]*a[2] ; - t[0] = pow (a[1], 3.0)*std::complex<double>(4.0, 0.0) ; - t[1] = a[0]*a[0]* std::complex<double>(27.0, 0.0); - t[2] = a[0]* std::complex<double>(4.0, 0.0)*pow (a[2], 3.0) ; - t[3] = -(u* u) ; - t[4] = std::complex<double>(-18.0, 0.0)* a[0] * u; + u = a[1]*a[2] ; + t[0] = pow (a[1], 3.0)*std::complex<double>(4.0, 0.0) ; + t[1] = a[0]*a[0]* std::complex<double>(27.0, 0.0); + t[2] = a[0]* std::complex<double>(4.0, 0.0)*pow (a[2], 3.0) ; + t[3] = -(u* u) ; + t[4] = std::complex<double>(-18.0, 0.0)* a[0] * u; - for (i = 0 ; i < 5 ; i++) - r[i] = abs (t[i]) ; + for (i = 0 ; i < 5 ; i++) + r[i] = abs (t[i]) ; - k = r[IndiceMax(5, r)] ; + k = r[IndiceMax(5, r)] ; - for (i = 1 ; i < 5 ; i++) - t[0] = t[0]+t[i]; + for (i = 1 ; i < 5 ; i++) + t[0] = t[0]+t[i]; - d = (k > epsilon) ? abs (t[0]/std::complex<double>(k,0.0)) - : 0.0 ; + d = (k > epsilon) ? abs (t[0]/std::complex<double>(k,0.0)) + : 0.0 ; - return (d <= epsilon) ? 1 : 0 ; + return (d <= epsilon) ? 1 : 0 ; } int Equation::IndiceMin ( int n , double *list ) { - int i, iMin ; - double xMin ; - - iMin = 0 ; - xMin = list[0] ; - for (i = 1; i < n; i++) - { - if ( list[i] < xMin ) - { - iMin = i ; - xMin = list[i] ; - } - } - return iMin ; + int i, iMin ; + double xMin ; + + iMin = 0 ; + xMin = list[0] ; + for (i = 1; i < n; i++) + { + if ( list[i] < xMin ) + { + iMin = i ; + xMin = list[i] ; + } + } + return iMin ; } int Equation::IndiceMax ( int n , double *list) { - int i, iMax ; - double xMax ; - - iMax = 0 ; - xMax = list[0] ; - for (i = 1; i < n; i++) - { - if ( list[i] > xMax ) - { - iMax = i ; - xMax = list[i] ; - } - } - return iMax ; + int i, iMax ; + double xMax ; + + iMax = 0 ; + xMax = list[0] ; + for (i = 1; i < n; i++) + { + if ( list[i] > xMax ) + { + iMax = i ; + xMax = list[i] ; + } + } + return iMax ; } int Equation::TestDegree4Quad ( std::complex<double> *a , double epsilon ) { - double r1, r2, r3 ; + double r1, r2, r3 ; - r1 = abs (a[1]) ; - r2 = abs (a[2]) ; - r3 = abs (a[3]) ; + r1 = abs (a[1]) ; + r2 = abs (a[2]) ; + r3 = abs (a[3]) ; - return ((r1 < epsilon) && (r2 < epsilon) && (r3 < epsilon)) ? 1 : 0 ; + return ((r1 < epsilon) && (r2 < epsilon) && (r3 < epsilon)) ? 1 : 0 ; } int Equation::TestDegree4DoubleDouble ( std::complex<double> *a , std::complex<double> *k , double epsilon ) { - int i ; - int d4 ; - double r0, r1, r2, h[5] ; - std::complex<double> u, t[5] ; - - - u = (a[3]* a[3]) ; - t[0] = (u* u) * std::complex<double>(3.0 / 16.0, 0.0); - t[1] = a[0] * std::complex<double>(4.0,0.0); - t[2] = a[3] * a[1]; - t[3] = u * a[2]; - t[4] = a[2] * a[2]; - for (i = 0 ; i < 5 ; i++) - h[i] = abs (t[i]) ; - - r1 = h[IndiceMax(5, h)] ; - u = (t[0]- t[1]) + t[2]; - u = u - (t[3]- t[4]) ; - r2 = (r1 > epsilon) ? abs (u) / r1 : 0.0 ; - - r1 = abs (k[2]) ; - r0 = abs (k[1]) ; - - if ((r0 >= epsilon) && (r1 < epsilon) && (r2 < epsilon)) - d4 = 1 ; - else - d4 = 0 ; - - return d4 ; + int i ; + int d4 ; + double r0, r1, r2, h[5] ; + std::complex<double> u, t[5] ; + + + u = (a[3]* a[3]) ; + t[0] = (u* u) * std::complex<double>(3.0 / 16.0, 0.0); + t[1] = a[0] * std::complex<double>(4.0,0.0); + t[2] = a[3] * a[1]; + t[3] = u * a[2]; + t[4] = a[2] * a[2]; + for (i = 0 ; i < 5 ; i++) + h[i] = abs (t[i]) ; + + r1 = h[IndiceMax(5, h)] ; + u = (t[0]- t[1]) + t[2]; + u = u - (t[3]- t[4]) ; + r2 = (r1 > epsilon) ? abs (u) / r1 : 0.0 ; + + r1 = abs (k[2]) ; + r0 = abs (k[1]) ; + + if ((r0 >= epsilon) && (r1 < epsilon) && (r2 < epsilon)) + d4 = 1 ; + else + d4 = 0 ; + + return d4 ; } int Equation::TestDegree4SimpleTriple ( std::complex<double> *a , std::complex<double> *k , double epsilon ) { - int i ; - int d4 ; - double r, r0, r1, r2, h[4] ; - std::complex<double> u, t[4] ; - - - t[0] = a[2] * a[2] ; - t[1] = a[0] * std::complex<double>(12.0, 0.0); - t[2] = (a[1]* a[3]) * std::complex<double>(3.0, 0.0) ; - for (i = 0 ; i < 3 ; i++) - h[i] = abs (t[i]) ; - - r = h[IndiceMax(3, h)] ; - u = t[0] + (t[1]- t[2]) ; - r1 = (r > epsilon) ? abs (u) / r : 0.0 ; - - t[0] = a[1] * a[1]; - t[1] = (a[0]* a[2]) * std::complex<double>(4.0, 0.0) ; - u = a[3]* std::complex<double>(3.0, 0.0) ; - t[2] = (u* u) * (a[0]* std::complex<double>(3.0, 0.0)) ; - t[3] = (a[2]* a[2]) * a[2] ; - for (i = 0 ; i < 4 ; i++) - h[i] = abs (t[i]) ; - r = h[IndiceMax(4, h)] ; - u = ((t[0]- t[1])* std::complex<double>(27.0, 0.0))+ (t[2]- t[3]) ; - r2 = (r > epsilon) ? abs (u) / r : 0.0 ; - - r0 = abs (k[1]) ; - - if ((r0 >= epsilon) && (r1 < epsilon) && (r2 < epsilon)) - d4 = 1 ; - else - d4 = 0 ; - - return d4 ; + int i ; + int d4 ; + double r, r0, r1, r2, h[4] ; + std::complex<double> u, t[4] ; + + + t[0] = a[2] * a[2] ; + t[1] = a[0] * std::complex<double>(12.0, 0.0); + t[2] = (a[1]* a[3]) * std::complex<double>(3.0, 0.0) ; + for (i = 0 ; i < 3 ; i++) + h[i] = abs (t[i]) ; + + r = h[IndiceMax(3, h)] ; + u = t[0] + (t[1]- t[2]) ; + r1 = (r > epsilon) ? abs (u) / r : 0.0 ; + + t[0] = a[1] * a[1]; + t[1] = (a[0]* a[2]) * std::complex<double>(4.0, 0.0) ; + u = a[3]* std::complex<double>(3.0, 0.0) ; + t[2] = (u* u) * (a[0]* std::complex<double>(3.0, 0.0)) ; + t[3] = (a[2]* a[2]) * a[2] ; + for (i = 0 ; i < 4 ; i++) + h[i] = abs (t[i]) ; + r = h[IndiceMax(4, h)] ; + u = ((t[0]- t[1])* std::complex<double>(27.0, 0.0))+ (t[2]- t[3]) ; + r2 = (r > epsilon) ? abs (u) / r : 0.0 ; + + r0 = abs (k[1]) ; + + if ((r0 >= epsilon) && (r1 < epsilon) && (r2 < epsilon)) + d4 = 1 ; + else + d4 = 0 ; + + return d4 ; } int Equation::TestDegreeSimpleSimpleDouble( std::complex<double> *a , double epsilon ) { - double r[3] ; - std::complex<double> u, v, w ; + double r[3] ; + std::complex<double> u, v, w ; - u = (a[1]* a[1]) - (a[3]* std::complex<double>(4.0, 0.0)) ; - u = u* a[3] * u * std::complex<double>(16.0, 0.0); - r[0] = abs (u) ; + u = (a[1]* a[1]) - (a[3]* std::complex<double>(4.0, 0.0)) ; + u = u* a[3] * u * std::complex<double>(16.0, 0.0); + r[0] = abs (u) ; - w = pow (a[1], 3.0) * std::complex<double>(4.0, 0.0) ; - v = (a[2]* a[2]) * std::complex<double>(27.0, 0.0) , - v = (w+ v) * (a[2]* a[2]) ; - r[1] = abs (v) ; + w = pow (a[1], 3.0) * std::complex<double>(4.0, 0.0) ; + v = (a[2]* a[2]) * std::complex<double>(27.0, 0.0) , + v = (w+ v) * (a[2]* a[2]) ; + r[1] = abs (v) ; - w = (a[1]* a[2]) * (a[2]* a[3]) ; - w = w * std::complex<double>(144.0, 0.0) ; - r[2] = abs (w) ; + w = (a[1]* a[2]) * (a[2]* a[3]) ; + w = w * std::complex<double>(144.0, 0.0) ; + r[2] = abs (w) ; - r[1] = r[IndiceMax(3, r)] ; - if (r[1] < epsilon) - r[0] = 0.0 ; - else if (r[1] <= 1.0) - r[0] = abs ((u- v)+ w) ; - else - r[0] = abs (((u- v)+ w)/ std::complex<double>(r[1], 0.0)) ; + r[1] = r[IndiceMax(3, r)] ; + if (r[1] < epsilon) + r[0] = 0.0 ; + else if (r[1] <= 1.0) + r[0] = abs ((u- v)+ w) ; + else + r[0] = abs (((u- v)+ w)/ std::complex<double>(r[1], 0.0)) ; - return (r[0] < (2.0 * epsilon)) ? 1 : 0 ; + return (r[0] < (2.0 * epsilon)) ? 1 : 0 ; } } diff --git a/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.cpp b/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.cpp index 25edfdf9895dca7f19a1e4517dd278cbffc00298..e293e7aeef06b6ae9c8bf01824fd8ca6e2de7f2c 100644 --- a/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.cpp +++ b/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.cpp @@ -17,7 +17,7 @@ namespace ossimplugins GMSTDateTime::GMSTDateTime(): - _tms(0) + _tms(0) { } @@ -26,26 +26,26 @@ GMSTDateTime::~GMSTDateTime() } GMSTDateTime::GMSTDateTime(const GMSTDateTime& rhs): - _tms(rhs._tms), - _origine(rhs._origine) + _tms(rhs._tms), + _origine(rhs._origine) { } GMSTDateTime::GMSTDateTime(double tms, Ori_TSM_Green origine): - _tms(tms), - _origine(origine) + _tms(tms), + _origine(origine) { } GMSTDateTime::GMSTDateTime(CivilDateTime& rhs) { - rhs.AsGMSTDateTime(this); + rhs.AsGMSTDateTime(this); } GMSTDateTime& GMSTDateTime::operator=(const GMSTDateTime& rhs) { - _tms = rhs._tms; - _origine = rhs._origine; - return *this; + _tms = rhs._tms; + _origine = rhs._origine; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.h b/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.h index db5a186988606651c3e21569f9c9d391c36d6435..a6a3abee29e1091bb2c87ed36ffbfe633a93a4ef 100644 --- a/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.h +++ b/Utilities/otbossimplugins/ossim/otb/GMSTDateTime.h @@ -28,59 +28,59 @@ class GMSTDateTime { public: - enum Ori_TSM_Green { AN1900 , AN1950 , AN2000 } ; - - /** - * @brief constructor - */ - GMSTDateTime(); - /** - * @brief Destructor - */ - ~GMSTDateTime(); - /** - * @brief Copy constructor - */ - GMSTDateTime(const GMSTDateTime& rhs); - - /** - * @brief Constructor with date initialisation - */ - GMSTDateTime(double tsm, Ori_TSM_Green origine); - - /** - * @brief Constructor with date initialisation using a CivilDateTime - */ - GMSTDateTime(CivilDateTime& rhs); - - /** - * @brief Affectation operator - */ - GMSTDateTime& operator=(const GMSTDateTime& rhs); - - double get_tms() - { - return _tms; - }; - - void set_tms(double tms) - { - _tms = tms; - }; - - Ori_TSM_Green get_origine() - { - return _origine; - }; - - void set_origine(Ori_TSM_Green origine) - { - _origine = origine; - } + enum Ori_TSM_Green { AN1900 , AN1950 , AN2000 } ; + + /** + * @brief constructor + */ + GMSTDateTime(); + /** + * @brief Destructor + */ + ~GMSTDateTime(); + /** + * @brief Copy constructor + */ + GMSTDateTime(const GMSTDateTime& rhs); + + /** + * @brief Constructor with date initialisation + */ + GMSTDateTime(double tsm, Ori_TSM_Green origine); + + /** + * @brief Constructor with date initialisation using a CivilDateTime + */ + GMSTDateTime(CivilDateTime& rhs); + + /** + * @brief Affectation operator + */ + GMSTDateTime& operator=(const GMSTDateTime& rhs); + + double get_tms() + { + return _tms; + }; + + void set_tms(double tms) + { + _tms = tms; + }; + + Ori_TSM_Green get_origine() + { + return _origine; + }; + + void set_origine(Ori_TSM_Green origine) + { + _origine = origine; + } protected: - double _tms; - Ori_TSM_Green _origine; + double _tms; + Ori_TSM_Green _origine; private: }; diff --git a/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.cpp b/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.cpp index a8fd55fd73a1c84fffb35c377b52b880db8ab2c5..0564aaebbf98eb1409cd0b8b048b3e8249a623d5 100644 --- a/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.cpp +++ b/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.cpp @@ -42,24 +42,24 @@ GalileanEphemeris::GalileanEphemeris(const GalileanEphemeris& rhs) : Ephemeris(r GalileanEphemeris& GalileanEphemeris::operator=(const GalileanEphemeris& rhs) { - ((Ephemeris)*this) = ((Ephemeris)rhs); - return *this; + ((Ephemeris)*this) = ((Ephemeris)rhs); + return *this; } void GalileanEphemeris::ToGeographic(GeographicEphemeris* vGeo) { - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - GMSTDateTime h; - h.set_origine(GMSTDateTime::AN1950); - double s,c; + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + GMSTDateTime h; + h.set_origine(GMSTDateTime::AN1950); + double s,c; - double pos[3]; - double vitesse[3]; + double pos[3]; + double vitesse[3]; - _date.AsGMSTDateTime(&h) ; + _date.AsGMSTDateTime(&h) ; c = cos (h.get_tms()) ; s = sin (h.get_tms()) ; - vGeo->set_date(_date); + vGeo->set_date(_date); pos[0] = _position[0] * c + _position[1] * s ; pos[1] = - _position[0] * s + _position[1] * c ; @@ -74,22 +74,22 @@ void GalileanEphemeris::ToGeographic(GeographicEphemeris* vGeo) void GalileanEphemeris::ToGeographic(double greenwich,GeographicEphemeris* vGeo) { - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - int etat, ierr ; - double p[10],pd[10]; - double day; + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + int etat, ierr ; + double p[10],pd[10]; + double day; - etat = 0 ; + etat = 0 ; - vGeo->set_date(this->_date); + vGeo->set_date(this->_date); day= this->_date.get_day0hTU().get_julianDate(); ierr = p2nutt( 2, greenwich, day, p, pd ) ; - double position[3]; - double vitesse[3]; + double position[3]; + double vitesse[3]; position[0] = _position[0]*p[1] + _position[1]*p[4] + _position[2]*p[7] ; @@ -103,34 +103,34 @@ void GalileanEphemeris::ToGeographic(double greenwich,GeographicEphemeris* vGeo) vitesse[2] = _vitesse[0]*p[3] + _vitesse[1]*p[6] + _vitesse[2]*p[9] + OMEGATERRE * (_position[0]*pd[3] + _position[1]*pd[6] + _position[2]*pd[9] ); - vGeo->set_position(position); - vGeo->set_vitesse(vitesse); + vGeo->set_position(position); + vGeo->set_vitesse(vitesse); } GalileanEphemeris::operator GeographicEphemeris() { - GeographicEphemeris rhs; - ToGeographic(&rhs); - return rhs; + GeographicEphemeris rhs; + ToGeographic(&rhs); + return rhs; } GalileanEphemeris::GalileanEphemeris(GeographicEphemeris& rhs) { - rhs.ToGalilean(this); + rhs.ToGalilean(this); } int GalileanEphemeris::p2nutt(int newcmb, double greenwich, double day, double p[], double pd[] ) { - const double PI = 3.14159265358979323846 ; - const double DEUXPI = 6.28318530717958647693 ; - // const double MU = 3.9860047e+14 ; - // const double JOURCIVIL_LENGTH = 86400.0 ; - // const double JOURSIDERAL = 86164.09054 ; - // const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - // const double CLUM = 2.99792458e+8 ; - // const double A_WGS84 = 6378137.0 ; - // const double B_WGS84 = 6356752.3141 ; + const double PI = 3.14159265358979323846 ; + const double DEUXPI = 6.28318530717958647693 ; + // const double MU = 3.9860047e+14 ; + // const double JOURCIVIL_LENGTH = 86400.0 ; + // const double JOURSIDERAL = 86164.09054 ; + // const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + // const double CLUM = 2.99792458e+8 ; + // const double A_WGS84 = 6378137.0 ; + // const double B_WGS84 = 6356752.3141 ; /* GIVES TRANSFORMATION MATRIX P(3,3) FROM QUASI-INERTIAL MEAN SYSTEM @@ -151,63 +151,63 @@ int GalileanEphemeris::p2nutt(int newcmb, double greenwich, double day, COMMON BLOCKS FROM PEPSOC SUBROUTINE 'P2COOT' ARE USED. */ - double arg[10] ; - double t, ff, dd, dpsi, deps; - double ecl, cecl, secl, dnu, srang; - double sra, cra, snu, cnu, sde, cde; - double facsin[10],faccos[10]; - - int i; - - /* DATA FOR NUTATION MODELLING */ - facsin[0]=0.e0; - facsin[1]=-0.8338601e-04; - facsin[2]=-0.6393238e-05; - facsin[3]=-0.1102466e-05; - facsin[4]=0.9996858e-06; - facsin[5]=0.6913443e-06; - facsin[6]=0.3451873e-06; - facsin[7]=-0.2506487e-06; - facsin[8]=-0.1871381e-06; - facsin[9]=-0.1459289e-06; - - faccos[0]=0.e0; - faccos[1]=0.4461498e-04; - faccos[2]=0.2780891e-05; - faccos[3]=0.4736630e-06; - faccos[4]=-0.4339082e-06; - faccos[5]=0.2617994e-07; - faccos[6]=-0.3393696e-08; - faccos[7]=0.1085983e-06; - faccos[8]=0.9696274e-07; - faccos[9]=0.6254096e-07; - - - /* ECL = OBLIQUITY OF ECLIPTIC AT EPOCH J2000.0 - ECL CHANGES BY -0.01300 DEG/CENTURY. - ECL = 23 DEG + 26 ' + 21.4119 " */ - ecl = PI/180.e0*(23.e0 + (26.e0 + 21.4119e0/6.e1)/6.e1); - cecl = cos(ecl); - secl = sin(ecl); - - /*t= Julian day relative to year 2000 at 12:00:00 */ - t = day-2451540. - 0.5 ; - - /* L = MEAN ANOMALY OF THE MOON */ - arg[6] = fmod( 0.2355548394e+01 + t*( 0.2280271437e+00 + t* 0.1137830e-12 ),DEUXPI); - - /*C L-PRIME = MEAN ANOMALY OF THE SUN (EARTH) */ - arg[5] = fmod( 0.6240035939e+01 + t*( 0.1720197005e-01 - t* 0.2096864e-14 ),DEUXPI); - - /* F = L - OMEGA (SEE ABOVE AND BELOW) */ - ff = fmod( 0.1627901934e+01 + t*( 0.2308957196e+00 - t* 0.4817699e-13 ),DEUXPI); - - /* D = MEAN ELONGATION OF THE MOON FROM THE SUN */ - dd = fmod( 0.5198469514e+01 + t*( 0.2127687104e+00 - t* 0.2504244e-13 ),DEUXPI); - - /* OMEGA = LONGITUDE OF MOON'S ASCENDING NODE FROM MEAN EQUINOX OF DATE */ - arg[0]=0.e0; - arg[1] = fmod( 0.2182438624e+01 - t*( 0.9242175478e-03 - t* 0.2709206e-13 ),DEUXPI); + double arg[10] ; + double t, ff, dd, dpsi, deps; + double ecl, cecl, secl, dnu, srang; + double sra, cra, snu, cnu, sde, cde; + double facsin[10],faccos[10]; + + int i; + + /* DATA FOR NUTATION MODELLING */ + facsin[0]=0.e0; + facsin[1]=-0.8338601e-04; + facsin[2]=-0.6393238e-05; + facsin[3]=-0.1102466e-05; + facsin[4]=0.9996858e-06; + facsin[5]=0.6913443e-06; + facsin[6]=0.3451873e-06; + facsin[7]=-0.2506487e-06; + facsin[8]=-0.1871381e-06; + facsin[9]=-0.1459289e-06; + + faccos[0]=0.e0; + faccos[1]=0.4461498e-04; + faccos[2]=0.2780891e-05; + faccos[3]=0.4736630e-06; + faccos[4]=-0.4339082e-06; + faccos[5]=0.2617994e-07; + faccos[6]=-0.3393696e-08; + faccos[7]=0.1085983e-06; + faccos[8]=0.9696274e-07; + faccos[9]=0.6254096e-07; + + + /* ECL = OBLIQUITY OF ECLIPTIC AT EPOCH J2000.0 + ECL CHANGES BY -0.01300 DEG/CENTURY. + ECL = 23 DEG + 26 ' + 21.4119 " */ + ecl = PI/180.e0*(23.e0 + (26.e0 + 21.4119e0/6.e1)/6.e1); + cecl = cos(ecl); + secl = sin(ecl); + + /*t= Julian day relative to year 2000 at 12:00:00 */ + t = day-2451540. - 0.5 ; + + /* L = MEAN ANOMALY OF THE MOON */ + arg[6] = fmod( 0.2355548394e+01 + t*( 0.2280271437e+00 + t* 0.1137830e-12 ),DEUXPI); + + /*C L-PRIME = MEAN ANOMALY OF THE SUN (EARTH) */ + arg[5] = fmod( 0.6240035939e+01 + t*( 0.1720197005e-01 - t* 0.2096864e-14 ),DEUXPI); + + /* F = L - OMEGA (SEE ABOVE AND BELOW) */ + ff = fmod( 0.1627901934e+01 + t*( 0.2308957196e+00 - t* 0.4817699e-13 ),DEUXPI); + + /* D = MEAN ELONGATION OF THE MOON FROM THE SUN */ + dd = fmod( 0.5198469514e+01 + t*( 0.2127687104e+00 - t* 0.2504244e-13 ),DEUXPI); + + /* OMEGA = LONGITUDE OF MOON'S ASCENDING NODE FROM MEAN EQUINOX OF DATE */ + arg[0]=0.e0; + arg[1] = fmod( 0.2182438624e+01 - t*( 0.9242175478e-03 - t* 0.2709206e-13 ),DEUXPI); arg[3] = 2.e0*(ff + arg[1]); arg[2] = arg[3] - 2.e0*dd ; @@ -219,76 +219,76 @@ int GalileanEphemeris::p2nutt(int newcmb, double greenwich, double day, dpsi = 0.e0; deps = 0.e0; for ( i=1 ; i<=9; i++ ) - { - dpsi = dpsi + facsin[i] * sin(arg[i]); - deps = deps + faccos[i] * cos(arg[i]); + { + dpsi = dpsi + facsin[i] * sin(arg[i]); + deps = deps + faccos[i] * cos(arg[i]); } - /* ROTATION OF -deps AROUND THE X-AXIS */ - cde=cos(deps); - sde=sin(deps); - - /* ROTATION OF DNU = dpsi*SIN(ECLIPT) AROUND THE Y-AXIS */ - dnu = dpsi*secl; - cnu=cos(dnu); - snu=sin(dnu); - - /* SELECT WHICH ROTATION IS WANTED FOR THE Z-AXIS */ - srang=0.e0; - if (newcmb == -1) - { - /* ROTATION OF SRANG = -DMU = -dpsi*COS(ECLIPT) AROUND THE Z-AXIS */ - srang = -dpsi*cecl; - } - else if ( newcmb == 0) - { - srang = 0.e0; - } - else if ( newcmb == 1 ) - { - /* SIDEREAL ANGLE, FROM 'COOT20' WITH NEWCOMB'S FORMULA:*/ - /*srang = fmod(STD20R+(OMT20R+OMQ20R*day)*day,DEUXPI);*/ - } - else if ( newcmb == 2 ) - { - /* SIDEREAL ANGLE, FROM INPUT */ - srang = fmod(greenwich*PI/180.e0,DEUXPI) ; - /*printf("srang dans p2nutt %g",greenwich);*/ - } - else - { - return -1;; - } - - - sra=sin(srang); - cra=cos(srang); - - /* ROTATION MATRIX = RZ(SRANG)*RX(-deps)*RY(DNU) */ - p[0] = 0.e0; - p[1] = cra*cnu - sra*sde*snu ; - p[2] = -sra*cnu - cra*sde*snu ; - p[3] = cde*snu ; - p[4] = sra*cde ; - p[5] = cra*cde ; - p[6] = sde ; - p[7] = -cra*snu - sra*sde*cnu ; - p[8] = sra*snu - cra*sde*cnu ; - p[9] = cde*cnu ; - - pd[0] = 0.e0; - pd[1] = -sra*cnu - cra*sde*snu ; - pd[2] = -cra*cnu + sra*sde*snu ; - pd[3] = 0. ; - pd[4] = cra*cde ; - pd[5] = -sra*cde ; - pd[6] = 0. ; - pd[7] = sra*snu - cra*sde*cnu ; - pd[8] = cra*snu + sra*sde*cnu ; - pd[9] = 0. ; - - return 1; + /* ROTATION OF -deps AROUND THE X-AXIS */ + cde=cos(deps); + sde=sin(deps); + + /* ROTATION OF DNU = dpsi*SIN(ECLIPT) AROUND THE Y-AXIS */ + dnu = dpsi*secl; + cnu=cos(dnu); + snu=sin(dnu); + + /* SELECT WHICH ROTATION IS WANTED FOR THE Z-AXIS */ + srang=0.e0; + if (newcmb == -1) + { + /* ROTATION OF SRANG = -DMU = -dpsi*COS(ECLIPT) AROUND THE Z-AXIS */ + srang = -dpsi*cecl; + } + else if ( newcmb == 0) + { + srang = 0.e0; + } + else if ( newcmb == 1 ) + { + /* SIDEREAL ANGLE, FROM 'COOT20' WITH NEWCOMB'S FORMULA:*/ + /*srang = fmod(STD20R+(OMT20R+OMQ20R*day)*day,DEUXPI);*/ + } + else if ( newcmb == 2 ) + { + /* SIDEREAL ANGLE, FROM INPUT */ + srang = fmod(greenwich*PI/180.e0,DEUXPI) ; + /*printf("srang dans p2nutt %g",greenwich);*/ + } + else + { + return -1;; + } + + + sra=sin(srang); + cra=cos(srang); + + /* ROTATION MATRIX = RZ(SRANG)*RX(-deps)*RY(DNU) */ + p[0] = 0.e0; + p[1] = cra*cnu - sra*sde*snu ; + p[2] = -sra*cnu - cra*sde*snu ; + p[3] = cde*snu ; + p[4] = sra*cde ; + p[5] = cra*cde ; + p[6] = sde ; + p[7] = -cra*snu - sra*sde*cnu ; + p[8] = sra*snu - cra*sde*cnu ; + p[9] = cde*cnu ; + + pd[0] = 0.e0; + pd[1] = -sra*cnu - cra*sde*snu ; + pd[2] = -cra*cnu + sra*sde*snu ; + pd[3] = 0. ; + pd[4] = cra*cde ; + pd[5] = -sra*cde ; + pd[6] = 0. ; + pd[7] = sra*snu - cra*sde*cnu ; + pd[8] = cra*snu + sra*sde*cnu ; + pd[9] = 0. ; + + return 1; } } diff --git a/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.h b/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.h index 1f7f4532f400b448031499c0fabdd2159a31cb04..f88b0c33b60e8828f7c907608771e6d75c95fad7 100644 --- a/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.h +++ b/Utilities/otbossimplugins/ossim/otb/GalileanEphemeris.h @@ -26,49 +26,49 @@ class GeographicEphemeris; class GalileanEphemeris : public Ephemeris { public: - /** - * @brief Constructor - */ - GalileanEphemeris(); + /** + * @brief Constructor + */ + GalileanEphemeris(); - /** - * @brief Destructor - */ - ~GalileanEphemeris(); + /** + * @brief Destructor + */ + ~GalileanEphemeris(); - /** - * @brief Constructor with initialisations - */ - GalileanEphemeris(JSDDateTime date, double pos[3], double vitesse[3]); + /** + * @brief Constructor with initialisations + */ + GalileanEphemeris(JSDDateTime date, double pos[3], double vitesse[3]); - /** - * @brief Copy constructor - */ - GalileanEphemeris(const GalileanEphemeris& rhs); + /** + * @brief Copy constructor + */ + GalileanEphemeris(const GalileanEphemeris& rhs); - GalileanEphemeris(GeographicEphemeris& rhs); - /** - * @brief Affectation operator - */ - GalileanEphemeris& operator=(const GalileanEphemeris& rhs); + GalileanEphemeris(GeographicEphemeris& rhs); + /** + * @brief Affectation operator + */ + GalileanEphemeris& operator=(const GalileanEphemeris& rhs); - /** - * @brief This fonction converts the current ephemeris in the Geographic coordinates syst�m - */ - void ToGeographic(GeographicEphemeris* vGeo); - void ToGeographic(double greenwich,GeographicEphemeris* vGeo); + /** + * @brief This fonction converts the current ephemeris in the Geographic coordinates syst�m + */ + void ToGeographic(GeographicEphemeris* vGeo); + void ToGeographic(double greenwich,GeographicEphemeris* vGeo); - operator GeographicEphemeris(); + operator GeographicEphemeris(); - /** - * @brief This function creates a copy of the current class - */ - virtual Ephemeris* Clone() - { - return new GalileanEphemeris(*this); - }; + /** + * @brief This function creates a copy of the current class + */ + virtual Ephemeris* Clone() + { + return new GalileanEphemeris(*this); + }; protected: - int p2nutt(int newcmb, double greenwich, double day, double p[], double pd[] ); + int p2nutt(int newcmb, double greenwich, double day, double p[], double pd[] ); private: }; } diff --git a/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.cpp b/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.cpp index daebcf4d1ab011b153374d13d1899dcf1ab07c22..d76fd9eabd58a145a7e0d4aae0e0fbb43f509ed4 100644 --- a/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.cpp +++ b/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.cpp @@ -34,11 +34,11 @@ GeodesicCoordinate::GeodesicCoordinate(const GeodesicCoordinate& rhs): Coordinat GeodesicCoordinate& GeodesicCoordinate::operator=(const GeodesicCoordinate& rhs) { - _x = rhs._x; - _y = rhs._x; - _z = rhs._x; + _x = rhs._x; + _y = rhs._x; + _z = rhs._x; - return *this; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.h b/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.h index 9ad58ef111e504eda5df98f696293f63e894b6e0..40b64fe8173245e62a5365b15aa7449dd210f1e7 100644 --- a/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.h +++ b/Utilities/otbossimplugins/ossim/otb/GeodesicCoordinate.h @@ -25,27 +25,27 @@ namespace ossimplugins class GeodesicCoordinate : public Coordinate { public: - /** - * @brief Constructor - */ - GeodesicCoordinate(); - /** - * @brief Destructor - */ - ~GeodesicCoordinate(); - /** - * @brief Cosntructor with initializations - */ - GeodesicCoordinate(double x, double y, double z); - /** - * @brief Copy constructor - */ - GeodesicCoordinate(const GeodesicCoordinate& rhs); + /** + * @brief Constructor + */ + GeodesicCoordinate(); + /** + * @brief Destructor + */ + ~GeodesicCoordinate(); + /** + * @brief Cosntructor with initializations + */ + GeodesicCoordinate(double x, double y, double z); + /** + * @brief Copy constructor + */ + GeodesicCoordinate(const GeodesicCoordinate& rhs); - /** - * @brief Affectation operator - */ - GeodesicCoordinate& operator=(const GeodesicCoordinate& rhs); + /** + * @brief Affectation operator + */ + GeodesicCoordinate& operator=(const GeodesicCoordinate& rhs); protected: private: }; diff --git a/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.cpp b/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.cpp index e7568bb576d0400027aa62540cc2f400b98955a8..7ce121f3fb0998d87d8cec79a72164425a7053f8 100644 --- a/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.cpp +++ b/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.cpp @@ -38,26 +38,26 @@ GeographicEphemeris::GeographicEphemeris(const GeographicEphemeris& rhs) : Ephem GeographicEphemeris& GeographicEphemeris::operator=(const GeographicEphemeris& rhs) { - ((Ephemeris)*this) = ((Ephemeris)rhs); - return *this; + ((Ephemeris)*this) = ((Ephemeris)rhs); + return *this; } void GeographicEphemeris::ToGalilean(GalileanEphemeris* vGal) { - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - GMSTDateTime h; - h.set_origine(GMSTDateTime::AN1950); + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + GMSTDateTime h; + h.set_origine(GMSTDateTime::AN1950); - double s,c; - _date.AsGMSTDateTime(&h) ; + double s,c; + _date.AsGMSTDateTime(&h) ; c = cos (h.get_tms()) ; s = sin (h.get_tms()) ; - vGal->set_date(_date); + vGal->set_date(_date); - double pos[3]; - double vitesse[3]; + double pos[3]; + double vitesse[3]; pos[0] = _position[0] * c - _position[1] * s ; pos[1] = _position[0] * s + _position[1] * c ; @@ -67,19 +67,19 @@ void GeographicEphemeris::ToGalilean(GalileanEphemeris* vGal) vitesse[1] = _vitesse[0] * s + _vitesse[1] * c + OMEGATERRE * (_position[0] * c - _position[1] * s) ; vitesse[2] = _vitesse[2] ; - vGal->set_position(pos); + vGal->set_position(pos); vGal->set_vitesse(vitesse); } GeographicEphemeris::operator GalileanEphemeris() { - GalileanEphemeris rhs; - ToGalilean(&rhs); - return rhs; + GalileanEphemeris rhs; + ToGalilean(&rhs); + return rhs; } GeographicEphemeris::GeographicEphemeris(GalileanEphemeris& rhs) { - rhs.ToGeographic(this); + rhs.ToGeographic(this); } } diff --git a/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.h b/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.h index 9965a2f5f9474ee682f344961bbc3d3d34b4a507..2776e6080b67b8910a89702770a31e57c20089e1 100644 --- a/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.h +++ b/Utilities/otbossimplugins/ossim/otb/GeographicEphemeris.h @@ -26,44 +26,44 @@ class GalileanEphemeris; class GeographicEphemeris : public Ephemeris { public: - /** - * @brief Constructor - */ - GeographicEphemeris(); - /** - * @brief Destructor - */ - virtual ~GeographicEphemeris(); + /** + * @brief Constructor + */ + GeographicEphemeris(); + /** + * @brief Destructor + */ + virtual ~GeographicEphemeris(); - /** - * @brief Constructor with initialisations - */ - GeographicEphemeris(JSDDateTime date, double pos[3], double vitesse[3]); - /** - * @brief Copy constructor - */ - GeographicEphemeris(const GeographicEphemeris& rhs); + /** + * @brief Constructor with initialisations + */ + GeographicEphemeris(JSDDateTime date, double pos[3], double vitesse[3]); + /** + * @brief Copy constructor + */ + GeographicEphemeris(const GeographicEphemeris& rhs); - GeographicEphemeris(GalileanEphemeris& rhs); - /** - * @brief Affectation operator - */ - GeographicEphemeris& operator=(const GeographicEphemeris& rhs); + GeographicEphemeris(GalileanEphemeris& rhs); + /** + * @brief Affectation operator + */ + GeographicEphemeris& operator=(const GeographicEphemeris& rhs); - /** - * @brief This fonction converts the current ephemeris in the Galilean coordinates system - */ - void ToGalilean(GalileanEphemeris* vGal); + /** + * @brief This fonction converts the current ephemeris in the Galilean coordinates system + */ + void ToGalilean(GalileanEphemeris* vGal); - operator GalileanEphemeris(); + operator GalileanEphemeris(); - /** - * @brief This function creates a copy of the current class - */ - virtual Ephemeris* Clone() - { - return new GeographicEphemeris(*this); - }; + /** + * @brief This function creates a copy of the current class + */ + virtual Ephemeris* Clone() + { + return new GeographicEphemeris(*this); + }; protected: private: diff --git a/Utilities/otbossimplugins/ossim/otb/HermiteInterpolator.cpp b/Utilities/otbossimplugins/ossim/otb/HermiteInterpolator.cpp index a713c3d0688e17e2816b78ebf981099ef61171fc..6899b483167c08b145ebca451770c5c573c8a3cc 100644 --- a/Utilities/otbossimplugins/ossim/otb/HermiteInterpolator.cpp +++ b/Utilities/otbossimplugins/ossim/otb/HermiteInterpolator.cpp @@ -18,250 +18,250 @@ namespace ossimplugins HermiteInterpolator::HermiteInterpolator(): - _nbrPoints(0), - _x(NULL), - _y(NULL), - _dy(NULL) + _nbrPoints(0), + _x(NULL), + _y(NULL), + _dy(NULL) { } HermiteInterpolator::HermiteInterpolator(int nbrPoints, double* x, double* y, double* dy): - _nbrPoints(nbrPoints) + _nbrPoints(nbrPoints) { - if(x != NULL) - { - _x = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _x[i] = x[i]; - } - } - else - { - _x = NULL; - } + if(x != NULL) + { + _x = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _x[i] = x[i]; + } + } + else + { + _x = NULL; + } - if(y != NULL) - { - _y = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _y[i] = y[i]; - } - } - else - { - _y = NULL; - } + if(y != NULL) + { + _y = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _y[i] = y[i]; + } + } + else + { + _y = NULL; + } - if(dy != NULL) - { - _dy = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _dy[i] = dy[i]; - } - } - else - { - _dy = NULL; - } + if(dy != NULL) + { + _dy = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _dy[i] = dy[i]; + } + } + else + { + _dy = NULL; + } } HermiteInterpolator::~HermiteInterpolator() { - Clear(); + Clear(); } HermiteInterpolator::HermiteInterpolator(const HermiteInterpolator& rhs): - _nbrPoints(rhs._nbrPoints) + _nbrPoints(rhs._nbrPoints) { - if(rhs._x != NULL) - { - _x = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _x[i] = rhs._x[i]; - } - } - else - { - _x = NULL; - } + if(rhs._x != NULL) + { + _x = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _x[i] = rhs._x[i]; + } + } + else + { + _x = NULL; + } - if(rhs._y != NULL) - { - _y = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _y[i] = rhs._y[i]; - } - } - else - { - _y = NULL; - } + if(rhs._y != NULL) + { + _y = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _y[i] = rhs._y[i]; + } + } + else + { + _y = NULL; + } - if(rhs._dy != NULL) - { - _dy = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _dy[i] = rhs._dy[i]; - } - } - else - { - _dy = NULL; - } + if(rhs._dy != NULL) + { + _dy = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _dy[i] = rhs._dy[i]; + } + } + else + { + _dy = NULL; + } } HermiteInterpolator& HermiteInterpolator::operator =(const HermiteInterpolator& rhs) { - Clear(); - _nbrPoints = rhs._nbrPoints; - if(rhs._x != NULL) - { - _x = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _x[i] = rhs._x[i]; - } - } - else - { - _x = NULL; - } + Clear(); + _nbrPoints = rhs._nbrPoints; + if(rhs._x != NULL) + { + _x = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _x[i] = rhs._x[i]; + } + } + else + { + _x = NULL; + } - if(rhs._y != NULL) - { - _y = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _y[i] = rhs._y[i]; - } - } - else - { - _y = NULL; - } + if(rhs._y != NULL) + { + _y = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _y[i] = rhs._y[i]; + } + } + else + { + _y = NULL; + } - if(rhs._dy != NULL) - { - _dy = new double[_nbrPoints]; - for (int i=0;i<_nbrPoints;i++) - { - _dy[i] = rhs._dy[i]; - } - } - else - { - _dy = NULL; - } + if(rhs._dy != NULL) + { + _dy = new double[_nbrPoints]; + for (int i=0;i<_nbrPoints;i++) + { + _dy[i] = rhs._dy[i]; + } + } + else + { + _dy = NULL; + } - return *this; + return *this; } int HermiteInterpolator::Interpolate(const double x, double& y, double& dy) { - int k1, k2 ; - double f, d, p, q, r, s, t, p2 ; - /* - * Il n'y a pas assez de points pour faire l'interpolation - */ - if (_nbrPoints < 2) - return -1; - else - { - for (int i = 1 ; i < _nbrPoints ; i++) - { - /** - * @todo Verifier que l'interpolateur n'ai pas besoin ques les abscisses soitent strictement croissantes - */ + int k1, k2 ; + double f, d, p, q, r, s, t, p2 ; + /* + * Il n'y a pas assez de points pour faire l'interpolation + */ + if (_nbrPoints < 2) + return -1; + else + { + for (int i = 1 ; i < _nbrPoints ; i++) + { + /** + * @todo Verifier que l'interpolateur n'ai pas besoin ques les abscisses soitent strictement croissantes + */ - /* - * Les abscisses ne sont pas croissantes - */ - if (_x[i] <= _x[i-1]) - return -2; - } + /* + * Les abscisses ne sont pas croissantes + */ + if (_x[i] <= _x[i-1]) + return -2; + } - y = 0.0 ; - dy = 0.0 ; - for (int i = 0 ; i < _nbrPoints ; i++) - { - p = 1.0 ; - q = 0.0 ; - s = 0.0 ; - for (int j = 0 ; j < i ; j++) - { - r = _x[i] - _x[j] ; - p = p * ((x - _x[j]) / r) ; - q = q + 1.0 / r ; - k1 = (i<j) ? i : j ; - k2 = (i<j) ? j : i ; - t = 1.0 ; - for (int k = 0 ; k < k1 ; k++) - t = t * (x - _x[k]) / (_x[i] - _x[k]) ; - for (int k = k1+1 ; k < k2 ; k++) - t = t * (x - _x[k]) / (_x[i] - _x[k]) ; - for (int k = k2+1 ; k < _nbrPoints ; k++) - t = t * (x-_x[k]) / (_x[i]-_x[k]) ; - s = s + t / r ; - } + y = 0.0 ; + dy = 0.0 ; + for (int i = 0 ; i < _nbrPoints ; i++) + { + p = 1.0 ; + q = 0.0 ; + s = 0.0 ; + for (int j = 0 ; j < i ; j++) + { + r = _x[i] - _x[j] ; + p = p * ((x - _x[j]) / r) ; + q = q + 1.0 / r ; + k1 = (i<j) ? i : j ; + k2 = (i<j) ? j : i ; + t = 1.0 ; + for (int k = 0 ; k < k1 ; k++) + t = t * (x - _x[k]) / (_x[i] - _x[k]) ; + for (int k = k1+1 ; k < k2 ; k++) + t = t * (x - _x[k]) / (_x[i] - _x[k]) ; + for (int k = k2+1 ; k < _nbrPoints ; k++) + t = t * (x-_x[k]) / (_x[i]-_x[k]) ; + s = s + t / r ; + } - for (int j = i+1 ; j < _nbrPoints ; j++) - { - r = _x[i] - _x[j] ; - p = p * ((x - _x[j]) / r) ; - q = q + 1.0 / r ; - k1 = (i < j) ? i : j ; - k2 = (i < j) ? j : i ; - t = 1.0 ; - for (int k = 0 ; k < k1 ; k++) - t = t * (x - _x[k]) / (_x[i] - _x[k]) ; - for (int k = k1+1 ; k < k2 ; k++) - t = t * (x - _x[k]) / (_x[i] - _x[k]) ; - for (int k = k2+1 ; k < _nbrPoints ; k++) - t = t * (x - _x[k]) / (_x[i] - _x[k]) ; - s = s + t / r ; - } + for (int j = i+1 ; j < _nbrPoints ; j++) + { + r = _x[i] - _x[j] ; + p = p * ((x - _x[j]) / r) ; + q = q + 1.0 / r ; + k1 = (i < j) ? i : j ; + k2 = (i < j) ? j : i ; + t = 1.0 ; + for (int k = 0 ; k < k1 ; k++) + t = t * (x - _x[k]) / (_x[i] - _x[k]) ; + for (int k = k1+1 ; k < k2 ; k++) + t = t * (x - _x[k]) / (_x[i] - _x[k]) ; + for (int k = k2+1 ; k < _nbrPoints ; k++) + t = t * (x - _x[k]) / (_x[i] - _x[k]) ; + s = s + t / r ; + } - r = x - _x[i] ; - p2 = p * p ; - f = p2 * (1.0 - 2. * q * r) ; - d = p2 * r ; - y = y + f * _y[i] + d * _dy[i] ; - f = 2.0 * p * (s * (1.0 - 2.0 * q * r) - p * q) ; - d = p * (p + 2.0 * r * s) ; - dy = dy + f * _y[i] + d * _dy[i] ; - } + r = x - _x[i] ; + p2 = p * p ; + f = p2 * (1.0 - 2. * q * r) ; + d = p2 * r ; + y = y + f * _y[i] + d * _dy[i] ; + f = 2.0 * p * (s * (1.0 - 2.0 * q * r) - p * q) ; + d = p * (p + 2.0 * r * s) ; + dy = dy + f * _y[i] + d * _dy[i] ; + } - } - return 0; + } + return 0; } void HermiteInterpolator::Clear() { - if (_x != NULL) - { - delete[] _x; - _x = NULL; - } + if (_x != NULL) + { + delete[] _x; + _x = NULL; + } - if (_y != NULL) - { - delete[] _y; - _y = NULL; - } + if (_y != NULL) + { + delete[] _y; + _y = NULL; + } - if (_dy != NULL) - { - delete[] _dy; - _dy = NULL; - } + if (_dy != NULL) + { + delete[] _dy; + _dy = NULL; + } - _nbrPoints = 0; + _nbrPoints = 0; } } diff --git a/Utilities/otbossimplugins/ossim/otb/JSDDateTime.cpp b/Utilities/otbossimplugins/ossim/otb/JSDDateTime.cpp index 3c259b09ada4b2221cc1a0bfec6dec75a5afc3ec..b73f97576c247a4a9f717e82879c68b87af503f6 100644 --- a/Utilities/otbossimplugins/ossim/otb/JSDDateTime.cpp +++ b/Utilities/otbossimplugins/ossim/otb/JSDDateTime.cpp @@ -26,9 +26,9 @@ namespace ossimplugins JSDDateTime::JSDDateTime(): - _day0hTU(0), - _second(0.0), - _decimal(0.0) + _day0hTU(0), + _second(0.0), + _decimal(0.0) { } @@ -37,27 +37,27 @@ JSDDateTime::~JSDDateTime() } JSDDateTime::JSDDateTime(const JSDDateTime& rhs): - _day0hTU(rhs._day0hTU), - _second(rhs._second), - _decimal(rhs._decimal) + _day0hTU(rhs._day0hTU), + _second(rhs._second), + _decimal(rhs._decimal) { } JSDDateTime::JSDDateTime(JulianDate day0hTU, double second, double decimal): - _day0hTU(day0hTU), - _second(second), - _decimal(decimal) + _day0hTU(day0hTU), + _second(second), + _decimal(decimal) { } JSDDateTime::JSDDateTime(CivilDateTime& rhs) { - rhs.AsJSDDateTime(this); + rhs.AsJSDDateTime(this); } JSDDateTime::JSDDateTime(JulianDate& rhs) { - rhs.AsJSDDateTime(this); + rhs.AsJSDDateTime(this); } @@ -87,150 +87,150 @@ JSDDateTime::JSDDateTime(MJDDateTime& rhs) JSDDateTime& JSDDateTime::operator=(const JSDDateTime& rhs) { - _day0hTU = rhs._day0hTU; - _second = rhs._second; - _decimal = rhs._decimal; + _day0hTU = rhs._day0hTU; + _second = rhs._second; + _decimal = rhs._decimal; - return *this; + return *this; } int JSDDateTime::AsJulianDate(JulianDate* julian) { - double jourJulien = _day0hTU.get_julianDate() + (_second + _decimal) / CivilDateTime::JOURCIVIL_LENGTH ; - julian->set_julianDate(jourJulien); + double jourJulien = _day0hTU.get_julianDate() + (_second + _decimal) / CivilDateTime::JOURCIVIL_LENGTH ; + julian->set_julianDate(jourJulien); - return 0 ; + return 0 ; } int JSDDateTime::AsGMSTDateTime(GMSTDateTime* GMST) { - const double DEUXPI = 6.28318530717958647693 ; - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + const double DEUXPI = 6.28318530717958647693 ; + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - int etat ; - JulianDate jourJulien; - double t = 0.0; + int etat ; + JulianDate jourJulien; + double t = 0.0; double tsm0hTU = 0.0; double tsm = 0.0; - JSDDateTime date0hTU ; - - - date0hTU = *this ; - date0hTU.set_second(0); - date0hTU.set_decimal(0.0); - - etat = date0hTU.AsJulianDate(&jourJulien ) ; - - if (etat == 0) - { - if (GMST->get_origine() == GMSTDateTime::AN1900) - { - t = (jourJulien.get_julianDate() - 2415020.0) / 36525.0 ; - tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; - tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; - } - else if (GMST->get_origine() == GMSTDateTime::AN1950) - { - t = jourJulien.get_julianDate() - 2433281.5 ; - tsm0hTU = 1.72944494 + t * 6.3003880987 ; - } - else if (GMST->get_origine() == GMSTDateTime::AN2000) - { - t = (jourJulien.get_julianDate() - 2451545.0) / 36525.0 ; - tsm0hTU = 24110.54841 + t * (8640184.812866 + JSDDateTime date0hTU ; + + + date0hTU = *this ; + date0hTU.set_second(0); + date0hTU.set_decimal(0.0); + + etat = date0hTU.AsJulianDate(&jourJulien ) ; + + if (etat == 0) + { + if (GMST->get_origine() == GMSTDateTime::AN1900) + { + t = (jourJulien.get_julianDate() - 2415020.0) / 36525.0 ; + tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; + tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; + } + else if (GMST->get_origine() == GMSTDateTime::AN1950) + { + t = jourJulien.get_julianDate() - 2433281.5 ; + tsm0hTU = 1.72944494 + t * 6.3003880987 ; + } + else if (GMST->get_origine() == GMSTDateTime::AN2000) + { + t = (jourJulien.get_julianDate() - 2451545.0) / 36525.0 ; + tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ; - tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; - } - t = tsm0hTU + (_second + _decimal) * OMEGATERRE ; - tsm = fmod (t,DEUXPI) ; - if (tsm < 0.0) - { - tsm = tsm + DEUXPI ; - } - - GMST->set_tms(tsm); - } - - return etat ; + tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; + } + t = tsm0hTU + (_second + _decimal) * OMEGATERRE ; + tsm = fmod (t,DEUXPI) ; + if (tsm < 0.0) + { + tsm = tsm + DEUXPI ; + } + + GMST->set_tms(tsm); + } + + return etat ; } void JSDDateTime::NormDate() { - const double epsilon = 1.0e-12 ; - - int k, iu, iv, iw ; - double u, v, w, ru, rv, rw ; - - - w = _day0hTU.get_julianDate() - 0.5 ; - if (fabs (w - fnint (w)) < epsilon) - { - iw = (int)inint(w) ; - rw = 0.0 ; - } - else - { - iw = (int)w ; - rw = w - (double)iw ; - if ((iw < 0) && (rw != 0.0)) - { - iw = iw - 1 ; - rw = rw + 1.0 ; - } - } - - v = _second + rw * CivilDateTime::JOURCIVIL_LENGTH ; - if (fabs(v - fnint (v)) < epsilon) - { - iv = (int)inint (v) ; - rv = 0.0 ; - } - else - { - iv = (int)v ; - rv = v - (double)iv ; - if ((iv < 0) && (rv != 0.0)) - { - iv = iv - 1 ; - rv = rv + 1.0 ; - } - } - - u = _decimal + rv ; - iu = (int)u ; - ru = u - (double)iu ; - if ((iu < 0) && (ru != 0.0)) - { - iu = iu - 1 ; - ru = ru + 1.0 ; - } - - iv = iv + iu ; - k = iv / ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ; - iw = iw + k ; - iv = iv - k * ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ; - if (iv < 0) - { - iw = iw - 1 ; - iv = iv + (int)inint(CivilDateTime::JOURCIVIL_LENGTH) ; - } - - _decimal = ru ; - _second = (double)iv ; - _day0hTU = (double)iw + 0.5 ; + const double epsilon = 1.0e-12 ; + + int k, iu, iv, iw ; + double u, v, w, ru, rv, rw ; + + + w = _day0hTU.get_julianDate() - 0.5 ; + if (fabs (w - fnint (w)) < epsilon) + { + iw = (int)inint(w) ; + rw = 0.0 ; + } + else + { + iw = (int)w ; + rw = w - (double)iw ; + if ((iw < 0) && (rw != 0.0)) + { + iw = iw - 1 ; + rw = rw + 1.0 ; + } + } + + v = _second + rw * CivilDateTime::JOURCIVIL_LENGTH ; + if (fabs(v - fnint (v)) < epsilon) + { + iv = (int)inint (v) ; + rv = 0.0 ; + } + else + { + iv = (int)v ; + rv = v - (double)iv ; + if ((iv < 0) && (rv != 0.0)) + { + iv = iv - 1 ; + rv = rv + 1.0 ; + } + } + + u = _decimal + rv ; + iu = (int)u ; + ru = u - (double)iu ; + if ((iu < 0) && (ru != 0.0)) + { + iu = iu - 1 ; + ru = ru + 1.0 ; + } + + iv = iv + iu ; + k = iv / ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ; + iw = iw + k ; + iv = iv - k * ((int)inint(CivilDateTime::JOURCIVIL_LENGTH)) ; + if (iv < 0) + { + iw = iw - 1 ; + iv = iv + (int)inint(CivilDateTime::JOURCIVIL_LENGTH) ; + } + + _decimal = ru ; + _second = (double)iv ; + _day0hTU = (double)iw + 0.5 ; } JSDDateTime::operator JulianDate() { - JulianDate date; - this->AsJulianDate(&date); - return date; + JulianDate date; + this->AsJulianDate(&date); + return date; } JSDDateTime::operator GMSTDateTime() { - GMSTDateTime date; - this->AsGMSTDateTime(&date); - return date; + GMSTDateTime date; + this->AsGMSTDateTime(&date); + return date; } } diff --git a/Utilities/otbossimplugins/ossim/otb/JulianDate.cpp b/Utilities/otbossimplugins/ossim/otb/JulianDate.cpp index f38f69ad5d578ca843cf7772557b0691c9bfbb41..edd3f095fed3617083028ab889de69c002676e1d 100644 --- a/Utilities/otbossimplugins/ossim/otb/JulianDate.cpp +++ b/Utilities/otbossimplugins/ossim/otb/JulianDate.cpp @@ -25,23 +25,23 @@ namespace ossimplugins JulianDate::JulianDate(): - _julianDate(0.0) + _julianDate(0.0) { } JulianDate::JulianDate(CivilDateTime& rhs) { - rhs.AsJulianDate(this); + rhs.AsJulianDate(this); } JulianDate::JulianDate(double julianDate): - _julianDate(julianDate) + _julianDate(julianDate) { } JulianDate::JulianDate(JSDDateTime& rhs) { - rhs.AsJulianDate(this); + rhs.AsJulianDate(this); } JulianDate::~JulianDate() @@ -49,82 +49,82 @@ JulianDate::~JulianDate() } JulianDate::JulianDate(const JulianDate& rhs): - _julianDate(rhs._julianDate) + _julianDate(rhs._julianDate) { } JulianDate& JulianDate::operator=(const JulianDate& rhs) { - _julianDate = rhs._julianDate; - return *this; + _julianDate = rhs._julianDate; + return *this; } JulianDate& JulianDate::operator+(const JulianDate& rhs) { - _julianDate += rhs._julianDate; - return *this; + _julianDate += rhs._julianDate; + return *this; } int JulianDate::AsJSDDateTime(JSDDateTime* JSDdate) { - int k ; - double r ; + int k ; + double r ; - k = (int)(_julianDate - 0.5) ; - double jJul0hTU = (double)k + 0.5; + k = (int)(_julianDate - 0.5) ; + double jJul0hTU = (double)k + 0.5; - JSDdate->set_day0hTU (jJul0hTU); - r = (_julianDate - jJul0hTU) * CivilDateTime::JOURCIVIL_LENGTH ; - JSDdate->set_second(floor (r)); - JSDdate->set_decimal(r - JSDdate->get_second()) ; + JSDdate->set_day0hTU (jJul0hTU); + r = (_julianDate - jJul0hTU) * CivilDateTime::JOURCIVIL_LENGTH ; + JSDdate->set_second(floor (r)); + JSDdate->set_decimal(r - JSDdate->get_second()) ; - return 0 ; + return 0 ; } int JulianDate::AsGMSTDateTime(GMSTDateTime* GMST) { - const double DEUXPI = 6.28318530717958647693 ; - const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; + const double DEUXPI = 6.28318530717958647693 ; + const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ; - int etat=0 , n ; - double j0hTU = 0.0; + int etat=0 , n ; + double j0hTU = 0.0; double tsm0hTU = 0.0; double t = 0.0; double d = 0.0; double tsm = 0.0; - n = (int)(_julianDate - 0.5) ; - j0hTU = (double)n + 0.5 ; - d = _julianDate - j0hTU ; - - if (etat == 0) - { - if (GMST->get_origine() == GMSTDateTime::AN1900) - { - t = (j0hTU - 2415020.0) / 36525.0 ; - tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; - tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; - } - else if (GMST->get_origine() == GMSTDateTime::AN1950) - { - t = j0hTU - 2433281.5 ; - tsm0hTU = 1.72944494 + t * 6.3003880987 ; - } - else if (GMST->get_origine() == GMSTDateTime::AN2000) - { - t = (j0hTU - 2451545.0) / 36525.0 ; - tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ; - tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; - } - t = tsm0hTU + d * CivilDateTime::JOURCIVIL_LENGTH * OMEGATERRE ; - tsm = fmod (t,DEUXPI) ; - if (tsm < 0.0) - { - tsm = tsm + DEUXPI ; - } - - GMST->set_tms(tsm); + n = (int)(_julianDate - 0.5) ; + j0hTU = (double)n + 0.5 ; + d = _julianDate - j0hTU ; + + if (etat == 0) + { + if (GMST->get_origine() == GMSTDateTime::AN1900) + { + t = (j0hTU - 2415020.0) / 36525.0 ; + tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ; + tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; + } + else if (GMST->get_origine() == GMSTDateTime::AN1950) + { + t = j0hTU - 2433281.5 ; + tsm0hTU = 1.72944494 + t * 6.3003880987 ; + } + else if (GMST->get_origine() == GMSTDateTime::AN2000) + { + t = (j0hTU - 2451545.0) / 36525.0 ; + tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ; + tsm0hTU = tsm0hTU * DEUXPI / CivilDateTime::JOURCIVIL_LENGTH ; + } + t = tsm0hTU + d * CivilDateTime::JOURCIVIL_LENGTH * OMEGATERRE ; + tsm = fmod (t,DEUXPI) ; + if (tsm < 0.0) + { + tsm = tsm + DEUXPI ; + } + + GMST->set_tms(tsm); } return etat ; @@ -132,15 +132,15 @@ int JulianDate::AsGMSTDateTime(GMSTDateTime* GMST) JulianDate::operator JSDDateTime() { - JSDDateTime date; - AsJSDDateTime(&date); - return date; + JSDDateTime date; + AsJSDDateTime(&date); + return date; } JulianDate::operator GMSTDateTime() { - GMSTDateTime date; - AsGMSTDateTime(&date); - return date; + GMSTDateTime date; + AsGMSTDateTime(&date); + return date; } } diff --git a/Utilities/otbossimplugins/ossim/otb/JulianDate.h b/Utilities/otbossimplugins/ossim/otb/JulianDate.h index 3b6960e76b850d5e773b3cd1f761e5b17484195c..bcf07dd780cd200dce96168df79abf03a3d28a5f 100644 --- a/Utilities/otbossimplugins/ossim/otb/JulianDate.h +++ b/Utilities/otbossimplugins/ossim/otb/JulianDate.h @@ -25,72 +25,72 @@ class JSDDateTime; class JulianDate { public: - /** - * @brief constructor - */ - JulianDate(); - /** - * @brief Destructor - */ - ~JulianDate(); - /** - * @brief Copy constructor - */ - JulianDate(const JulianDate& rhs); - - /** - * @brief Constructor with date initialisation using a CivilDateTime - */ - JulianDate(CivilDateTime& rhs); - - /** - * @brief Constructor with date initialisation using a JSDDateTime - */ - JulianDate(JSDDateTime& rhs); - /** - * @brief Constructor with date initialisation - */ - JulianDate(double julianDate); - /** - * @brief Affectation operator - */ - JulianDate& operator=(const JulianDate& rhs); - /** - * @brief Summation operator - */ - JulianDate& operator+(const JulianDate& rhs); - - void set_julianDate(double julianDate) - { - _julianDate = julianDate; - } - - double get_julianDate() const - { - return _julianDate; - } - - /** - * @brief This function converts the current JulianDate in JSDDateTime - * @return 0 if no error or an int greater than 0 indicating the error - * @param JSDdate [out] The classe that receives the result of the conversion of the current JulianDate in JSDDateTime - */ - int AsJSDDateTime(JSDDateTime* JSDdate); - - /** - * @brief This function converts the current JulianDate into GMSTDateTime - * @return 0 if no error or an int greater than 0 indicating the error - * @param GMSTDateTime [out] The class that receives the result of the conversion of the current JulianDate into GMSTDateTime - */ - int AsGMSTDateTime(GMSTDateTime* GMST); - - operator JSDDateTime() ; - operator GMSTDateTime() ; + /** + * @brief constructor + */ + JulianDate(); + /** + * @brief Destructor + */ + ~JulianDate(); + /** + * @brief Copy constructor + */ + JulianDate(const JulianDate& rhs); + + /** + * @brief Constructor with date initialisation using a CivilDateTime + */ + JulianDate(CivilDateTime& rhs); + + /** + * @brief Constructor with date initialisation using a JSDDateTime + */ + JulianDate(JSDDateTime& rhs); + /** + * @brief Constructor with date initialisation + */ + JulianDate(double julianDate); + /** + * @brief Affectation operator + */ + JulianDate& operator=(const JulianDate& rhs); + /** + * @brief Summation operator + */ + JulianDate& operator+(const JulianDate& rhs); + + void set_julianDate(double julianDate) + { + _julianDate = julianDate; + } + + double get_julianDate() const + { + return _julianDate; + } + + /** + * @brief This function converts the current JulianDate in JSDDateTime + * @return 0 if no error or an int greater than 0 indicating the error + * @param JSDdate [out] The classe that receives the result of the conversion of the current JulianDate in JSDDateTime + */ + int AsJSDDateTime(JSDDateTime* JSDdate); + + /** + * @brief This function converts the current JulianDate into GMSTDateTime + * @return 0 if no error or an int greater than 0 indicating the error + * @param GMSTDateTime [out] The class that receives the result of the conversion of the current JulianDate into GMSTDateTime + */ + int AsGMSTDateTime(GMSTDateTime* GMST); + + operator JSDDateTime() ; + operator GMSTDateTime() ; protected: - double _julianDate; + double _julianDate; private: }; diff --git a/Utilities/otbossimplugins/ossim/otb/MJDDateTime.cpp b/Utilities/otbossimplugins/ossim/otb/MJDDateTime.cpp index 5390f93e89fe2a26a21992c8e2e3755702ff679f..f762e8a5253aa030bf26663ac09053a340ec0d16 100644 --- a/Utilities/otbossimplugins/ossim/otb/MJDDateTime.cpp +++ b/Utilities/otbossimplugins/ossim/otb/MJDDateTime.cpp @@ -16,9 +16,9 @@ namespace ossimplugins MJDDateTime::MJDDateTime(): - _day(0), - _second(0), - _microsecond(0) + _day(0), + _second(0), + _microsecond(0) { } @@ -27,25 +27,25 @@ MJDDateTime::~MJDDateTime() } MJDDateTime::MJDDateTime(const MJDDateTime& rhs): - _day(rhs._day), - _second(rhs._second), - _microsecond(rhs._microsecond) + _day(rhs._day), + _second(rhs._second), + _microsecond(rhs._microsecond) { } MJDDateTime::MJDDateTime(long day, unsigned long second, unsigned long microsecond): - _day(day), - _second(second), - _microsecond(microsecond) + _day(day), + _second(second), + _microsecond(microsecond) { } MJDDateTime& MJDDateTime::operator=(const MJDDateTime& rhs) { - _day = rhs._day; - _second = rhs._second; - _microsecond = rhs._microsecond; + _day = rhs._day; + _second = rhs._second; + _microsecond = rhs._microsecond; - return *this; + return *this; } } diff --git a/Utilities/otbossimplugins/ossim/otb/MJDDateTime.h b/Utilities/otbossimplugins/ossim/otb/MJDDateTime.h index 4dbf18b20974a08dc2d3012b3e0e3c1b4044965f..3e357eab00e512138dcef092471a6d06e711471f 100644 --- a/Utilities/otbossimplugins/ossim/otb/MJDDateTime.h +++ b/Utilities/otbossimplugins/ossim/otb/MJDDateTime.h @@ -23,63 +23,63 @@ class CivilDateTime; class MJDDateTime { public: - /** - * @brief constructor - */ - MJDDateTime(); - /** - * @brief Destructor - */ - ~MJDDateTime(); - /** - * @brief Copy constructor - */ - MJDDateTime(const MJDDateTime& rhs); - - /** - * @brief Constructor with date initialisation - */ - MJDDateTime(long day, unsigned long second, unsigned long microsecond); - - /** - * @brief Affectation operator - */ - MJDDateTime& operator=(const MJDDateTime& rhs); - - long get_day() - { - return _day; - }; - - unsigned long get_second() - { - return _second; - }; - - unsigned long get_microsecond() - { - return _microsecond; - }; - - void set_day(long day) - { - _day = day; - }; - - void set_second(unsigned long second) - { - _second = second; - }; - - void set_microsecond(unsigned long microsecond) - { - _microsecond = microsecond; - }; + /** + * @brief constructor + */ + MJDDateTime(); + /** + * @brief Destructor + */ + ~MJDDateTime(); + /** + * @brief Copy constructor + */ + MJDDateTime(const MJDDateTime& rhs); + + /** + * @brief Constructor with date initialisation + */ + MJDDateTime(long day, unsigned long second, unsigned long microsecond); + + /** + * @brief Affectation operator + */ + MJDDateTime& operator=(const MJDDateTime& rhs); + + long get_day() + { + return _day; + }; + + unsigned long get_second() + { + return _second; + }; + + unsigned long get_microsecond() + { + return _microsecond; + }; + + void set_day(long day) + { + _day = day; + }; + + void set_second(unsigned long second) + { + _second = second; + }; + + void set_microsecond(unsigned long microsecond) + { + _microsecond = microsecond; + }; protected: - long _day; - unsigned long _second; - unsigned long _microsecond; + long _day; + unsigned long _second; + unsigned long _microsecond; private: diff --git a/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.cpp b/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.cpp index 11ff0e8d9d3dad6b3d6d538e7f16aedfd3f0aa24..74d944c4a3f6389fd8b9aa32876015bec0ec7ee6 100644 --- a/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.cpp +++ b/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.cpp @@ -36,72 +36,72 @@ RectangularCoordinate::RectangularCoordinate(const RectangularCoordinate& rhs): RectangularCoordinate& RectangularCoordinate::operator=(const RectangularCoordinate& rhs) { - _x = rhs._x; - _y = rhs._x; - _z = rhs._x; + _x = rhs._x; + _y = rhs._x; + _z = rhs._x; - return *this; + return *this; } void RectangularCoordinate::AsGeodesicCoordinates(double demiGdAxe, double demiPtAxe, GeodesicCoordinate* geod) { - const double PI = 3.14159265358979323846 ; - const int itmax = 40 ; - const double epsilon = 1.0e-6 ; - - int fin , iter ; - double u, a2_b2, d, e, f, df, c, s, p, q ; - - double coordCart[3]; - double coordGeod[3]; - - coordCart[0] = _x; - coordCart[1] = _y; - coordCart[2] = _z; - - u = sqrt (coordCart[0] * coordCart[0] + coordCart[1] * coordCart[1]) ; - if (u < epsilon) - { - coordGeod[0] = 0.0 ; - if (coordCart[2] >= 0.0) - coordGeod[1] = PI / 2.0 ; - else - coordGeod[1] = - PI / 2.0 ; - coordGeod[2] = fabs (coordCart[2]) - demiPtAxe ; - } - else - { - coordGeod[0] = atan2 (coordCart[1] , coordCart[0]) ; - a2_b2 = demiGdAxe * demiGdAxe - demiPtAxe * demiPtAxe ; - e = atan (coordCart[2] / u) ; - fin = 0 ; - iter = 0 ; - while (fin == 0) - { - iter++ ; - d = e ; - c = cos (e) ; - s = sin (e) ; - p = demiGdAxe * u ; - q = demiPtAxe * coordCart[2] ; - f = p * s - q * c - a2_b2 * s * c ; - df = p * c + q * s - a2_b2 * (c * c - s * s) ; - e = e - f / df ; - d = fabs (e - d) ; - if ((d < epsilon) || (iter >= itmax)) - fin = 1 ; - } - coordGeod[1] = atan (tan (e) * demiGdAxe / demiPtAxe) ; - - p = cos(coordGeod[1]) ; - - if (fabs(coordGeod[1]) <= (PI * 0.5)) - coordGeod[2] = (u - demiGdAxe * cos(e)) / cos(coordGeod[1]) ; - else - coordGeod[2] = (coordCart[2] - demiPtAxe * sin(e)) / sin(coordGeod[1]) ; - - geod->set_coordinates(coordGeod[0],coordGeod[1], coordGeod[2]); - } - //return 0 ; + const double PI = 3.14159265358979323846 ; + const int itmax = 40 ; + const double epsilon = 1.0e-6 ; + + int fin , iter ; + double u, a2_b2, d, e, f, df, c, s, p, q ; + + double coordCart[3]; + double coordGeod[3]; + + coordCart[0] = _x; + coordCart[1] = _y; + coordCart[2] = _z; + + u = sqrt (coordCart[0] * coordCart[0] + coordCart[1] * coordCart[1]) ; + if (u < epsilon) + { + coordGeod[0] = 0.0 ; + if (coordCart[2] >= 0.0) + coordGeod[1] = PI / 2.0 ; + else + coordGeod[1] = - PI / 2.0 ; + coordGeod[2] = fabs (coordCart[2]) - demiPtAxe ; + } + else + { + coordGeod[0] = atan2 (coordCart[1] , coordCart[0]) ; + a2_b2 = demiGdAxe * demiGdAxe - demiPtAxe * demiPtAxe ; + e = atan (coordCart[2] / u) ; + fin = 0 ; + iter = 0 ; + while (fin == 0) + { + iter++ ; + d = e ; + c = cos (e) ; + s = sin (e) ; + p = demiGdAxe * u ; + q = demiPtAxe * coordCart[2] ; + f = p * s - q * c - a2_b2 * s * c ; + df = p * c + q * s - a2_b2 * (c * c - s * s) ; + e = e - f / df ; + d = fabs (e - d) ; + if ((d < epsilon) || (iter >= itmax)) + fin = 1 ; + } + coordGeod[1] = atan (tan (e) * demiGdAxe / demiPtAxe) ; + + p = cos(coordGeod[1]) ; + + if (fabs(coordGeod[1]) <= (PI * 0.5)) + coordGeod[2] = (u - demiGdAxe * cos(e)) / cos(coordGeod[1]) ; + else + coordGeod[2] = (coordCart[2] - demiPtAxe * sin(e)) / sin(coordGeod[1]) ; + + geod->set_coordinates(coordGeod[0],coordGeod[1], coordGeod[2]); + } + //return 0 ; } } diff --git a/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.h b/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.h index b14fb3372dd67142bf2d77ad9edda84ea46e94f2..4b7c2162b908027971495df1f4e764ae593f5b48 100644 --- a/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.h +++ b/Utilities/otbossimplugins/ossim/otb/RectangularCoordinate.h @@ -26,29 +26,29 @@ class GeodesicCoordinate; class RectangularCoordinate : public Coordinate { public: - /** - * @brief Constructor - */ - RectangularCoordinate(); - /** - * @brief Destructor - */ - ~RectangularCoordinate(); - /** - * @brief Cosntructor with initializations - */ - RectangularCoordinate(double x, double y, double z); - /** - * @brief Copy constructor - */ - RectangularCoordinate(const RectangularCoordinate& rhs); - - /** - * @brief Affectation operator - */ - RectangularCoordinate& operator=(const RectangularCoordinate& rhs); - - void AsGeodesicCoordinates(double demiGdAxe, double demiPtAxe, GeodesicCoordinate* geod); + /** + * @brief Constructor + */ + RectangularCoordinate(); + /** + * @brief Destructor + */ + ~RectangularCoordinate(); + /** + * @brief Cosntructor with initializations + */ + RectangularCoordinate(double x, double y, double z); + /** + * @brief Copy constructor + */ + RectangularCoordinate(const RectangularCoordinate& rhs); + + /** + * @brief Affectation operator + */ + RectangularCoordinate& operator=(const RectangularCoordinate& rhs); + + void AsGeodesicCoordinates(double demiGdAxe, double demiPtAxe, GeodesicCoordinate* geod); protected: private: }; diff --git a/Utilities/otbossimplugins/ossim/otb/SarSensor.cpp b/Utilities/otbossimplugins/ossim/otb/SarSensor.cpp index dfc90523233c4a620563d39226d9430bce8d493b..8aebed47065d4060e4cae9b246597a2483deb2f7 100644 --- a/Utilities/otbossimplugins/ossim/otb/SarSensor.cpp +++ b/Utilities/otbossimplugins/ossim/otb/SarSensor.cpp @@ -35,33 +35,33 @@ SarSensor::~SarSensor() int SarSensor::ImageToWorld(double distance, JSDDateTime time, double height, double& lon, double& lat) { - const double DEUXPI = 6.28318530717958647693 ; + const double DEUXPI = 6.28318530717958647693 ; - double semiMajorAxis = _params->get_semiMajorAxis() ; // default : WGS84 - double semiMinorAxis = _params->get_semiMinorAxis() ; // default : WGS84 + double semiMajorAxis = _params->get_semiMajorAxis() ; // default : WGS84 + double semiMinorAxis = _params->get_semiMinorAxis() ; // default : WGS84 - double lambda = _params->get_rwl(); - int sensVisee ; - if (_params->get_sightDirection() == SensorParams::Right) sensVisee = 1 ; - else sensVisee = -1 ; + double lambda = _params->get_rwl(); + int sensVisee ; + if (_params->get_sightDirection() == SensorParams::Right) sensVisee = 1 ; + else sensVisee = -1 ; - Ephemeris* satPosition = _position->Interpolate(time); + Ephemeris* satPosition = _position->Interpolate(time); - GeographicEphemeris *geoEph = (GeographicEphemeris*)satPosition; + GeographicEphemeris *geoEph = (GeographicEphemeris*)satPosition; - RectangularCoordinate cart; + RectangularCoordinate cart; - // note : the Doppler frequency is set to zero - int etatLoc = localisationSAR(*geoEph, lambda, distance, 0.0, sensVisee, semiMajorAxis , semiMinorAxis , height, &cart); + // note : the Doppler frequency is set to zero + int etatLoc = localisationSAR(*geoEph, lambda, distance, 0.0, sensVisee, semiMajorAxis , semiMinorAxis , height, &cart); - GeodesicCoordinate geo; - cart.AsGeodesicCoordinates(semiMajorAxis , semiMinorAxis, &geo); - lon = (geo.get_x())*360.0/DEUXPI; - lat = (geo.get_y())*360.0/DEUXPI; + GeodesicCoordinate geo; + cart.AsGeodesicCoordinates(semiMajorAxis , semiMinorAxis, &geo); + lon = (geo.get_x())*360.0/DEUXPI; + lat = (geo.get_y())*360.0/DEUXPI; - delete satPosition; + delete satPosition; - return etatLoc ; + return etatLoc ; } int SarSensor::localisationSAR ( GeographicEphemeris PosVit , double lambda , @@ -69,167 +69,167 @@ int SarSensor::localisationSAR ( GeographicEphemeris PosVit , double lambda , double rayonEqu , double rayonPol , double h , RectangularCoordinate* cart ) { - double coordCart[3]; + double coordCart[3]; coordCart[0]=0.0; coordCart[1]=0.0; coordCart[2]=0.0; - int* ordre; - int etat , fin , n , i , i1 , i2 , nRac , indice[4] ; - double posX , posY , posZ , vitX , vitY , vitZ ; - double dist1 , fDop1 , he , hp ; - double rho2 , k , a , b , c , d , u , v , w ; - double x[4] , y[4] , z[4] , r[4] ; - std::complex<double> aa[5]; - std::complex<double> *racine; - GeographicEphemeris PosVitGeo ; + int* ordre; + int etat , fin , n , i , i1 , i2 , nRac , indice[4] ; + double posX , posY , posZ , vitX , vitY , vitZ ; + double dist1 , fDop1 , he , hp ; + double rho2 , k , a , b , c , d , u , v , w ; + double x[4] , y[4] , z[4] , r[4] ; + std::complex<double> aa[5]; + std::complex<double> *racine; + GeographicEphemeris PosVitGeo ; - /* Initialization of characteristical values */ - /* note : for precise computation : */ - /* - ranges are processed in mm */ - /* - velocities are processed in km/s */ - /* - frequencies are processed in kHz */ - const double KILO = 1.0e-3 ; - const double MEGA = 1.0e-6 ; - const double EPSILON = 1.0e-12 ; + /* Initialization of characteristical values */ + /* note : for precise computation : */ + /* - ranges are processed in mm */ + /* - velocities are processed in km/s */ + /* - frequencies are processed in kHz */ + const double KILO = 1.0e-3 ; + const double MEGA = 1.0e-6 ; + const double EPSILON = 1.0e-12 ; - etat = 0 ; + etat = 0 ; - dist1 = dist * MEGA ; - fDop1 = fDop * KILO ; + dist1 = dist * MEGA ; + fDop1 = fDop * KILO ; - he = (rayonEqu + h) * MEGA ; /* Equatorial radius + h */ - hp = (rayonPol + h) * MEGA ; /* Polar radius + h */ + he = (rayonEqu + h) * MEGA ; /* Equatorial radius + h */ + hp = (rayonPol + h) * MEGA ; /* Polar radius + h */ - posX = PosVit.get_position()[0] * MEGA ; - posY = PosVit.get_position()[1] * MEGA ; - posZ = PosVit.get_position()[2] * MEGA ; - vitX = - PosVit.get_vitesse()[0] * KILO ; - vitY = - PosVit.get_vitesse()[1] * KILO ; - vitZ = - PosVit.get_vitesse()[2] * KILO ; + posX = PosVit.get_position()[0] * MEGA ; + posY = PosVit.get_position()[1] * MEGA ; + posZ = PosVit.get_position()[2] * MEGA ; + vitX = - PosVit.get_vitesse()[0] * KILO ; + vitY = - PosVit.get_vitesse()[1] * KILO ; + vitZ = - PosVit.get_vitesse()[2] * KILO ; - /* Coefficients computation and equation solving */ - if (etat == 0) - { + /* Coefficients computation and equation solving */ + if (etat == 0) + { - u = vitX * posY - vitY * posX ; - a = (vitX / u) * (1.0 - (he / hp) * (he / hp)) / 2.0 ; - b = (vitX * posZ - vitZ * posX) / u ; - rho2 = posX * posX + posY * posY + posZ * posZ ; - k = posX * vitX + posY * vitY + posZ * vitZ - + u = vitX * posY - vitY * posX ; + a = (vitX / u) * (1.0 - (he / hp) * (he / hp)) / 2.0 ; + b = (vitX * posZ - vitZ * posX) / u ; + rho2 = posX * posX + posY * posY + posZ * posZ ; + k = posX * vitX + posY * vitY + posZ * vitZ - lambda * dist1 * fDop1 / 2.0 ; - c = (vitX * (he * he + rho2 - dist1 * dist1) - 2.0 * k * posX) / (2.0 * u); - - u = vitZ - b * vitY ; - v = c * vitY - k ; - w = v * v - (vitX * vitX) * (he * he - c * c) ; - aa[0] = std::complex<double>(w,0.0); /* Constant coefficient */ - w = 2.0 * (u * v - (b * c) * (vitX * vitX)) ; - aa[1] = std::complex<double>(w,0.0) ; /* First order coefficient */ - w = u * u + 2.0 * a * v * vitY + + c = (vitX * (he * he + rho2 - dist1 * dist1) - 2.0 * k * posX) / (2.0 * u); + + u = vitZ - b * vitY ; + v = c * vitY - k ; + w = v * v - (vitX * vitX) * (he * he - c * c) ; + aa[0] = std::complex<double>(w,0.0); /* Constant coefficient */ + w = 2.0 * (u * v - (b * c) * (vitX * vitX)) ; + aa[1] = std::complex<double>(w,0.0) ; /* First order coefficient */ + w = u * u + 2.0 * a * v * vitY + (vitX * vitX) * ((he / hp) * (he / hp) + b * b + 2.0 * a * c) ; - aa[2] = std::complex<double>(w,0.0) ; /* Second order coefficient */ - w = 2.0 * a * (u * vitY - b * vitX * vitX) ; - aa[3] = std::complex<double>(w,0.0) ; /* Third order coefficient */ - w = (vitX * vitX + vitY * vitY) * a * a ; - aa[4] = std::complex<double>(w,0.0) ; /* Fourth order coefficient */ - - Equation eq(4,aa); /* Equation solving */ - eq.Solve(); - - n = eq.get_nbrSol(); - racine = eq.get_solutions(); - ordre = eq.get_order(); - - nRac = 0 ; - for (i = 0 ; i < n ; i++) /* Real root selection */ - { - d = fabs(racine[i].imag()) ; - if (d < EPSILON) - { - z[nRac] = racine[i].real(); - y[nRac] = (a * z[nRac] - b) * z[nRac] + c ; - x[nRac] = (k - (vitY * y[nRac] + vitZ * z[nRac])) / vitX ; - nRac = nRac + 1 ; - } - } - if (nRac == 0) - etat = 2 ; /* No root */ - } - - /* Computed roots sort */ - if (etat == 0) - { - for (i = 0 ; i < nRac ; i++) - { - /* Computation of the "distance" between roots images and equation values */ - u = x[i] - posX ; - v = y[i] - posY ; - w = z[i] - posZ ; - r[i] = fabs ((u * u + v * v + w * w) / (dist1 * dist1) - 1.0 ) ; - u = u * vitX ; - v = v * vitY ; - w = w * vitZ ; - if (fabs (fDop) > EPSILON) - r[i] = r[i] + fabs (1.0 + 2.0 * (u + v + w) / (lambda * dist1 * fDop1)); - else - r[i] = r[i] + fabs (2.0 * (u + v + w) / (lambda * dist1)) ; - u = x[i] / he ; - v = y[i] / he ; - w = z[i] / hp ; - r[i] = r[i] + fabs (u * u + v * v + w * w - 1.0) ; - indice[i] = i ; - } - - /* Roots sort by increasing differences */ - fin = 0 ; - while (fin == 0) - { - fin = 1 ; - for (i = 0 ; i < (nRac - 1) ; i++) - { - i1 = indice[i] ; - i2 = indice[i+1] ; - if (r[i2] < r[i1]) - { - indice[i] = i2 ; - indice[i+1] = i1 ; - fin = 0 ; - } - } - } - - /* Selection of the correct root (corresponding to the imaging direction) */ - fin = 0 ; - i = 0 ; - while ((fin == 0) && (i < nRac)) - { - i1 = indice[i] ; - u = posY * vitZ - posZ * vitY ; - v = posZ * vitX - posX * vitZ ; - w = posX * vitY - posY * vitX ; - a = x[i1] - posX ; - b = y[i1] - posY ; - c = z[i1] - posZ ; - d = (a * u + b * v + c * w) * sensVisee; - if (d >= 0.0) - { - coordCart[0] = x[i1] / MEGA ; /* Coordinates in the */ - coordCart[1] = y[i1] / MEGA ; /* geographic referential, */ - coordCart[2] = z[i1] / MEGA ; /* in legal units (m) */ - fin = 1 ; - } - i++ ; - } - if (fin == 0) - etat = 1 ; /* No root in the imaging direction */ - } - - cart->set_coordinates(coordCart[0], coordCart[1], coordCart[2]); - return etat ; + aa[2] = std::complex<double>(w,0.0) ; /* Second order coefficient */ + w = 2.0 * a * (u * vitY - b * vitX * vitX) ; + aa[3] = std::complex<double>(w,0.0) ; /* Third order coefficient */ + w = (vitX * vitX + vitY * vitY) * a * a ; + aa[4] = std::complex<double>(w,0.0) ; /* Fourth order coefficient */ + + Equation eq(4,aa); /* Equation solving */ + eq.Solve(); + + n = eq.get_nbrSol(); + racine = eq.get_solutions(); + ordre = eq.get_order(); + + nRac = 0 ; + for (i = 0 ; i < n ; i++) /* Real root selection */ + { + d = fabs(racine[i].imag()) ; + if (d < EPSILON) + { + z[nRac] = racine[i].real(); + y[nRac] = (a * z[nRac] - b) * z[nRac] + c ; + x[nRac] = (k - (vitY * y[nRac] + vitZ * z[nRac])) / vitX ; + nRac = nRac + 1 ; + } + } + if (nRac == 0) + etat = 2 ; /* No root */ + } + + /* Computed roots sort */ + if (etat == 0) + { + for (i = 0 ; i < nRac ; i++) + { + /* Computation of the "distance" between roots images and equation values */ + u = x[i] - posX ; + v = y[i] - posY ; + w = z[i] - posZ ; + r[i] = fabs ((u * u + v * v + w * w) / (dist1 * dist1) - 1.0 ) ; + u = u * vitX ; + v = v * vitY ; + w = w * vitZ ; + if (fabs (fDop) > EPSILON) + r[i] = r[i] + fabs (1.0 + 2.0 * (u + v + w) / (lambda * dist1 * fDop1)); + else + r[i] = r[i] + fabs (2.0 * (u + v + w) / (lambda * dist1)) ; + u = x[i] / he ; + v = y[i] / he ; + w = z[i] / hp ; + r[i] = r[i] + fabs (u * u + v * v + w * w - 1.0) ; + indice[i] = i ; + } + + /* Roots sort by increasing differences */ + fin = 0 ; + while (fin == 0) + { + fin = 1 ; + for (i = 0 ; i < (nRac - 1) ; i++) + { + i1 = indice[i] ; + i2 = indice[i+1] ; + if (r[i2] < r[i1]) + { + indice[i] = i2 ; + indice[i+1] = i1 ; + fin = 0 ; + } + } + } + + /* Selection of the correct root (corresponding to the imaging direction) */ + fin = 0 ; + i = 0 ; + while ((fin == 0) && (i < nRac)) + { + i1 = indice[i] ; + u = posY * vitZ - posZ * vitY ; + v = posZ * vitX - posX * vitZ ; + w = posX * vitY - posY * vitX ; + a = x[i1] - posX ; + b = y[i1] - posY ; + c = z[i1] - posZ ; + d = (a * u + b * v + c * w) * sensVisee; + if (d >= 0.0) + { + coordCart[0] = x[i1] / MEGA ; /* Coordinates in the */ + coordCart[1] = y[i1] / MEGA ; /* geographic referential, */ + coordCart[2] = z[i1] / MEGA ; /* in legal units (m) */ + fin = 1 ; + } + i++ ; + } + if (fin == 0) + etat = 1 ; /* No root in the imaging direction */ + } + + cart->set_coordinates(coordCart[0], coordCart[1], coordCart[2]); + return etat ; } } diff --git a/Utilities/otbossimplugins/ossim/otb/SarSensor.h b/Utilities/otbossimplugins/ossim/otb/SarSensor.h index 58a4a7b7de9cd78de8599449692eb3d0e0119bb8..1ca778e2568a76973970f24cf61ed4b370dcf3d1 100644 --- a/Utilities/otbossimplugins/ossim/otb/SarSensor.h +++ b/Utilities/otbossimplugins/ossim/otb/SarSensor.h @@ -30,35 +30,35 @@ class JSDDateTime; class SarSensor : Sensor { public: - /** - * @brief Constructor - * - * @remarks This constructor creates a copy of params and position - */ - SarSensor(SensorParams* params, PlatformPosition* position); - /** - * @brief Destructor - */ - virtual ~SarSensor(); + /** + * @brief Constructor + * + * @remarks This constructor creates a copy of params and position + */ + SarSensor(SensorParams* params, PlatformPosition* position); + /** + * @brief Destructor + */ + virtual ~SarSensor(); - /** - * @brief This function is able to convert image coordinates into geodetic world coordinates using a geometric SAR sensor model - * - * @param distance : Slant range of the image point - * @param time : Azimuth time of the image point - * @param height : Altitude of the world point - * @retval lon : Longitude of the world point - * @retval lat : Latitude of the world point - * - * @remark : the doppler frequency is set to zero in this implementation - */ - virtual int ImageToWorld(double distance, JSDDateTime time, double height, double& lon, double& lat); + /** + * @brief This function is able to convert image coordinates into geodetic world coordinates using a geometric SAR sensor model + * + * @param distance : Slant range of the image point + * @param time : Azimuth time of the image point + * @param height : Altitude of the world point + * @retval lon : Longitude of the world point + * @retval lat : Latitude of the world point + * + * @remark : the doppler frequency is set to zero in this implementation + */ + virtual int ImageToWorld(double distance, JSDDateTime time, double height, double& lon, double& lat); protected: - /** - * @brief This function is able to convert image coordinates into rectangular world coordinates - */ - int localisationSAR ( GeographicEphemeris PosVit , double lambda , + /** + * @brief This function is able to convert image coordinates into rectangular world coordinates + */ + int localisationSAR ( GeographicEphemeris PosVit , double lambda , double dist , double fDop , int sensVisee , double rayonEqu , double rayonPol , double h , RectangularCoordinate* cart ); diff --git a/Utilities/otbossimplugins/ossim/otb/Sensor.cpp b/Utilities/otbossimplugins/ossim/otb/Sensor.cpp index 896fa8f2ba44450dd910a45b0af79c00119a1968..6e676c7a92aee5c41b712e54bf0a3e339e2811ff 100644 --- a/Utilities/otbossimplugins/ossim/otb/Sensor.cpp +++ b/Utilities/otbossimplugins/ossim/otb/Sensor.cpp @@ -21,20 +21,20 @@ namespace ossimplugins Sensor::Sensor(SensorParams* params, PlatformPosition* position) { - _params = params->Clone(); - _position = position->Clone(); + _params = params->Clone(); + _position = position->Clone(); } Sensor::~Sensor() { - if(_params != NULL) - { - delete _params; - } + if(_params != NULL) + { + delete _params; + } - if(_position != NULL) - { - delete _position; - } + if(_position != NULL) + { + delete _position; + } } } diff --git a/Utilities/otbossimplugins/ossim/otb/Sensor.h b/Utilities/otbossimplugins/ossim/otb/Sensor.h index 14f351395562b6b3a8e37aaa91561ccd10b279f9..1f3a1d2291912ffdb9f887b814fcbde1b755482f 100644 --- a/Utilities/otbossimplugins/ossim/otb/Sensor.h +++ b/Utilities/otbossimplugins/ossim/otb/Sensor.h @@ -29,30 +29,30 @@ class JSDDateTime; class Sensor { public: - /** - * @brief Constructor - * - * @remarks This constructor creates a copy of the sensor model (params and position) - */ - Sensor(SensorParams* params, PlatformPosition* position); - /** - * @brief Destructor - */ - virtual ~Sensor(); - - /** - * @brief This function is able to convert image coordinates into geodetic world coordinates using a sensor model - * - * @param distance : Slant range of the image point - * @param time : Azimuth time of the image point - * @param height : Altitude of the world point - * @retval lon : Longitude of the world point - * @retval lat : Latitude of the world point - */ - virtual int ImageToWorld(double distance, JSDDateTime time, double height, double& lon, double& lat) = 0; + /** + * @brief Constructor + * + * @remarks This constructor creates a copy of the sensor model (params and position) + */ + Sensor(SensorParams* params, PlatformPosition* position); + /** + * @brief Destructor + */ + virtual ~Sensor(); + + /** + * @brief This function is able to convert image coordinates into geodetic world coordinates using a sensor model + * + * @param distance : Slant range of the image point + * @param time : Azimuth time of the image point + * @param height : Altitude of the world point + * @retval lon : Longitude of the world point + * @retval lat : Latitude of the world point + */ + virtual int ImageToWorld(double distance, JSDDateTime time, double height, double& lon, double& lat) = 0; protected: - SensorParams * _params; - PlatformPosition* _position; + SensorParams * _params; + PlatformPosition* _position; private: }; diff --git a/Utilities/otbossimplugins/ossim/otb/SensorParams.h b/Utilities/otbossimplugins/ossim/otb/SensorParams.h index c52fd6b82154b41cb40d96a3767229816f9ab2f7..33b68e3f47a43f0e82eae7cabcf666abee9bc0da 100644 --- a/Utilities/otbossimplugins/ossim/otb/SensorParams.h +++ b/Utilities/otbossimplugins/ossim/otb/SensorParams.h @@ -206,13 +206,13 @@ protected: /** * @brief Ellipsoid semi_major axis, m - * Default : WGS84 + * Default : WGS84 */ double _semiMajorAxis; /** * @brief Ellipsoid semi_minor axis, m - * Default : WGS84 + * Default : WGS84 */ double _semiMinorAxis;