Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.2.4 release candidate 1 #175

Merged
merged 26 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cd1dda6
inicial changes to support wgs84
rogerfraser Sep 17, 2021
5ef9c7e
Update vcxproj files to use Intel OneAPI MKL headers and libraries
rogerfraser Oct 7, 2021
842fa9d
Update vcxproj files to use Intel OneAPI MKL headers and libraries
rogerfraser Jan 30, 2022
6419dd1
Merge branch 'icsm-au:master' into wgs84
rogerfraser Jan 31, 2022
ffae543
inicial changes to support wgs84
rogerfraser Sep 17, 2021
8293270
Merge branch 'wgs84' of https://github.com/rogerfraser/DynAdjust into…
rogerfraser Feb 1, 2022
a981848
Further changes to support wgs84 and MWE
rogerfraser Feb 2, 2022
8b3e592
[skip-ci] Add sample WGS84 frame substitutions file
rogerfraser Feb 2, 2022
e2b590d
Comment on how to handle no 'do' date
rogerfraser Feb 2, 2022
a680b12
Further changes to handle WGS84
rogerfraser Feb 17, 2022
c7b1a2f
Remove frame substitutions file
rogerfraser Feb 17, 2022
08da042
Add WGS 84 aliases for WGS84
rogerfraser Feb 18, 2022
ff76ccd
Add functionality to log reference frame substitutions
rogerfraser Feb 20, 2022
9071a36
Further changes to support handling wgs84
rogerfraser Mar 2, 2022
d229f10
Further changes to support WGS84
rogerfraser Mar 7, 2022
d755f74
Return a valid epoch with WGS84 ensemble if supplied
rogerfraser Mar 7, 2022
0739e2d
Reorder member initialisation
rogerfraser Mar 7, 2022
5571725
Update Users Guide with WGS84 support
rogerfraser Mar 7, 2022
224a7b8
Add capability to export epoch as empty string
rogerfraser Mar 8, 2022
064717e
Add source file to plot build
rogerfraser Mar 8, 2022
e8511b6
Add dnaprocessfuncs.cpp to dnaplot cmake build
rogerfraser Mar 8, 2022
cc7f050
Merge branch 'wgs84'
rogerfraser Mar 8, 2022
c331efb
Update version to 1.2.4
rogerfraser Mar 8, 2022
818fd7f
Update User Guide
rogerfraser Mar 8, 2022
3e1d75e
Remove unnecessary header causing conflict for vs2019
rogerfraser Mar 8, 2022
1dab954
Change solution filename to reflect version
rogerfraser Mar 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dynadjust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.0)

project (dynadjust)

set (DYNADJUST_VERSION "1.2.2")
set (DYNADJUST_VERSION "1.2.4")

if (BUILD_TESTING)
enable_testing()
Expand Down
3 changes: 3 additions & 0 deletions dynadjust/dynadjust/dnaadjust/dnaadjust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13942,6 +13942,9 @@ void dna_adjust::SetDefaultReferenceFrame()
// * If dnareftran has been run, every station and measurement record will
// have been transformed to the one frame and epoch. These reference frame
// records will be consistent with the bst/bms_meta.
// * If the user has not specified an epoch with WGS84, then the epoch will
// be set to "time immemorial" being 01.01.1900. Any occurrence of this will
// cause output to be set to an empty string ("").
try {
// Load binary stations data. Throws runtime_error on failure.
dna_io_bst bst;
Expand Down
55 changes: 42 additions & 13 deletions dynadjust/dynadjust/dnaimport/dnainterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ void dna_import::UpdateEpoch(const vifm_t* vinput_file_meta)
// Do nothing
return;

if (dateFromString<date>(epoch) == timeImmemorial<date>())
epoch = "";

m_strProjectDefaultEpoch = epoch;

// Set default epoch
Expand Down Expand Up @@ -223,6 +226,9 @@ void dna_import::InitialiseDatum(const string& reference_frame)
m_strProjectDefaultEpsg = datum_.GetEpsgCode_s();
m_strProjectDefaultEpoch = datum_.GetEpoch_s();

if (datum_.GetEpoch() == timeImmemorial<date>())
m_strProjectDefaultEpoch = "";

// Update binary file meta
// Note: the following rule applies each time a new file is loaded:
// * This method (InitialiseDatum) is called (from dnaimportwrapper) before any files are loaded
Expand Down Expand Up @@ -1196,7 +1202,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
import_file_mutex.unlock();
}
catch (const runtime_error& e) {
SignalExceptionParse(static_cast<string>(e.what()), 0);
throw XMLInteropException(e.what(), 0);
}

