1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-29 02:14:51 +00:00

Use more descriptive names for variables

This commit is contained in:
Carles Fernandez 2016-11-03 14:52:30 +01:00
parent 1c975313b7
commit 97ffee0b0c
8 changed files with 449 additions and 457 deletions

View File

@ -71,18 +71,18 @@ hybrid_ls_pvt::~hybrid_ls_pvt()
}
bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, double hybrid_current_time, bool flag_averaging)
bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging)
{
std::map<int,Gnss_Synchro>::iterator gnss_pseudoranges_iter;
std::map<int,Gnss_Synchro>::iterator gnss_observables_iter;
std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
std::map<int,Gps_CNAV_Ephemeris>::iterator gps_cnav_ephemeris_iter;
int valid_pseudoranges = gnss_pseudoranges_map.size();
int valid_observables = gnss_observables_map.size();
arma::mat W = arma::eye(valid_pseudoranges, valid_pseudoranges); // channels weights matrix
arma::vec obs = arma::zeros(valid_pseudoranges); // pseudoranges observation vector
arma::mat satpos = arma::zeros(3, valid_pseudoranges); // satellite positions matrix
arma::mat W = arma::eye(valid_observables, valid_observables); // channels weights matrix
arma::vec obs = arma::zeros(valid_observables); // observables observation vector
arma::mat satpos = arma::zeros(3, valid_observables); // satellite positions matrix
int Galileo_week_number = 0;
int GPS_week = 0;
@ -100,14 +100,14 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
int valid_obs = 0; //valid observations counter
int obs_counter = 0;
for(gnss_pseudoranges_iter = gnss_pseudoranges_map.begin();
gnss_pseudoranges_iter != gnss_pseudoranges_map.end();
gnss_pseudoranges_iter++)
for(gnss_observables_iter = gnss_observables_map.begin();
gnss_observables_iter != gnss_observables_map.end();
gnss_observables_iter++)
{
if(gnss_pseudoranges_iter->second.System == 'E')
if(gnss_observables_iter->second.System == 'E')
{
// 1 Gal - find the ephemeris for the current GALILEO SV observation. The SV PRN ID is the map key
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_pseudoranges_iter->second.PRN);
galileo_ephemeris_iter = galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (galileo_ephemeris_iter != galileo_ephemeris_map.end())
{
/*!
@ -117,7 +117,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// COMMON RX TIME PVT ALGORITHM
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_pseudoranges_iter->second.Pseudorange_m / GALILEO_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -130,10 +130,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
satpos(1,obs_counter) = galileo_ephemeris_iter->second.d_satpos_Y;
satpos(2,obs_counter) = galileo_ephemeris_iter->second.d_satpos_Z;
// 5- fill the observations vector with the corrected pseudoranges
obs(obs_counter) = gnss_pseudoranges_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s;
// 5- fill the observations vector with the corrected observables
obs(obs_counter) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s;
d_visible_satellites_IDs[valid_obs] = galileo_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_pseudoranges_iter->second.CN0_dB_hz;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
valid_obs++;
Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
@ -152,18 +152,18 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// no valid pseudorange for the current SV
W(obs_counter, obs_counter) = 0; // SV de-activated
obs(obs_counter) = 1; // to avoid algorithm problems (divide by zero)
DLOG(INFO) << "No ephemeris data for SV " << gnss_pseudoranges_iter->second.PRN;
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
else if(gnss_pseudoranges_iter->second.System == 'G')
else if(gnss_observables_iter->second.System == 'G')
{
//std::cout << "Satellite System: " << gnss_pseudoranges_iter->second.System <<std::endl;
//std::cout << "Satellite System: " << gnss_observables_iter->second.System <<std::endl;
// 1 GPS - find the ephemeris for the current GPS SV observation. The SV PRN ID is the map key
std::string sig_(gnss_pseudoranges_iter->second.Signal);
std::string sig_(gnss_observables_iter->second.Signal);
if(sig_.compare("1C") == 0)
{
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_pseudoranges_iter->second.PRN);
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_ephemeris_iter != gps_ephemeris_map.end())
{
/*!
@ -174,7 +174,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_pseudoranges_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -187,10 +187,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
satpos(1, obs_counter) = gps_ephemeris_iter->second.d_satpos_Y;
satpos(2, obs_counter) = gps_ephemeris_iter->second.d_satpos_Z;
// 5- fill the observations vector with the corrected pseudoranges
obs(obs_counter) = gnss_pseudoranges_iter->second.Pseudorange_m + SV_clock_bias_s * GPS_C_m_s;
// 5- fill the observations vector with the corrected observables
obs(obs_counter) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GPS_C_m_s;
d_visible_satellites_IDs[valid_obs] = gps_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_pseudoranges_iter->second.CN0_dB_hz;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
valid_obs++;
GPS_week = gps_ephemeris_iter->second.i_GPS_week;
@ -206,12 +206,12 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// no valid pseudorange for the current SV
W(obs_counter, obs_counter) = 0; // SV de-activated
obs(obs_counter) = 1; // to avoid algorithm problems (divide by zero)
DLOG(INFO) << "No ephemeris data for SV " << gnss_pseudoranges_iter->second.PRN;
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
if(sig_.compare("2S") == 0)
{
gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_pseudoranges_iter->second.PRN);
gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.end())
{
/*!
@ -222,7 +222,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
// first estimate of transmit time
double Rx_time = hybrid_current_time;
double Tx_time = Rx_time - gnss_pseudoranges_iter->second.Pseudorange_m / GPS_C_m_s;
double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s;
// 2- compute the clock drift using the clock model (broadcast) for this SV
SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time);
@ -235,10 +235,10 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
satpos(1, obs_counter) = gps_cnav_ephemeris_iter->second.d_satpos_Y;
satpos(2, obs_counter) = gps_cnav_ephemeris_iter->second.d_satpos_Z;
// 5- fill the observations vector with the corrected pseudoranges
obs(obs_counter) = gnss_pseudoranges_iter->second.Pseudorange_m + SV_clock_bias_s * GPS_C_m_s;
// 5- fill the observations vector with the corrected observables
obs(obs_counter) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GPS_C_m_s;
d_visible_satellites_IDs[valid_obs] = gps_cnav_ephemeris_iter->second.i_satellite_PRN;
d_visible_satellites_CN0_dB[valid_obs] = gnss_pseudoranges_iter->second.CN0_dB_hz;
d_visible_satellites_CN0_dB[valid_obs] = gnss_observables_iter->second.CN0_dB_hz;
valid_obs++;
GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week;
@ -254,7 +254,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
// no valid pseudorange for the current SV
W(obs_counter, obs_counter) = 0; // SV de-activated
obs(obs_counter) = 1; // to avoid algorithm problems (divide by zero)
DLOG(INFO) << "No ephemeris data for SV " << gnss_pseudoranges_iter->second.PRN;
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
}
}
}

View File

@ -41,10 +41,6 @@
#include "gps_navigation_message.h"
#include "gps_cnav_navigation_message.h"
#include "gnss_synchro.h"
//#include "galileo_ephemeris.h"
//#include "galileo_utc_model.h"
//#include "gps_ephemeris.h"
//#include "gps_utc_model.h"
/*!
@ -56,17 +52,13 @@ public:
hybrid_ls_pvt(int nchannels,std::string dump_filename, bool flag_dump_to_file);
~hybrid_ls_pvt();
bool get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, double hybrid_current_time, bool flag_averaging);
bool get_PVT(std::map<int,Gnss_Synchro> gnss_observables_map, double hybrid_current_time, bool flag_averaging);
int d_nchannels; //!< Number of available channels for positioning
//int d_valid_GPS_obs; //!< Number of valid GPS pseudorange observations (valid GPS satellites) -- used for hybrid configuration
//int d_valid_GAL_obs; //!< Number of valid GALILEO pseudorange observations (valid GALILEO satellites) -- used for hybrid configuration
//Galileo_Navigation_Message* d_Gal_ephemeris;
//Gps_Navigation_Message* d_GPS_ephemeris;
std::map<int,Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
std::map<int,Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
std::map<int,Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map;
Galileo_Utc_Model galileo_utc_model;
Galileo_Iono galileo_iono;
Galileo_Almanac galileo_almanac;

View File

@ -3634,7 +3634,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
}
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, const double obs_time, const std::map<int,Gnss_Synchro>& observables)
{
// RINEX observations timestamps are GPS timestamps.
std::string line;
@ -3692,21 +3692,21 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
line += std::string(1, '0');
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
numSatellitesObserved++;
}
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
line += satelliteSystem["GPS"];
if (static_cast<int>(pseudoranges_iter->second.PRN) < 10) line += std::string(1, '0');
line += boost::lexical_cast<std::string>(static_cast<int>(pseudoranges_iter->second.PRN));
if (static_cast<int>(observables_iter->second.PRN) < 10) line += std::string(1, '0');
line += boost::lexical_cast<std::string>(static_cast<int>(observables_iter->second.PRN));
}
// Receiver clock offset (optional)
//line += rightJustify(asString(clockOffset, 12), 15);
@ -3715,16 +3715,16 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
out << line << std::endl;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string lineObs;
lineObs.clear();
line.clear();
// GPS L1 PSEUDORANGE
line += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Pseudorange_m, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
int lli = 0; // Include in the observation!!
@ -3738,10 +3738,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
}
// Signal Strength Indicator (SSI)
int ssi = Rinex_Printer::signalStrength(pseudoranges_iter->second.CN0_dB_hz);
int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz);
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L1 CA PHASE
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3752,7 +3752,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
}
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L1 CA DOPPLER
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_Doppler_hz, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3763,7 +3763,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
}
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
//GPS L1 SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
out << lineObs << std::endl;
}
@ -3798,10 +3798,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
numSatellitesObserved++;
}
@ -3815,17 +3815,17 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string lineObs;
lineObs.clear();
lineObs += satelliteSystem["GPS"];
if (static_cast<int>(pseudoranges_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(pseudoranges_iter->second.PRN));
if (static_cast<int>(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(observables_iter->second.PRN));
//lineObs += std::string(2, ' ');
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Pseudorange_m, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
int lli = 0; // Include in the observation!!
@ -3839,11 +3839,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
}
// Signal Strength Indicator (SSI)
int ssi = Rinex_Printer::signalStrength(pseudoranges_iter->second.CN0_dB_hz);
int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz);
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L1 CA PHASE
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3855,7 +3855,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L1 CA DOPPLER
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_Doppler_hz, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3868,7 +3868,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
//GPS L1 SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
out << lineObs << std::endl;
@ -3877,7 +3877,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
}
void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & observables)
{
// RINEX observations timestamps are GPS timestamps.
std::string line;
@ -3920,10 +3920,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
//Number of satellites observed in current epoch
int numSatellitesObserved = 0;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
numSatellitesObserved++;
}
@ -3936,18 +3936,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string lineObs;
lineObs.clear();
lineObs += satelliteSystem["GPS"];
if (static_cast<int>(pseudoranges_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(pseudoranges_iter->second.PRN));
if (static_cast<int>(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(observables_iter->second.PRN));
//lineObs += std::string(2, ' ');
//GPS L2 PSEUDORANGE
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Pseudorange_m, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
int lli = 0; // Include in the observation!!
@ -3961,11 +3961,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
}
// Signal Strength Indicator (SSI)
int ssi = Rinex_Printer::signalStrength(pseudoranges_iter->second.CN0_dB_hz);
int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz);
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L2 PHASE
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3977,7 +3977,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// GPS L2 DOPPLER
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_Doppler_hz, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -3990,7 +3990,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
//GPS L2 SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
out << lineObs << std::endl;
@ -3998,7 +3998,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris &
}
void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map<int, Gnss_Synchro> & observables)
{
if(eph_cnav.d_i_0){} // avoid warning, not needed
// RINEX observations timestamps are GPS timestamps.
@ -4043,34 +4043,34 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
//Number of satellites observed in current epoch
//Get maps with GPS L1 and L2 observations
std::map<int, Gnss_Synchro> pseudorangesL1;
std::map<int, Gnss_Synchro> pseudorangesL2;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter2;
std::map<int, Gnss_Synchro> observablesL1;
std::map<int, Gnss_Synchro> observablesL2;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
std::map<int, Gnss_Synchro>::const_iterator observables_iter2;
std::multimap<unsigned int, Gnss_Synchro> total_mmap;
std::multimap<unsigned int, Gnss_Synchro>::iterator mmap_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string system_(&pseudoranges_iter->second.System, 1);
std::string sig_(pseudoranges_iter->second.Signal);
std::string system_(&observables_iter->second.System, 1);
std::string sig_(observables_iter->second.Signal);
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
{
pseudorangesL1.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(pseudoranges_iter->second.PRN, pseudoranges_iter->second));
observablesL1.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(observables_iter->second.PRN, observables_iter->second));
}
if((system_.compare("G") == 0) && (sig_.compare("2S") == 0))
{
pseudorangesL2.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
mmap_iter = total_mmap.find(pseudoranges_iter->second.PRN);
observablesL2.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
mmap_iter = total_mmap.find(observables_iter->second.PRN);
if(mmap_iter == total_mmap.end())
{
Gnss_Synchro gs = Gnss_Synchro();
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(pseudoranges_iter->second.PRN, gs));
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(observables_iter->second.PRN, gs));
}
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(pseudoranges_iter->second.PRN, pseudoranges_iter->second));
total_mmap.insert(std::pair<unsigned int, Gnss_Synchro>(observables_iter->second.PRN, observables_iter->second));
}
}
@ -4095,11 +4095,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
std::set<unsigned int> available_prns;
std::set<unsigned int>::iterator it;
for(pseudoranges_iter = pseudorangesL1.begin();
pseudoranges_iter != pseudorangesL1.end();
pseudoranges_iter++)
for(observables_iter = observablesL1.begin();
observables_iter != observablesL1.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
unsigned int prn_ = observables_iter->second.PRN;
it = available_prns.find(prn_);
if(it == available_prns.end())
{
@ -4107,11 +4107,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
}
}
for(pseudoranges_iter = pseudorangesL2.begin();
pseudoranges_iter != pseudorangesL2.end();
pseudoranges_iter++)
for(observables_iter = observablesL2.begin();
observables_iter != observablesL2.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
unsigned int prn_ = observables_iter->second.PRN;
it = available_prns.find(prn_);
if(it == available_prns.end())
{
@ -4191,7 +4191,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph,
}
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges, const std::string galileo_bands)
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int,Gnss_Synchro>& observables, const std::string galileo_bands)
{
// RINEX observations timestamps are Galileo timestamps.
// See http://gage14.upc.es/gLAB/HTML/Observation_Rinex_v3.01.html
@ -4236,28 +4236,28 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
//Number of satellites observed in current epoch
//Get maps with Galileo observations
std::map<int, Gnss_Synchro> pseudorangesE1B;
std::map<int, Gnss_Synchro> pseudorangesE5A;
std::map<int, Gnss_Synchro> pseudorangesE5B;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
std::map<int, Gnss_Synchro> observablesE1B;
std::map<int, Gnss_Synchro> observablesE5A;
std::map<int, Gnss_Synchro> observablesE5B;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string system_(&pseudoranges_iter->second.System, 1);
std::string sig_(pseudoranges_iter->second.Signal);
std::string system_(&observables_iter->second.System, 1);
std::string sig_(observables_iter->second.Signal);
if((system_.compare("E") == 0) && (sig_.compare("1B") == 0))
{
pseudorangesE1B.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE1B.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
if((system_.compare("E") == 0) && (sig_.compare("5X") == 0))
{
pseudorangesE5A.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE5A.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
if((system_.compare("E") == 0) && (sig_.compare("7X") == 0))
{
pseudorangesE5B.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE5B.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
}
std::size_t found_1B = galileo_bands.find("1B");
@ -4269,12 +4269,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
std::set<unsigned int>::iterator it;
if(found_1B != std::string::npos)
{
for(pseudoranges_iter = pseudorangesE1B.begin();
pseudoranges_iter != pseudorangesE1B.end();
pseudoranges_iter++)
for(observables_iter = observablesE1B.begin();
observables_iter != observablesE1B.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
unsigned int prn_ = observables_iter->second.PRN;
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
it = available_prns.find(prn_);
if(it == available_prns.end())
{
@ -4284,11 +4284,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
}
if(found_E5a != std::string::npos)
{
for(pseudoranges_iter = pseudorangesE5A.begin();
pseudoranges_iter != pseudorangesE5A.end();
pseudoranges_iter++)
for(observables_iter = observablesE5A.begin();
observables_iter != observablesE5A.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
unsigned int prn_ = observables_iter->second.PRN;
it = available_prns.find(prn_);
if(it == available_prns.end())
{
@ -4304,16 +4304,16 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, gs));
}
}
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
}
}
if(found_E5b != std::string::npos)
{
for(pseudoranges_iter = pseudorangesE5B.begin();
pseudoranges_iter != pseudorangesE5B.end();
pseudoranges_iter++)
for(observables_iter = observablesE5B.begin();
observables_iter != observablesE5B.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
unsigned int prn_ = observables_iter->second.PRN;
it = available_prns.find(prn_);
if(it == available_prns.end())
{
@ -4356,7 +4356,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
}
}
}
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
total_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
}
}
int numSatellitesObserved = available_prns.size();
@ -4431,7 +4431,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep
}
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int,Gnss_Synchro>& observables)
{
if(galileo_eph.e_1){} // avoid warning, not needed
std::string line;
@ -4475,45 +4475,45 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
//Number of satellites observed in current epoch
//Get maps with observations
std::map<int, Gnss_Synchro> pseudorangesG1C;
std::map<int, Gnss_Synchro> pseudorangesE1B;
std::map<int, Gnss_Synchro> pseudorangesE5A;
std::map<int, Gnss_Synchro> pseudorangesE5B;
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
std::map<int, Gnss_Synchro> observablesG1C;
std::map<int, Gnss_Synchro> observablesE1B;
std::map<int, Gnss_Synchro> observablesE5A;
std::map<int, Gnss_Synchro> observablesE5B;
std::map<int, Gnss_Synchro>::const_iterator observables_iter;
for(pseudoranges_iter = pseudoranges.begin();
pseudoranges_iter != pseudoranges.end();
pseudoranges_iter++)
for(observables_iter = observables.begin();
observables_iter != observables.end();
observables_iter++)
{
std::string system_(&pseudoranges_iter->second.System, 1);
std::string sig_(pseudoranges_iter->second.Signal);
std::string system_(&observables_iter->second.System, 1);
std::string sig_(observables_iter->second.Signal);
if((system_.compare("E") == 0) && (sig_.compare("1B") == 0))
{
pseudorangesE1B.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE1B.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
if((system_.compare("E") == 0) && (sig_.compare("5X") == 0))
{
pseudorangesE5A.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE5A.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
if((system_.compare("E") == 0) && (sig_.compare("7X") == 0))
{
pseudorangesE5B.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesE5B.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
if((system_.compare("G") == 0) && (sig_.compare("1C") == 0))
{
pseudorangesG1C.insert(std::pair<int, Gnss_Synchro>(pseudoranges_iter->first, pseudoranges_iter->second));
observablesG1C.insert(std::pair<int, Gnss_Synchro>(observables_iter->first, observables_iter->second));
}
}
std::multimap<unsigned int, Gnss_Synchro> total_gal_map;
std::set<unsigned int> available_gal_prns;
std::set<unsigned int>::iterator it;
for(pseudoranges_iter = pseudorangesE1B.begin();
pseudoranges_iter != pseudorangesE1B.end();
pseudoranges_iter++)
for(observables_iter = observablesE1B.begin();
observables_iter != observablesE1B.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
unsigned int prn_ = observables_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
it = available_gal_prns.find(prn_);
if(it == available_gal_prns.end())
{
@ -4521,12 +4521,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
}
for(pseudoranges_iter = pseudorangesE5A.begin();
pseudoranges_iter != pseudorangesE5A.end();
pseudoranges_iter++)
for(observables_iter = observablesE5A.begin();
observables_iter != observablesE5A.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
unsigned int prn_ = observables_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
it = available_gal_prns.find(prn_);
if(it == available_gal_prns.end())
{
@ -4534,12 +4534,12 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
}
for(pseudoranges_iter = pseudorangesE5B.begin();
pseudoranges_iter != pseudorangesE5B.end();
pseudoranges_iter++)
for(observables_iter = observablesE5B.begin();
observables_iter != observablesE5B.end();
observables_iter++)
{
unsigned int prn_ = pseudoranges_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, pseudoranges_iter->second));
unsigned int prn_ = observables_iter->second.PRN;
total_gal_map.insert(std::pair<unsigned int, Gnss_Synchro>(prn_, observables_iter->second));
it = available_gal_prns.find(prn_);
if(it == available_gal_prns.end())
{
@ -4548,7 +4548,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
int numGalSatellitesObserved = available_gal_prns.size();
int numGpsSatellitesObserved = pseudorangesG1C.size();
int numGpsSatellitesObserved = observablesG1C.size();
int numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved;
line += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(numSatellitesObserved), 3);
@ -4561,18 +4561,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
std::string s;
std::string lineObs;
for(pseudoranges_iter = pseudorangesG1C.begin();
pseudoranges_iter != pseudorangesG1C.end();
pseudoranges_iter++)
for(observables_iter = observablesG1C.begin();
observables_iter != observablesG1C.end();
observables_iter++)
{
lineObs.clear();
s.assign(1, pseudoranges_iter->second.System);
s.assign(1, observables_iter->second.System);
if(s.compare("G") == 0) lineObs += satelliteSystem["GPS"];
if(s.compare("E") == 0) lineObs += satelliteSystem["Galileo"]; // should not happen
if (static_cast<int>(pseudoranges_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(pseudoranges_iter->second.PRN));
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Pseudorange_m, 3), 14);
if (static_cast<int>(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0');
lineObs += boost::lexical_cast<std::string>(static_cast<int>(observables_iter->second.PRN));
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14);
//Loss of lock indicator (LLI)
int lli = 0; // Include in the observation!!
@ -4586,11 +4586,11 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
}
// Signal Strength Indicator (SSI)
int ssi = Rinex_Printer::signalStrength(pseudoranges_iter->second.CN0_dB_hz);
int ssi = Rinex_Printer::signalStrength(observables_iter->second.CN0_dB_hz);
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// PHASE
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_phase_rads/GPS_TWO_PI, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -4602,7 +4602,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// DOPPLER
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.Carrier_Doppler_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Carrier_Doppler_hz, 3), 14);
if (lli == 0)
{
lineObs += std::string(1, ' ');
@ -4614,7 +4614,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep
lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString<int>(ssi), 1);
// SIGNAL STRENGTH
lineObs += Rinex_Printer::rightJustify(asString(pseudoranges_iter->second.CN0_dB_hz, 3), 14);
lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14);
if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' ');
out << lineObs << std::endl;

View File

@ -184,27 +184,27 @@ public:
/*!
* \brief Writes GPS L1 observables into the RINEX file
*/
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & observables);
/*!
* \brief Writes GPS L2 observables into the RINEX file
*/
void log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
void log_rinex_obs(std::fstream & out, const Gps_CNAV_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & observables);
/*!
* \brief Writes dual frequency GPS L1 and L2 observables into the RINEX file
*/
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & eph, const Gps_CNAV_Ephemeris & eph_cnav, double obs_time, const std::map<int, Gnss_Synchro> & observables);
/*!
* \brief Writes Galileo observables into the RINEX file. Example: galileo_bands("1B"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B".
*/
void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, const std::string galileo_bands = "1B");
void log_rinex_obs(std::fstream & out, const Galileo_Ephemeris & eph, double obs_time, const std::map<int, Gnss_Synchro> & observables, const std::string galileo_bands = "1B");
/*!
* \brief Writes Mixed GPS / Galileo observables into the RINEX file
*/
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & gps_eph, const Galileo_Ephemeris & galileo_eph, const double gps_obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
void log_rinex_obs(std::fstream & out, const Gps_Ephemeris & gps_eph, const Galileo_Ephemeris & galileo_eph, const double gps_obs_time, const std::map<int, Gnss_Synchro> & observables);
/*!
* \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not.

View File

@ -145,17 +145,17 @@ Rtcm_Printer::~Rtcm_Printer()
}
bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
bool Rtcm_Printer::Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables)
{
std::string m1001 = rtcm->print_MT1001(gps_eph, obs_time, pseudoranges, station_id);
std::string m1001 = rtcm->print_MT1001(gps_eph, obs_time, observables, station_id);
Rtcm_Printer::Print_Message(m1001);
return true;
}
bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges)
bool Rtcm_Printer::Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables)
{
std::string m1002 = rtcm->print_MT1002(gps_eph, obs_time, pseudoranges, station_id);
std::string m1002 = rtcm->print_MT1002(gps_eph, obs_time, observables, station_id);
Rtcm_Printer::Print_Message(m1002);
return true;
}
@ -181,7 +181,7 @@ bool Rtcm_Printer::Print_Rtcm_MSM(unsigned int msm_number, const Gps_Ephemeris &
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
int smooth_int,
@ -191,31 +191,31 @@ bool Rtcm_Printer::Print_Rtcm_MSM(unsigned int msm_number, const Gps_Ephemeris &
std::string msm;
if(msm_number == 1)
{
msm = rtcm->print_MSM_1(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_1(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 2)
{
msm = rtcm->print_MSM_2(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_2(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 3)
{
msm = rtcm->print_MSM_3(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_3(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 4)
{
msm = rtcm->print_MSM_4(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_4(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 5)
{
msm = rtcm->print_MSM_5(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_5(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 6)
{
msm = rtcm->print_MSM_6(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_6(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else if(msm_number == 7)
{
msm = rtcm->print_MSM_7(gps_eph, gps_cnav_eph, gal_eph, obs_time, pseudoranges, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
msm = rtcm->print_MSM_7(gps_eph, gps_cnav_eph, gal_eph, obs_time, observables, station_id, clock_steering_indicator, external_clock_indicator, smooth_int, divergence_free, more_messages);
}
else
{

View File

@ -55,8 +55,8 @@ public:
*/
~Rtcm_Printer();
bool Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
bool Print_Rtcm_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables);
bool Print_Rtcm_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables);
bool Print_Rtcm_MT1019(const Gps_Ephemeris & gps_eph); //<! GPS Ephemeris, should be broadcast in the event that the IODC does not match the IODE, and every 2 minutes.
bool Print_Rtcm_MT1045(const Galileo_Ephemeris & gal_eph); //<! Galileo Ephemeris, should be broadcast every 2 minutes
@ -64,7 +64,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
int smooth_int,

