mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Add extraction of Galileo UTC and Galileo iono parameters from RINEX header
This commit is contained in:
parent
4bb13684aa
commit
5181c640a3
@ -32,6 +32,7 @@
|
||||
#ifndef GNSS_SDR_GALILEO_IONO_H_
|
||||
#define GNSS_SDR_GALILEO_IONO_H_
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5.1.6
|
||||
@ -61,6 +62,30 @@ public:
|
||||
* Default constructor
|
||||
*/
|
||||
Galileo_Iono();
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization.
|
||||
Here is used to save the iono data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("ai0_5", ai0_5);
|
||||
archive& make_nvp("ai1_5", ai1_5);
|
||||
archive& make_nvp("ai2_5", ai2_5);
|
||||
archive& make_nvp("Region1_flag_5", Region1_flag_5);
|
||||
archive& make_nvp("Region2_flag_5", Region2_flag_5);
|
||||
archive& make_nvp("Region3_flag_5", Region3_flag_5);
|
||||
archive& make_nvp("Region4_flag_5", Region4_flag_5);
|
||||
archive& make_nvp("Region5_flag_5", Region5_flag_5);
|
||||
archive& make_nvp("TOW_5", TOW_5);
|
||||
archive& make_nvp("WN_5", WN_5);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,6 +33,7 @@
|
||||
#ifndef GNSS_SDR_GALILEO_UTC_MODEL_H_
|
||||
#define GNSS_SDR_GALILEO_UTC_MODEL_H_
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
|
||||
/*!
|
||||
* \brief This class is a storage for the GALILEO UTC MODEL data as described in Galileo ICD
|
||||
@ -58,6 +59,28 @@ public:
|
||||
* Default constructor
|
||||
*/
|
||||
Galileo_Utc_Model();
|
||||
|
||||
template <class Archive>
|
||||
|
||||
/*!
|
||||
* \brief Serialize is a boost standard method to be called by the boost XML serialization.
|
||||
Here is used to save the UTC data on disk file.
|
||||
*/
|
||||
inline void serialize(Archive& archive, const unsigned int version)
|
||||
{
|
||||
using boost::serialization::make_nvp;
|
||||
if (version)
|
||||
{
|
||||
};
|
||||
archive& make_nvp("A0_6", A0_6);
|
||||
archive& make_nvp("A1_6", A1_6);
|
||||
archive& make_nvp("Delta_tLS_6", Delta_tLS_6);
|
||||
archive& make_nvp("t0t_6", t0t_6);
|
||||
archive& make_nvp("WNot_6", WNot_6);
|
||||
archive& make_nvp("WN_LSF_6", WN_LSF_6);
|
||||
archive& make_nvp("DN_6", DN_6);
|
||||
archive& make_nvp("Delta_tLSF_6", Delta_tLSF_6);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -32,6 +32,8 @@ include_directories(
|
||||
${GPSTK_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||
|
||||
add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
|
||||
target_link_libraries(rinex2assist
|
||||
@ -45,7 +47,6 @@ if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION})
|
||||
endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK)
|
||||
|
||||
|
||||
add_custom_command(TARGET rinex2assist POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:rinex2assist>
|
||||
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:rinex2assist>)
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "gps_ephemeris.h"
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "gps_utc_model.h"
|
||||
#include "gps_iono.h"
|
||||
#include <gflags/gflags.h>
|
||||
#include <gpstk/Rinex3NavHeader.hpp>
|
||||
#include <gpstk/Rinex3NavData.hpp>
|
||||
@ -49,30 +51,29 @@ int main(int argc, char** argv)
|
||||
"This program comes with ABSOLUTELY NO WARRANTY;\n" +
|
||||
"See COPYING file to see a copy of the General Public License.\n \n" +
|
||||
"Usage: \n" +
|
||||
" rinex2assist <RINEX Nav file input> [<XML file output>]");
|
||||
" rinex2assist <RINEX Nav file input>");
|
||||
|
||||
google::SetUsageMessage(intro_help);
|
||||
google::SetVersionString("1.0");
|
||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
||||
|
||||
if ((argc < 2) or (argc > 3))
|
||||
if ((argc != 2))
|
||||
{
|
||||
std::cerr << "Usage:" << std::endl;
|
||||
std::cerr << " " << argv[0]
|
||||
<< " <RINEX Nav file input> [<XML file output>]"
|
||||
<< " <RINEX Nav file input>"
|
||||
<< std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
std::string xml_filename;
|
||||
if (argc == 3)
|
||||
{
|
||||
xml_filename = argv[2];
|
||||
}
|
||||
|
||||
std::map<int, Gps_Ephemeris> eph_map;
|
||||
std::map<int, Galileo_Ephemeris> eph_gal_map;
|
||||
|
||||
Gps_Utc_Model gps_utc_model;
|
||||
Gps_Iono gps_iono;
|
||||
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
try
|
||||
@ -93,6 +94,31 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Collect UTC parameters from RINEX header
|
||||
if (hdr.fileSys.compare("G: (GPS)") == 0 || hdr.fileSys.compare("MIXED") == 0)
|
||||
{
|
||||
gps_utc_model.valid = (hdr.valid > 2147483648) ? true : false;
|
||||
gps_utc_model.d_A1 = hdr.mapTimeCorr["GPUT"].A0;
|
||||
gps_utc_model.d_A0 = hdr.mapTimeCorr["GPUT"].A1;
|
||||
gps_utc_model.d_t_OT = hdr.mapTimeCorr["GPUT"].refSOW;
|
||||
gps_utc_model.i_WN_T = hdr.mapTimeCorr["GPUT"].refWeek;
|
||||
gps_utc_model.d_DeltaT_LS = hdr.leapSeconds;
|
||||
gps_utc_model.i_WN_LSF = hdr.leapWeek;
|
||||
gps_utc_model.i_DN = hdr.leapDay;
|
||||
gps_utc_model.d_DeltaT_LSF = hdr.leapDelta;
|
||||
|
||||
// Collect iono parameters from RINEX header
|
||||
gps_iono.valid = (hdr.mapIonoCorr["GPSA"].param[0] == 0) ? false : true;
|
||||
gps_iono.d_alpha0 = hdr.mapIonoCorr["GPSA"].param[0];
|
||||
gps_iono.d_alpha1 = hdr.mapIonoCorr["GPSA"].param[1];
|
||||
gps_iono.d_alpha2 = hdr.mapIonoCorr["GPSA"].param[2];
|
||||
gps_iono.d_alpha3 = hdr.mapIonoCorr["GPSA"].param[3];
|
||||
gps_iono.d_beta0 = hdr.mapIonoCorr["GPSB"].param[0];
|
||||
gps_iono.d_beta1 = hdr.mapIonoCorr["GPSB"].param[1];
|
||||
gps_iono.d_beta2 = hdr.mapIonoCorr["GPSB"].param[2];
|
||||
gps_iono.d_beta3 = hdr.mapIonoCorr["GPSB"].param[3];
|
||||
}
|
||||
|
||||
// Read navigation data
|
||||
while (rnffs >> rne)
|
||||
{
|
||||
@ -185,7 +211,7 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Write XML
|
||||
// Write XML ephemeris
|
||||
if (i != 0)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
@ -201,10 +227,11 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Problem creating the XML file: " << e.what() << std::endl;
|
||||
std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Generated file: " << xml_filename << std::endl;
|
||||
}
|
||||
if (j != 0)
|
||||
{
|
||||
@ -218,11 +245,53 @@ int main(int argc, char** argv)
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Problem creating the XML file: " << e.what() << std::endl;
|
||||
std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Generated file: " << xml_filename << std::endl;
|
||||
}
|
||||
|
||||
// Write XML UTC
|
||||
if (gps_utc_model.valid)
|
||||
{
|
||||
std::ofstream ofs3;
|
||||
xml_filename = "gps_UTC.xml";
|
||||
try
|
||||
{
|
||||
ofs3.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out);
|
||||
boost::archive::xml_oarchive xml(ofs3);
|
||||
xml << boost::serialization::make_nvp("GNSS-SDR_gps_utc", gps_utc_model);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Generated file: " << xml_filename << std::endl;
|
||||
}
|
||||
|
||||
// Write XML iono
|
||||
if (gps_iono.valid)
|
||||
{
|
||||
std::ofstream ofs4;
|
||||
xml_filename = "gps_iono.xml";
|
||||
try
|
||||
{
|
||||
ofs4.open(xml_filename.c_str(), std::ofstream::trunc | std::ofstream::out);
|
||||
boost::archive::xml_oarchive xml(ofs4);
|
||||
xml << boost::serialization::make_nvp("GNSS-SDR_gps_iono", gps_iono);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Problem creating the XML file " << xml_filename << ": " << e.what() << std::endl;
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 1;
|
||||
}
|
||||
std::cout << "Generated file: " << xml_filename << std::endl;
|
||||
}
|
||||
|
||||
google::ShutDownCommandLineFlags();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user