// Station file
Expand All @@ -1221,14 +1227,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
}
stringstream ss;
ss << "ParseDNA(): An ios_base failure was encountered when attempting to read stations file " << fileName << "." << endl << " " << f.what();
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
catch (const XMLInteropException& f) {
stringstream ss;
ss << " - line " << m_lineNo;
ss << ", column " << m_columnNo << endl;
ss << " - " << f.what();
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
catch (...) {
if (ifsInputFILE_->eof())
Expand All @@ -1239,7 +1245,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
}
stringstream ss;
ss << "ParseDNA(): An error was encountered when attempting to read stations file " << fileName << ".";
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
}
else if (idt == msr_data ||
Expand All @@ -1263,14 +1269,14 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
}
stringstream ss;
ss << "ParseDNA(): An ios_base failure was encountered when attempting to read measurements file " << fileName << "." << endl << " " << f.what();
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
catch (const XMLInteropException& f) {
stringstream ss;
ss << endl << " - line " << m_lineNo;
ss << ", column " << m_columnNo << endl;
ss << " - " << f.what();
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
catch (...) {
if (ifsInputFILE_->eof())
Expand All @@ -1283,7 +1289,7 @@ void dna_import::ParseDNA(const string& fileName, vdnaStnPtr* vStations, PUINT32
ss << "ParseDNA(): An error was encountered when attempting to read measurements file " << fileName << "." << endl;
ss << " - line " << m_lineNo;
ss << ", column " << m_columnNo << endl;
SignalExceptionParse(ss.str(), 0);
throw XMLInteropException(ss.str(), 0);
}
}
}
Expand Down Expand Up @@ -1312,7 +1318,6 @@ void dna_import::ParseDNASTN(vdnaStnPtr* vStations, PUINT32 stnCount, string* su

try {
getline((*ifsInputFILE_), sBuf);
stn_ptr.reset(new CDnaStation(datum_.GetName(), datum_.GetEpoch_s()));
}
catch (...) {
if (ifsInputFILE_->eof())
Expand Down Expand Up @@ -1342,6 +1347,9 @@ void dna_import::ParseDNASTN(vdnaStnPtr* vStations, PUINT32 stnCount, string* su
if (sBuf.compare(0, 1, "*") == 0)
continue;

// initialise new station
stn_ptr.reset(new CDnaStation(datum_.GetName(), datum_.GetEpoch_s()));

stn_ptr->SetfileOrder(g_fileOrder++);

// name
Expand Down Expand Up @@ -1953,7 +1961,17 @@ void dna_import::ParseDNAMSRGPSBaselines(string& sBuf, dnaMsrPtr& msr_ptr, bool
// Get the epoch from the file
tmp = ParseEpochValue(sBuf, "ParseDNAMSRGPSBaselines");

if (!tmp.empty())
if (tmp.empty())
{
if (isEpsgWGS84Ensemble(epsgCodeFromName<UINT32, string>(msr_ptr->GetReferenceFrame())))
{
// Set the cluster epoch
msr_ptr->SetEpoch("");
// Set the baseline epoch
bslTmp.SetEpoch("");
}
}
else
{
// Set the cluster epoch
msr_ptr->SetEpoch(tmp);
Expand Down Expand Up @@ -2176,7 +2194,17 @@ void dna_import::ParseDNAMSRGPSPoints(string& sBuf, dnaMsrPtr& msr_ptr, bool ign
// Get the epoch from the file
tmp = ParseEpochValue(sBuf, "ParseDNAMSRGPSPoints");

if (!tmp.empty())
if (tmp.empty())
{
if (isEpsgWGS84Ensemble(epsgCodeFromName<UINT32, string>(msr_ptr->GetReferenceFrame())))
{
// Set the cluster epoch
msr_ptr->SetEpoch("");
// Set the baseline epoch
pntTmp.SetEpoch("");
}
}
else
{
// Set the cluster epoch
msr_ptr->SetEpoch(tmp);
Expand Down Expand Up @@ -2389,6 +2417,7 @@ string dna_import::ParseAngularValue(const string& sBuf, const string& calling_f
{
string parsed_value, tmp;
double d;
UINT32 u;

// degrees value
try {
Expand All @@ -2402,10 +2431,10 @@ string dna_import::ParseAngularValue(const string& sBuf, const string& calling_f
// minutes value
try {
tmp = trimstr(sBuf.substr(dml_.msr_ang_m, dmw_.msr_ang_m));
d = DoubleFromString<double>(tmp);
if (d < 10 && tmp.at(0) != '0')
u = LongFromString<UINT32>(tmp);
if (u < 10)
parsed_value.append("0");
parsed_value.append(tmp);
parsed_value.append(StringFromT<UINT32>(u));
}
catch (...) {
SignalExceptionParseDNA(calling_function + "(): Could not extract minutes value from the record: ",
Expand Down
35 changes: 28 additions & 7 deletions dynadjust/dynadjust/dnaimportwrapper/dnaimportwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,9 @@ int ImportDataFiles(dna_import& parserDynaML, vdnaStnPtr* vStations, vdnaMsrPtr*
//
UINT32 stnCount(0), msrCount(0), clusterID(0);

// obtain the project reference frame
string epsgCode(epsgStringFromName<string>(p.i.reference_frame));

size_t pos = string::npos;
size_t strlen_arg = 0;
for_each(p.i.input_files.begin(), p.i.input_files.end(),
Expand Down Expand Up @@ -857,7 +860,6 @@ int ImportDataFiles(dna_import& parserDynaML, vdnaStnPtr* vStations, vdnaMsrPtr*

// Produce a warning if the input file's default reference frame
// is different to the project reference frame
string epsgCode(epsgStringFromName<string>(p.i.reference_frame));
string inputFileEpsg;
try {
inputFileEpsg = datumFromEpsgString<string>(input_file_meta.epsgCode);
Expand All @@ -870,7 +872,6 @@ int ImportDataFiles(dna_import& parserDynaML, vdnaStnPtr* vStations, vdnaMsrPtr*
{
stringstream ssEpsgWarning;


ssEpsgWarning << "- Warning: Input file reference frame (" << inputFileEpsg <<
") does not match the " << endl << " default reference frame.";
if (!p.g.quiet)
Expand Down Expand Up @@ -1288,6 +1289,14 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}

// obtain the project reference frame
UINT32 epsgCode(epsgCodeFromName<UINT32>(p.i.reference_frame));

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// start "total" time
cpu_timer time;


// Import discontinuity file and apply discontinuities
// Due to the structure and format of SINEX files, it is essential that
// discontinuities be parsed prior to reading any SINEX files.
Expand Down Expand Up @@ -1337,10 +1346,6 @@ int main(int argc, char* argv[])
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// start "total" time
cpu_timer time;

// Import network information based on a segmentation block?
if (p.i.import_block)
{
Expand Down Expand Up @@ -2376,7 +2381,23 @@ int main(int argc, char* argv[])
{
cout << "- Warning: some files were not parsed - please read the log file for more details." << endl;
imp_file << "- Warning: some files were not parsed - please read the log file for more details." << endl;
}
}

// Produce a warning if an ensemble is set as the default reference frame
if (isEpsgWGS84Ensemble(epsgCode))
{
stringstream ssEnsembleWarning;
ssEnsembleWarning << endl <<
"- Warning: The '" << p.i.reference_frame << "' reference frame set for this project refers to the" << endl <<
" \"World Geodetic System 1984 (WGS 84) ensemble\". The WGS 84 ensemble is" << endl <<
" only suitable for low accuracy (metre level) positioning and does not" << endl <<
" provide for precise transformations to other well-known reference frames." << endl <<
" To achieve reliable adjustment results from data on WGS 84, please refer" << endl <<
" to \"Configuring import options\" in the DynAdjust User's Guide." << endl;
if (!p.g.quiet)
cout << ssEnsembleWarning.str();
imp_file << ssEnsembleWarning.str();
}

milliseconds elapsed_time(milliseconds(time.elapsed().wall/MILLI_TO_NANO));
string time_message = formatedElapsedTime<string>(&elapsed_time, "+ Total file handling process took ");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>-n ps2 vic2ex.simult.adj.stn pseudo-driver-file-2.msr --simulate --geo geoidef.geo --export-dna</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>$(DIST)_git_issues\print-ignored-msrs</LocalDebuggerWorkingDirectory>
<LocalDebuggerCommandArguments>-n 09139test 09139.stn 09139.msr --export-dna -r "WGS84 (G730)"</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>$(DIST)_git_issues\wgs84</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
1 change: 1 addition & 0 deletions dynadjust/dynadjust/dnaplot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_library (${PROJECT_NAME} SHARED
${CMAKE_SOURCE_DIR}/include/parameters/dnaellipsoid.cpp
${CMAKE_SOURCE_DIR}/include/parameters/dnaprojection.cpp
${CMAKE_SOURCE_DIR}/include/functions/dnastringfuncs.cpp
${CMAKE_SOURCE_DIR}/include/functions/dnaprocessfuncs.cpp
${CMAKE_SOURCE_DIR}/include/math/dnamatrix_contiguous.cpp
${CMAKE_SOURCE_DIR}/include/measurement_types/dnamsrtally.cpp
${CMAKE_SOURCE_DIR}/include/measurement_types/dnastation.cpp
Expand Down
Loading