1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-23 13:33:15 +00:00

Fix RINEX annotations in GPS L1 around Saturday midnight

Only annotate navigation data when Toe changes
This commit is contained in:
Carles Fernandez 2019-05-10 14:57:16 +02:00
parent 87e30c2fcb
commit eff3513029
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 161 additions and 80 deletions

View File

@ -154,13 +154,11 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
* 10 | GPS L1 C/A + Galileo E5a
* 11 | GPS L1 C/A + Galileo E5b
* 12 | Galileo E1B + GPS L2C
* 13 | Galileo E1B + GPS L5
* 13 | Galileo E5a + GPS L5
* 14 | Galileo E1B + Galileo E5a
* 15 | Galileo E1B + Galileo E5b
* 16 | GPS L2C + GPS L5
* 17 | GPS L2C + Galileo E5a
* 18 | GPS L2C + Galileo E5b
* 19 | GPS L5 + Galileo E5a
* 20 | GPS L5 + Galileo E5b
* 21 | GPS L1 C/A + Galileo E1B + GPS L2C
* 22 | GPS L1 C/A + Galileo E1B + GPS L5
@ -170,6 +168,10 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
* 26 | GPS L1 C/A + GLONASS L1 C/A
* 27 | Galileo E1B + GLONASS L1 C/A
* 28 | GPS L2C + GLONASS L1 C/A
* 29 | GPS L1 C/A + GLONASS L2 C/A
* 30 | Galileo E1B + GLONASS L2 C/A
* 31 | GPS L2C + GLONASS L2 C/A
* 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a
*
*
* Skipped previous values to avoid overlapping

View File