File diff suppressed because it is too large Load Diff

View File

@ -89,22 +89,22 @@ public:
/*!
* \brief Prints message type 1001 (L1-Only GPS RTK Observables)
*/
std::string print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, unsigned short station_id);
std::string print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables, unsigned short station_id);
/*!
* \brief Prints message type 1002 (Extended L1-Only GPS RTK Observables)
*/
std::string print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, unsigned short station_id);
std::string print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & observables, unsigned short station_id);
/*!
* \brief Prints message type 1003 (L1 & L2 GPS RTK Observables)
*/
std::string print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, unsigned short station_id);
std::string print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & observables, unsigned short station_id);
/*!
* \brief Prints message type 1004 (Extended L1 & L2 GPS RTK Observables)
*/
std::string print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges, unsigned short station_id);
std::string print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & observables, unsigned short station_id);
/*!
* \brief Prints message type 1005 (Stationary Antenna Reference Point)
@ -155,13 +155,13 @@ public:
int read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph);
/*!
* \brief Prints messages of type MSM1 (Compact GNSS pseudoranges)
* \brief Prints messages of type MSM1 (Compact GNSS observables)
*/
std::string print_MSM_1( const Gps_Ephemeris & gps_eph,
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -176,7 +176,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -191,7 +191,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -206,7 +206,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -221,7 +221,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -236,7 +236,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -251,7 +251,7 @@ public:
const Gps_CNAV_Ephemeris & gps_cnav_eph,
const Galileo_Ephemeris & gal_eph,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -290,7 +290,7 @@ private:
//
std::bitset<64> get_MT1001_4_header(unsigned int msg_number,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int smooth_int,
bool sync_flag,
@ -305,7 +305,7 @@ private:
std::string get_MSM_header(unsigned int msg_number,
double obs_time,
const std::map<int, Gnss_Synchro> & pseudoranges,
const std::map<int, Gnss_Synchro> & observables,
unsigned int ref_id,
unsigned int clock_steering_indicator,
unsigned int external_clock_indicator,
@ -313,17 +313,17 @@ private:
bool divergence_free,
bool more_messages);
std::string get_MSM_1_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_4_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_5_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_1_content_sat_data(const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_4_content_sat_data(const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_5_content_sat_data(const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_1_content_signal_data(const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
std::string get_MSM_1_content_signal_data(const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
std::string get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & observables);
//
// Utilities
@ -799,7 +799,7 @@ private:
int set_DF005(bool sync_flag);
std::bitset<5> DF006;
int set_DF006(const std::map<int, Gnss_Synchro> & pseudoranges);
int set_DF006(const std::map<int, Gnss_Synchro> & observables);
std::bitset<1> DF007;
int set_DF007(bool divergence_free_smoothing_indicator); // 0 - Divergence-free smoothing not used 1 - Divergence-free smoothing used
@ -1071,12 +1071,12 @@ private:
int set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID
std::bitset<64> DF394;
int set_DF394(const std::map<int, Gnss_Synchro> & pseudoranges);
int set_DF394(const std::map<int, Gnss_Synchro> & observables);
std::bitset<32> DF395;
int set_DF395(const std::map<int, Gnss_Synchro> & pseudoranges);
int set_DF395(const std::map<int, Gnss_Synchro> & observables);
std::string set_DF396(const std::map<int, Gnss_Synchro> & pseudoranges);
std::string set_DF396(const std::map<int, Gnss_Synchro> & observables);
std::bitset<8> DF397;
int set_DF397(const Gnss_Synchro & gnss_synchro);