1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Updating RINEX obs header when leap second is received (version 2.11)

This commit is contained in:
Carles Fernandez 2015-03-03 18:01:53 +01:00
parent bf85e1fbe1
commit 0b47f2e719
3 changed files with 86 additions and 2 deletions

View File

@ -266,7 +266,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
}
if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0))
{
//rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
b_rinex_header_updated = true;
}

View File

@ -1822,6 +1822,88 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Gps_Eph
Rinex_Printer::log_rinex_nav(out, galileo_eph_map);
}
void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model)
{
std::vector<std::string> data;
std::string line_aux;
long pos = out.tellp();
out.seekp(0);
data.clear();
bool no_more_finds = false;
std::string line_str;
while(!out.eof())
{
std::getline(out, line_str);
if(!no_more_finds)
{
line_aux.clear();
if (version == 2)
{
if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) // TIME OF FIRST OBS last header annotation might change in the future
{
data.push_back(line_str);
line_aux += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.d_DeltaT_LS), 6);
line_aux += std::string(54, ' ');
line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20);
data.push_back(line_aux);
}
else if (line_str.find("END OF HEADER", 59) != std::string::npos)
{
data.push_back(line_str);
no_more_finds = true;
}
else
{
data.push_back(line_str);
}
}
if (version == 3)
{
if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos)
{
data.push_back(line_str);
line_aux += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.d_DeltaT_LS), 6);
line_aux += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.d_DeltaT_LSF), 6);
line_aux += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.i_WN_LSF), 6);
line_aux += Rinex_Printer::rightJustify(boost::lexical_cast<std::string>(utc_model.i_DN), 6);
line_aux += std::string(36, ' ');
line_aux += Rinex_Printer::leftJustify("LEAP SECONDS", 20);
data.push_back(line_aux);
}
else if (line_str.find("END OF HEADER", 59) != std::string::npos)
{
data.push_back(line_str);
no_more_finds = true;
}
else
{
data.push_back(line_str);
}
}
}
else
{
data.push_back(line_str);
}
}
out.close();
out.open(navfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
{
out << data[i] << std::endl;
}
out.close();
out.open(navfilename, std::ios::out | std::ios::app);
out.seekp(pos);
}
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph, const double d_TOW_first_observation)
{
@ -2084,7 +2166,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
out << line << std::endl;
}
//void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation)
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation)
{

View File

@ -188,6 +188,8 @@ public:
void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac);
void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model);
std::map<std::string,std::string> satelliteSystem; //<! GPS, GLONASS, SBAS payload, Galileo or Compass
std::map<std::string,std::string> observationType; //<! PSEUDORANGE, CARRIER_PHASE, DOPPLER, SIGNAL_STRENGTH
std::map<std::string,std::string> observationCode; //<! GNSS observation descriptors