@ -981,7 +981,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
}
else
{
if (d_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN].d_Toc != gps_eph->d_Toc)
if (d_pvt_solver->gps_ephemeris_map[gps_eph->i_satellite_PRN].d_Toe != gps_eph->d_Toe)
{
new_annotation = true;
}
@ -1068,7 +1068,7 @@ void rtklib_pvt_gs::msg_handler_telemetry(const pmt::pmt_t& msg)
}
else
{
if (d_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN].d_Toc != gps_cnav_ephemeris->d_Toc)
if (d_pvt_solver->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN].d_Toe1 != gps_cnav_ephemeris->d_Toe1)
{
new_annotation = true;
}
@ -1810,30 +1810,28 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
* 7 | GPS L1 C/A + GPS L2C
* 8 | GPS L1 C/A + GPS L5
* 9 | GPS L1 C/A + Galileo E1B
* 10 | GPS L1 C/A + Galileo E5a
* 11 | GPS L1 C/A + Galileo E5b
* 12 | Galileo E1B + GPS L2C
* 13 | Galileo E1B + GPS L5
* 14 | Galileo E1B + Galileo E5a
* 15 | Galileo E1B + Galileo E5b
* 16 | GPS L2C + GPS L5
* 17 | GPS L2C + Galileo E5a
* 18 | GPS L2C + Galileo E5b
* 19 | GPS L5 + Galileo E5a
* 20 | GPS L5 + Galileo E5b
* 21 | GPS L1 C/A + Galileo E1B + GPS L2C
* 22 | GPS L1 C/A + Galileo E1B + GPS L5
* 23 | GLONASS L1 C/A
* 24 | GLONASS L2 C/A
* 25 | GLONASS L1 C/A + GLONASS L2 C/A
* 26 | GPS L1 C/A + GLONASS L1 C/A
* 27 | Galileo E1B + GLONASS L1 C/A
* 28 | GPS L2C + GLONASS L1 C/A
* 29 | GPS L1 C/A + GLONASS L2 C/A
* 30 | Galileo E1B + GLONASS L2 C/A
* 31 | GPS L2C + GLONASS L2 C/A
* 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a
*/
* 10 | GPS L1 C/A + Galileo E5a
* 11 | GPS L1 C/A + Galileo E5b
* 12 | Galileo E1B + GPS L2C
* 13 | Galileo E5a + GPS L5
* 14 | Galileo E1B + Galileo E5a
* 15 | Galileo E1B + Galileo E5b
* 16 | GPS L2C + GPS L5
* 17 | GPS L2C + Galileo E5a
* 18 | GPS L2C + Galileo E5b
* 21 | GPS L1 C/A + Galileo E1B + GPS L2C
* 22 | GPS L1 C/A + Galileo E1B + GPS L5
* 23 | GLONASS L1 C/A
* 24 | GLONASS L2 C/A
* 25 | GLONASS L1 C/A + GLONASS L2 C/A
* 26 | GPS L1 C/A + GLONASS L1 C/A
* 27 | Galileo E1B + GLONASS L1 C/A
* 28 | GPS L2C + GLONASS L1 C/A
* 29 | GPS L1 C/A + GLONASS L2 C/A
* 30 | Galileo E1B + GLONASS L2 C/A
* 31 | GPS L2C + GLONASS L2 C/A
* 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a
*/
// ####################### RINEX FILES #################
if (b_rinex_output_enabled)
@ -1856,7 +1854,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())
{
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second);
rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map);
b_rinex_header_written = true; // do not write header anymore
}
@ -1913,7 +1911,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
{
std::string signal("1C 2S");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second);
rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_cnav_ephemeris_map);
b_rinex_header_written = true; // do not write header anymore
}
@ -1923,7 +1921,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
{
std::string signal("1C L5");
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second);
rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map);
b_rinex_header_written = true; // do not write header anymore
}
@ -2026,7 +2024,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
}
if (d_rinex_version == 2)
{
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second);
rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map);
rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map);
@ -2067,7 +2065,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
}
if (d_rinex_version == 2)
{
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model);
rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, gps_ephemeris_iter->second);
rp->rinex_nav_header(rp->navGloFile, d_pvt_solver->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map);
rp->log_rinex_nav(rp->navGloFile, d_pvt_solver->glonass_gnav_ephemeris_map);
@ -2160,12 +2158,12 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if (gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend())
{
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map);
}
if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono);
b_rinex_header_updated = true;
if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second);
b_rinex_header_updated = true;
}
}
break;
case 2: // GPS L2C only
@ -2232,32 +2230,32 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()))
{
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
}
if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono);
b_rinex_header_updated = true;
if (!b_rinex_header_updated and (d_pvt_solver->gps_utc_model.d_A0 != 0))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second);
b_rinex_header_updated = true;
}
}
break;
case 8: // L1+L5
if ((gps_ephemeris_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend()))
{
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
}
if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0)))
{
if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)
if (!b_rinex_header_updated and ((d_pvt_solver->gps_cnav_utc_model.d_A0 != 0) or (d_pvt_solver->gps_utc_model.d_A0 != 0)))
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono);
if (d_pvt_solver->gps_cnav_utc_model.d_A0 != 0)
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_cnav_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_cnav_utc_model, d_pvt_solver->gps_cnav_iono);
}
else
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono, gps_ephemeris_iter->second);
}
b_rinex_header_updated = true;
}
else
{
rp->update_obs_header(rp->obsFile, d_pvt_solver->gps_utc_model);
rp->update_nav_header(rp->navFile, d_pvt_solver->gps_utc_model, d_pvt_solver->gps_iono);
}
b_rinex_header_updated = true;
}
break;
case 9: // GPS L1 C/A + Galileo E1B

View File

