1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-04-01 16:27:03 +00:00

Add new conf parameter PVT.rinex_name to specify a custom name for generated RINEX files.

A command-line flag --RINEX_name, which overrides the configuration if defined, is also available
This commit is contained in:
Carles Fernandez 2020-02-25 14:43:15 +01:00
parent 72ecc9251a
commit 86a1dc5ca3
9 changed files with 34 additions and 18 deletions

View File

@ -26,6 +26,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- New PVT parameter enable_rx_clock_correction allows to enable or disable the continuous application of the Time solution correction (clock steering) to the computation of Observables. By default is set to false (that is, disabled).
- New PVT parameter max_clock_offset_ms: if PVT.enable_rx_clock_correction is set to false, this parameter sets the maximum allowed local clock offset with respect to the Time solution. If the estimated offset exceeds this parameter, a clock correction is applied to the computation of Observables.
- Fixed L5 and E5a receiver chains when tracking the data component.
- Added new PVT parameter rinex_name to specify a custom name of the generated RINEX files. A commandline flag --RINEX_name is also available, and overrides the configuration.
### Improvements in Interoperability:

View File

@ -98,6 +98,11 @@ Rtklib_Pvt::Rtklib_Pvt(ConfigurationInterface* configuration,
pvt_output_parameters.rinex_version = 2;
}
pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms);
pvt_output_parameters.rinex_name = configuration->property(role + ".rinex_name", std::string("-"));
if (FLAGS_RINEX_name != "-")
{
pvt_output_parameters.rinex_name = FLAGS_RINEX_name;
}
// RTCM Printer settings
pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);

View File

@ -341,7 +341,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
d_rinex_version = conf_.rinex_version;
if (b_rinex_output_enabled)
{
rp = std::make_shared<Rinex_Printer>(d_rinex_version, conf_.rinex_output_path);
rp = std::make_shared<Rinex_Printer>(d_rinex_version, conf_.rinex_output_path, conf_.rinex_name);
rp->set_pre_2009_file(conf_.pre_2009_file);
}
else

View File

@ -32,6 +32,7 @@ Pvt_Conf::Pvt_Conf()
max_obs_block_rx_clock_offset_ms = 40;
rinex_version = 0;
rinexobs_rate_ms = 0;
rinex_name = "-";
dump = false;
dump_mat = true;

View File

@ -37,6 +37,7 @@ public:
int32_t rinex_version;
int32_t rinexobs_rate_ms;
std::string rinex_name;
std::map<int, int> rtcm_msg_rate_ms;
bool dump;

View File

@ -75,7 +75,7 @@ namespace errorlib = boost::system;
#endif
Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path)
Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, const std::string& base_name)
{
pre_2009_file_ = false;
std::string base_rinex_path = base_path;
@ -108,13 +108,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path)
std::cout << "RINEX files will be stored at " << base_rinex_path << std::endl;
}
navfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV");
obsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS");
sbsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS");
navGalfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV");
navMixfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV");
navGlofilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV");
navBdsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_BDS_NAV");
navfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV", base_name);
obsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS", base_name);
sbsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_SBAS", base_name);
navGalfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GAL_NAV", base_name);
navMixfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_MIXED_NAV", base_name);
navGlofilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_GLO_NAV", base_name);
navBdsfilename = base_rinex_path + fs::path::preferred_separator + Rinex_Printer::createFilename("RINEX_FILE_TYPE_BDS_NAV", base_name);
Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::in | std::ios::app);
Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::in | std::ios::app);
@ -335,7 +335,7 @@ void Rinex_Printer::lengthCheck(const std::string& line)
}
std::string Rinex_Printer::createFilename(const std::string& type)
std::string Rinex_Printer::createFilename(const std::string& type, const std::string& base_name)
{
const std::string stationName = "GSDR"; // 4-character station name designator
boost::gregorian::date today = boost::gregorian::day_clock::local_day();
@ -365,7 +365,6 @@ std::string Rinex_Printer::createFilename(const std::string& type)
fileType.insert(std::pair<std::string, std::string>("RINEX_FILE_TYPE_SUMMARY", "S")); // S - Summary file (used e.g., by IGS, not a standard!).
fileType.insert(std::pair<std::string, std::string>("RINEX_FILE_TYPE_BDS_NAV", "F")); // G - GLONASS navigation file.
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
tm pt_tm = boost::posix_time::to_tm(pt);
int32_t local_hour = pt_tm.tm_hour;
@ -416,8 +415,15 @@ std::string Rinex_Printer::createFilename(const std::string& type)
std::string yearTag = strm3.str();
std::string typeOfFile = fileType[type];
std::string filename(stationName + dayOfTheYearTag + hourTag + minTag + "." + yearTag + typeOfFile);
std::string filename;
if (base_name == "-")
{
filename = stationName + dayOfTheYearTag + hourTag + minTag + "." + yearTag + typeOfFile;
}
else
{
filename = base_name + "." + yearTag + typeOfFile;
}
return filename;
}

View File

@ -78,7 +78,7 @@ public:
/*!
* \brief Default constructor. Creates GNSS Navigation and Observables RINEX files and their headers
*/
explicit Rinex_Printer(int version = 0, const std::string& base_path = ".");
explicit Rinex_Printer(int version = 0, const std::string& base_path = ".", const std::string& base_name = "-");
/*!
* \brief Default destructor. Closes GNSS Navigation and Observables RINEX files
@ -465,7 +465,7 @@ private:
* "RINEX_FILE_TYPE_SBAS" - SBAS broadcast data file.
* "RINEX_FILE_TYPE_CLK" - Clock file.
*/
std::string createFilename(const std::string& type);
std::string createFilename(const std::string& type, const std::string& base_name);
/*
* Generates the data for the PGM / RUN BY / DATE line

View File

@ -64,14 +64,16 @@ DEFINE_int32(max_lock_fail, 50, "Maximum number of code lock failures before dro
// cos(2xError_angle)=0.7 -> Error_angle=22 deg
DEFINE_double(carrier_lock_th, 0.7, "Carrier lock threshold (in rad).");
DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file.");
DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file).");
DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file).");
DEFINE_int32(carrier_smoothing_factor, DEFAULT_CARRIER_SMOOTHING_FACTOR, "Sets carrier smoothing factor M (overrides the configuration file)");
DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file.");
DEFINE_string(RINEX_name, "-", "If defined, specifies the RINEX files base name");
#if GFLAGS_GREATER_2_0
static bool ValidateC(const char* flagname, const std::string& value)

View File

@ -53,6 +53,6 @@ const int32_t DEFAULT_CARRIER_SMOOTHING_FACTOR = 200;
// Declare flags for PVT
DECLARE_string(RINEX_version); //!< If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file.
DECLARE_string(RINEX_name); //!< If defined, specifies the RINEX files base name
#endif