@ -1315,7 +1315,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& ion
}
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model)
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model, const Gps_Ephemeris& eph)
{
std::string line;
@ -1436,7 +1436,28 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019
if (eph.i_GPS_week < 512)
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 2048), 9); // valid from 2019 to 2029
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2019 to 2029
}
}
else
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 9); // valid from 2019 to 2029
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019
}
}
line += std::string(1, ' ');
line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20);
}
@ -1447,7 +1468,28 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019
if (eph.i_GPS_week < 512)
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 2048), 5); // valid from 2019 to 2029
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029
}
}
else
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 5); // valid from 2009 to 2019
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
}
}
/* if ( SBAS )
{
line += string(1, ' ');
@ -2027,7 +2069,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
}
void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& iono)
void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& iono, const Gps_Ephemeris& eph)
{
std::vector<std::string> data;
std::string line_aux;
@ -2077,7 +2119,15 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 9); // valid until 2019
if (eph.i_GPS_week < 512)
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 9); // valid from 2019 to 2029
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019
}
line_aux += std::string(1, ' ');
line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20);
data.push_back(line_aux);
@ -2132,7 +2182,14 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + 1024), 5); // valid until 2019
if (eph.i_GPS_week < 512)
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
}
line_aux += std::string(10, ' ');
line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
data.push_back(line_aux);
@ -2942,6 +2999,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M
std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl;
}
void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps_Ephemeris>& eph_map)
{
std::string line;
@ -3180,7 +3238,20 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
line += std::string(1, ' ');
line += Rinex_Printer::doub2for(static_cast<double>(gps_ephemeris_iter->second.i_code_on_L2), 18, 2);
line += std::string(1, ' ');
auto GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm)
double GPS_week_continuous_number;
if (gps_ephemeris_iter->second.i_GPS_week < 512)
{
GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 2048); // valid until 2029
}
else
{
GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm)
}
// This week goes with Toe. This is different from the GPS week in the original satellite message!
if (gps_ephemeris_iter->second.d_Toe < 7200.0)
{
GPS_week_continuous_number += 1;
}
line += Rinex_Printer::doub2for(GPS_week_continuous_number, 18, 2);
line += std::string(1, ' ');
line += Rinex_Printer::doub2for(static_cast<double>(gps_ephemeris_iter->second.i_code_on_L2), 18, 2);
@ -3191,7 +3262,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
Rinex_Printer::lengthCheck(line);
out << line << std::endl;
// -------- BROADCAST ORBIT - 6
line.clear();
if (version == 2)
@ -3226,9 +3296,14 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
{
line += std::string(5, ' ');
}
line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_TOW, 18, 2);
double tx_time_of_message = gps_ephemeris_iter->second.d_TOW;
if (gps_ephemeris_iter->second.d_Toe < 7200.0)
{
tx_time_of_message -= 604800.0; // see RINEX 3.03 section 6.13
}
line += Rinex_Printer::doub2for(tx_time_of_message, 18, 2);
line += std::string(1, ' ');
double curve_fit_interval = 4;
int curve_fit_interval = 4;
if (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIA")
{
@ -3278,7 +3353,14 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
curve_fit_interval = 26;
}
}
line += Rinex_Printer::doub2for(curve_fit_interval, 18, 2);
if (curve_fit_interval == 4)
{
line += Rinex_Printer::doub2for(0.0, 18, 2);
}
else
{
line += Rinex_Printer::doub2for(1.0, 18, 2);
}
line += std::string(1, ' ');
line += std::string(18, ' '); // spare
line += std::string(1, ' ');
@ -11113,23 +11195,22 @@ boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& ep
// The RINEX v2.11 v3.00 format uses GPS time for the observations epoch, not UTC time, thus, no leap seconds needed here.
// (see Section 3 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt)
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex300.pdf)
// --??? No time correction here, since it will be done in the RINEX processor
const double gps_t = obs_time;
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((gps_t + 604800 * static_cast<double>(eph.i_GPS_week % 1024)) * 1000));
if (obs_time < 18)
// No time correction here, since it will be done in the PVT processor
boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast<int64_t>((obs_time + 604800 * static_cast<double>(eph.i_GPS_week % 1024)) * 1000));
// Handle TOW rollover
if (obs_time < 18.0)
{
t += boost::posix_time::seconds(604800);
}
// Handle week rollover (valid from 2009 to 2029)
if (eph.i_GPS_week < 512)
{
boost::posix_time::ptime p_time(boost::gregorian::date(2019, 4, 7), t);
return p_time;
}
else
{
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
return p_time;
}
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
return p_time;
}

View File

@ -107,7 +107,7 @@ public:
/*!
* \brief Generates the GPS L1 C/A Navigation Data header
*/
void rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model);
void rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model, const Gps_Ephemeris& eph);
/*!
* \brief Generates the GPS L2C(M) Navigation Data header
@ -382,7 +382,7 @@ public:
*/
//void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message);
void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono);
void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono, const Gps_Ephemeris& eph);
void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono);