From ed072563c6fce5b4203712894b35bb1e5cdc48b3 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Wed, 30 Jul 2025 19:42:01 +0200 Subject: [PATCH 01/33] add spotgins enu --- CODE/matlab/readfmtdata.m | 2 +- CODE/matlab/readfmtdata_gnss.m | 54 +++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/readfmtdata.m b/CODE/matlab/readfmtdata.m index 8964f22b..2bee1e41 100644 --- a/CODE/matlab/readfmtdata.m +++ b/CODE/matlab/readfmtdata.m @@ -65,7 +65,7 @@ case {'miniseed','seedlink','arclink','combined','fdsnws-dataselect'} D(n) = readfmtdata_miniseed(WO,P,N(n),F); - case {'globkval','gipsy','gipsyx','gipsy-tdp','usgs-rneu','ies-neu','ogc-neu','ingv-gps','sbe37-ascii','spotgins-ippp','gamit-pos','pbogps-pos'} + case {'globkval','gipsy','gipsyx','gipsy-tdp','usgs-rneu','ies-neu','ogc-neu','ingv-gps','sbe37-ascii','spotgins-enu','spotgins-ippp','gamit-pos','pbogps-pos'} D(n) = readfmtdata_gnss(WO,P,N(n),F); case {'hyp71sum2k','fdsnws-event','scevtlog-xml'} diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 08d5cc47..d8765d3b 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -34,7 +34,10 @@ % data format: extract from SmoothFinal.tdp output file (grep "Station.SSSS.State.pos.[XYZ]" lines) % node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) % -% format 'gins-ippp' +% format 'spotgins-enu' +% ***** complete me ****** +% +% format 'spotgins-ippp' % type: GINS IPPP solutions % filename/url: P.RAWDATA (use $FID to point the right file/url) % data format: yyyymmdd hhmmss yyyy.yyyyyyyyy jjjjj.jj X Y Z dX dY dZ E N V dE dN dV @@ -300,8 +303,57 @@ end %D.ITRF_YEAR = 'ITRF08'; + +% ----------------------------------------------------------------------------- +case 'spotgins-enu' + % format exemple + %#jjjjj.jjjjjjjj _____E _____N _____U ____dE ____dN ____dU yyyymmddHHMMSS yyyy.yyyyyyy Const Dateofexe GinsVersion + % 52670.83876160 0.055822 0.051638 0.005578 0.001263 0.001163 0.004899 20030131200749 2003.0844898 G 250404_185253 VALIDE_24_2 + % 52671.50195600 0.057207 0.054240 -0.004722 0.000705 0.000619 0.002600 20030201120249 2003.0863067 G 250404_185253 VALIDE_24_2 + + fdat = sprintf('%s/%s.dat',F.ptmp,N.ID); + wosystem(sprintf('rm -f %s',fdat),P); + for a = 1:length(F.raw) + fraw = F.raw{a}; + #cmd0 = sprintf('awk ''/^[^!]/ {print}'' >> %s',fdat); % removes header lines + cmd0 = sprintf('awk ''/^[^#]/ {print}'' >> %s',fdat); % removes header lines + if strncmpi('http',fraw,4) + s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); + if s ~= 0 + break; + end + else + s = wosystem(sprintf('cat %s | %s',fraw,cmd0),P); + end + if s ~= 0 + fprintf('%s: ** WARNING ** Raw data "%s" not found.\n',wofun,fraw); + end + end + + + % load the file + if exist(fdat,'file') + dd = load(fdat); + else + dd = []; + end + if ~isempty(dd) + t = dd(:,1) + 678941.5007; % converts MJD to datenum + d = [dd(:,2:4),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit + e = dd(:,5:7); + e(e Date: Wed, 30 Jul 2025 23:21:22 +0200 Subject: [PATCH 02/33] add spotgins enu --- CODE/etc/rawformats.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/CODE/etc/rawformats.conf b/CODE/etc/rawformats.conf index 7668091e..fc063fb0 100644 --- a/CODE/etc/rawformats.conf +++ b/CODE/etc/rawformats.conf @@ -22,6 +22,7 @@ winston|EARTHWORM|EarthWorm Winston Wave Server data request||host:port gipsy|GNSS|JPL GIPSY-OASIS .tdp file|ANTENNA,RECEIVER,XYZ|fullpath of root directory containing YYYY/FID/*.tdp files gipsyx|GNSS|JPL GipsyX .tdp file|ANTENNA,RECEIVER,XYZ|fullpath of root directory containing YYYY/FID/*.tdp files globkval|GNSS|MIT GAMIT/GLOBK VAL file||fullpath of directory containing the .VAL file +spotgins-enu|GNSS|SPOTGINS IPPP time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file spotgins-ippp|GNSS|SPOTGINS IPPP time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file gamit-pos|GNSS|MIT GAMIT/GLOBL POS time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file pbogps-pos|GNSS|PBO GPS POS time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file From 82ba53fa1379c71d42ab54b126ec5b2037d365a2 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Thu, 31 Jul 2025 16:25:49 +0200 Subject: [PATCH 03/33] change load for dlmread --- CODE/matlab/readfmtdata_gnss.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index d8765d3b..d6a6b2dd 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -315,7 +315,6 @@ wosystem(sprintf('rm -f %s',fdat),P); for a = 1:length(F.raw) fraw = F.raw{a}; - #cmd0 = sprintf('awk ''/^[^!]/ {print}'' >> %s',fdat); % removes header lines cmd0 = sprintf('awk ''/^[^#]/ {print}'' >> %s',fdat); % removes header lines if strncmpi('http',fraw,4) s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); @@ -333,13 +332,13 @@ % load the file if exist(fdat,'file') - dd = load(fdat); + dd = dlmread(fdat); else dd = []; end if ~isempty(dd) t = dd(:,1) + 678941.5007; % converts MJD to datenum - d = [dd(:,2:4),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit + d = [dd(:,2:4),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit e = dd(:,5:7); e(e Date: Thu, 31 Jul 2025 16:56:24 +0200 Subject: [PATCH 04/33] spotgins-enu-v2 --- CODE/etc/rawformats.conf | 2 +- CODE/matlab/readfmtdata_gnss.m | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CODE/etc/rawformats.conf b/CODE/etc/rawformats.conf index fc063fb0..5755fa24 100644 --- a/CODE/etc/rawformats.conf +++ b/CODE/etc/rawformats.conf @@ -22,7 +22,7 @@ winston|EARTHWORM|EarthWorm Winston Wave Server data request||host:port gipsy|GNSS|JPL GIPSY-OASIS .tdp file|ANTENNA,RECEIVER,XYZ|fullpath of root directory containing YYYY/FID/*.tdp files gipsyx|GNSS|JPL GipsyX .tdp file|ANTENNA,RECEIVER,XYZ|fullpath of root directory containing YYYY/FID/*.tdp files globkval|GNSS|MIT GAMIT/GLOBK VAL file||fullpath of directory containing the .VAL file -spotgins-enu|GNSS|SPOTGINS IPPP time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file +spotgins-enu-v2|GNSS|SPOTGINS solutions - version 2 (<2025-08)||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file spotgins-ippp|GNSS|SPOTGINS IPPP time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file gamit-pos|GNSS|MIT GAMIT/GLOBL POS time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file pbogps-pos|GNSS|PBO GPS POS time series||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index d6a6b2dd..05c83645 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -34,8 +34,11 @@ % data format: extract from SmoothFinal.tdp output file (grep "Station.SSSS.State.pos.[XYZ]" lines) % node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) % -% format 'spotgins-enu' -% ***** complete me ****** +% format 'spotgins-enu-v2' +% type: SPOTGINS solutions - version 2 (<2025-08) +% filename/url: P.RAWDATA (use $FID to point the right file/url) +% data format: jjjjj.jj E N V dE dN dV yyyymmddhhmmss yyyy.yyyyyyyyy +% node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) % % format 'spotgins-ippp' % type: GINS IPPP solutions @@ -305,7 +308,7 @@ % ----------------------------------------------------------------------------- -case 'spotgins-enu' +case 'spotgins-enu-v2' % format exemple %#jjjjj.jjjjjjjj _____E _____N _____U ____dE ____dN ____dU yyyymmddHHMMSS yyyy.yyyyyyy Const Dateofexe GinsVersion % 52670.83876160 0.055822 0.051638 0.005578 0.001263 0.001163 0.004899 20030131200749 2003.0844898 G 250404_185253 VALIDE_24_2 From 2cf1a569df61c67ff81d84c7a998078b4a8ed5dc Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:15:53 +0200 Subject: [PATCH 05/33] Add metadata structure for GNSS node details in export --- CODE/matlab/superprocs/gnss.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index a07a03b3..ffcbe7dc 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -653,6 +653,21 @@ E.header = [E.header,{'East_treat(m)','North_treat(m)','Up_treat(m)'}]; end E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); + + E.meta = struct( ... + 'NODE_FID',N(kn(s)).FID, ... + 'NODE_NAME',N(kn(s)).NAME, ... + 'NODE_GNSS_9CHAR',N(kn(s)).GNSS_9CHAR, ... + 'NODE_LATITUDE',sprintf('%1.6f',N(kn(s)).LAT_WGS84), ... + 'NODE_LONGITUDE',sprintf('%1.6f',N(kn(s)).LON_WGS84), ... + 'NODE_ELEVATION',sprintf('%1.2f',N(kn(s)).ALTITUDE), ... + 'PROC_ITRF_REF',sprintf('%s',any2str(P.ITRF_REF)) ... + 'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... + ); + if vrelmode + E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); + end + mkexport(WO,sprintf('%s_%s',N(n).ID,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); end end From eed997079bb8ae828e318627113fff9e1a9f101a Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:47:19 +0200 Subject: [PATCH 06/33] Add warning messages for unknown formats in readfmtdata function --- CODE/matlab/readfmtdata.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODE/matlab/readfmtdata.m b/CODE/matlab/readfmtdata.m index 37b947d1..33cd49d2 100644 --- a/CODE/matlab/readfmtdata.m +++ b/CODE/matlab/readfmtdata.m @@ -99,7 +99,8 @@ D(n) = readfmtdata_mc3(WO,P,N(n),F); otherwise - D(n).t = []; + fprintf('%s: ** WARNING ** unknown format "%s", will try to read it anyway...\n',wofun,F.fmt); + D(n).t = []; [D(n).d,D(n).CLB] = calib([],[],N(n).CLB); D(n).e = ones(size(D(n).d)); fprintf('%s: ** WARNING ** unknown format "%s". Nothing to do!\n',wofun,F.fmt); From 041fa257a7768c91a3f2e59cf67f3ab6a4ecfd40 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:48:08 +0200 Subject: [PATCH 07/33] Fix formatting in GNSS output for ITRF reference --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index ffcbe7dc..f324c989 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,7 +661,7 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(kn(s)).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(kn(s)).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(kn(s)).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(P.ITRF_REF)) ... + 'PROC_ITRF_REF',sprintf('%s',any2str(P.ITRF_REF)), ... 'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... ); if vrelmode From 4d9cd173999ed0d40338963b7056eeeb563f9fce Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:48:44 +0200 Subject: [PATCH 08/33] Add 'spotgins-enu-v2' format to GNSS data reading cases --- CODE/matlab/readfmtdata.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/readfmtdata.m b/CODE/matlab/readfmtdata.m index 33cd49d2..b553e83f 100644 --- a/CODE/matlab/readfmtdata.m +++ b/CODE/matlab/readfmtdata.m @@ -65,7 +65,7 @@ case {'miniseed','seedlink','arclink','combined','fdsnws-dataselect'} D(n) = readfmtdata_miniseed(WO,P,N(n),F); - case {'globkval','gipsy','gipsyx','gipsy-tdp','usgs-rneu','ies-neu','ogc-neu','ingv-gps','sbe37-ascii','spotgins-enu','spotgins-ippp','gamit-pos','pbogps-pos'} + case {'globkval','gipsy','gipsyx','gipsy-tdp','usgs-rneu','ies-neu','ogc-neu','ingv-gps','sbe37-ascii','spotgins-enu-v2','spotgins-ippp','gamit-pos','pbogps-pos'} D(n) = readfmtdata_gnss(WO,P,N(n),F); case {'hyp71sum2k','fdsnws-event','scevtlog-xml'} From f245b045d976d1d1fcc936521df4d7c2052d9993 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:53:59 +0200 Subject: [PATCH 09/33] Fix uistack call to check for function existence before execution --- CODE/matlab/plotorbit.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CODE/matlab/plotorbit.m b/CODE/matlab/plotorbit.m index d5307bfd..2ca399c3 100644 --- a/CODE/matlab/plotorbit.m +++ b/CODE/matlab/plotorbit.m @@ -19,7 +19,9 @@ if size(d,2) > 1 set(gca,'Ylim',get(gca,'YLim')) % freezes Y axis (error bars can overflow) h = plot(repmat(t,[1,2])',(repmat(d(:,1),[1,2])+d(:,2)*[-1,1])','-','LineWidth',.1,'Color',.6*[1,1,1]); - uistack(h,'bottom') + if exist('uistack','file') == 2 + uistack(h,'bottom') + end end % overwrites non-final orbits From 75bcebed0f8c8baca1279c09ac47bbf45a6ce949 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:56:03 +0200 Subject: [PATCH 10/33] Refactor uistack handling to include Octave compatibility for error bars --- CODE/matlab/plotorbit.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CODE/matlab/plotorbit.m b/CODE/matlab/plotorbit.m index 2ca399c3..7b55c86c 100644 --- a/CODE/matlab/plotorbit.m +++ b/CODE/matlab/plotorbit.m @@ -19,8 +19,14 @@ if size(d,2) > 1 set(gca,'Ylim',get(gca,'YLim')) % freezes Y axis (error bars can overflow) h = plot(repmat(t,[1,2])',(repmat(d(:,1),[1,2])+d(:,2)*[-1,1])','-','LineWidth',.1,'Color',.6*[1,1,1]); - if exist('uistack','file') == 2 + if exist('uistack','file') == 2 % checks if uistack function exists, (only MATLAB, not octave compatible) uistack(h,'bottom') + else % Octave equivalent + set(h, 'HandleVisibility', 'off'); + axes_children = get(gca, 'Children'); + other_children = setdiff(axes_children, h); + set(gca, 'Children', [other_children; h]); + set(h, 'HandleVisibility', 'on'); end end From 2885082a2304b0640b6e8c58da7adb7ef492653e Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 15:56:57 +0200 Subject: [PATCH 11/33] Remove Octave equivalent handling for uistack in plotorbit function --- CODE/matlab/plotorbit.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CODE/matlab/plotorbit.m b/CODE/matlab/plotorbit.m index 7b55c86c..c65b4baf 100644 --- a/CODE/matlab/plotorbit.m +++ b/CODE/matlab/plotorbit.m @@ -21,12 +21,6 @@ h = plot(repmat(t,[1,2])',(repmat(d(:,1),[1,2])+d(:,2)*[-1,1])','-','LineWidth',.1,'Color',.6*[1,1,1]); if exist('uistack','file') == 2 % checks if uistack function exists, (only MATLAB, not octave compatible) uistack(h,'bottom') - else % Octave equivalent - set(h, 'HandleVisibility', 'off'); - axes_children = get(gca, 'Children'); - other_children = setdiff(axes_children, h); - set(gca, 'Children', [other_children; h]); - set(h, 'HandleVisibility', 'on'); end end From 801f9ddbef2b538130a3566f0f09112933183c4a Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:00:48 +0200 Subject: [PATCH 12/33] Fix metadata assignment in GNSS processing for correct node reference --- CODE/matlab/superprocs/gnss.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index f324c989..4731364a 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -655,12 +655,12 @@ E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); E.meta = struct( ... - 'NODE_FID',N(kn(s)).FID, ... - 'NODE_NAME',N(kn(s)).NAME, ... - 'NODE_GNSS_9CHAR',N(kn(s)).GNSS_9CHAR, ... - 'NODE_LATITUDE',sprintf('%1.6f',N(kn(s)).LAT_WGS84), ... - 'NODE_LONGITUDE',sprintf('%1.6f',N(kn(s)).LON_WGS84), ... - 'NODE_ELEVATION',sprintf('%1.2f',N(kn(s)).ALTITUDE), ... + 'NODE_FID',N(n).FID, ... + 'NODE_NAME',N(n).NAME, ... + 'NODE_GNSS_9CHAR',N(n).GNSS_9CHAR, ... + 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... + 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... + 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... 'PROC_ITRF_REF',sprintf('%s',any2str(P.ITRF_REF)), ... 'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... ); From 0eb87f975b3de8acb91ee5bc3bbbf7e73a74fb84 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:03:49 +0200 Subject: [PATCH 13/33] Update ITRF reference formatting in GNSS processing and remove commented velocity reference --- CODE/matlab/superprocs/gnss.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 4731364a..b6ca001e 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,9 +661,12 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(P.ITRF_REF)), ... - 'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... + 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + %'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... ); + + + if vrelmode E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); end From e990c31a533c10e71233d0b0f872b0eb016ecd18 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:04:43 +0200 Subject: [PATCH 14/33] Fix formatting of ITRF reference output in GNSS processing --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index b6ca001e..a7547c02 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,7 +661,7 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))) ... %'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... ); From 939e420f86a2b3f6fd0fc730a5433e631c95b05e Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:06:27 +0200 Subject: [PATCH 15/33] Fix velocity reference formatting in GNSS processing --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index a7547c02..200e59da 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -662,7 +662,7 @@ 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))) ... - %'PROC_VELOCITY_REF',sprintf('%s',any2str(P.VELOCITY_REF)) ... + 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ); From 92adc27809c1c3e42a204326a572adf701a0208c Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:07:00 +0200 Subject: [PATCH 16/33] Fix formatting of PROC_ITRF_REF and PROC_VELOCITY_REF in GNSS processing --- CODE/matlab/superprocs/gnss.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 200e59da..94c4398d 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,8 +661,8 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))) ... - 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) + 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... ); From 1a9e52dea82e4945d36430f81a3145208378e594 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:39:42 +0200 Subject: [PATCH 17/33] Add PROC_VECTORS_REF to metadata in GNSS processing --- CODE/matlab/superprocs/gnss.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 94c4398d..b40b682a 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -663,10 +663,9 @@ 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... + 'PROC_VECTORS_REF',sprintf('%s',any2str(field2str(P,'VECTORS_REF',''))) ); - - if vrelmode E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); end From aba22fc400a61bd8d90f53c62f2ac3b50308bbed Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 16:40:25 +0200 Subject: [PATCH 18/33] Fix formatting of PROC_VELOCITY_REF and PROC_VECTORS_REF in GNSS processing --- CODE/matlab/superprocs/gnss.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index b40b682a..e87ebdfc 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -662,8 +662,8 @@ 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... - 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... - 'PROC_VECTORS_REF',sprintf('%s',any2str(field2str(P,'VECTORS_REF',''))) + 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))), ... + 'PROC_VECTORS_REF',sprintf('%s',any2str(field2str(P,'VECTORS_REF',''))) ... ); if vrelmode From ca3e6feab1953d3b3d72dad5a0c85b70b2a4f3a7 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 17:18:31 +0200 Subject: [PATCH 19/33] CORRECT BUG: meta are now erased after the export --- CODE/matlab/superprocs/gnss.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index e87ebdfc..bd2a8087 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -662,15 +662,13 @@ 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... - 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))), ... - 'PROC_VECTORS_REF',sprintf('%s',any2str(field2str(P,'VECTORS_REF',''))) ... ); - if vrelmode E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); end mkexport(WO,sprintf('%s_%s',N(n).ID,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); + E.meta = {}; % meta are erased after the export end end @@ -2345,6 +2343,7 @@ E.infos = cat(2,E.infos,sprintf('Time period #%d = %g days (%s)',m,modeltime_period(m),days2h(modeltime_period(m),'round'))); end mkexport(WO,sprintf('%s_VECTORS_%s_%s',summary,lower(N(kn(s)).ID),P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); + E.meta = {}; % meta are erased after the export end % modeltime results From f4b5da07559fb2ae957083878f90c3eb0860579e Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 17:19:16 +0200 Subject: [PATCH 20/33] Fix formatting of PROC_ITRF_REF in GNSS processing --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index bd2a8087..f28b81ef 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,7 +661,7 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))) ... ); if vrelmode E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); From c23b345b6ca4c9cef87eabc410ebb2bbbc51b122 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 11 Aug 2025 17:27:16 +0200 Subject: [PATCH 21/33] Enhance metadata handling by adding comments for PROC_ITRF_REF and PROC_VELOCITY_REF in GNSS processing --- CODE/matlab/superprocs/gnss.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index f28b81ef..d9cab52b 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,9 +661,14 @@ 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))) ... - ); + % ITRF reference (this is a string displayed on graph title, not functional) + 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + % Relative velocity reference E,N,U (mm/yr) from ITRF = constant trend + % substracted to all data before any other processing + 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... + ); if vrelmode + % substracts a reference vector (can be NODE-dependent) E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); end From 4dfeb970e52ee4848e1870dcf7655949f2b6ff87 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 12:17:46 +0200 Subject: [PATCH 22/33] new branch 1st commit --- CODE/matlab/superprocs/gnss.m | 1 + 1 file changed, 1 insertion(+) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index d9cab52b..5e7f8892 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -2385,6 +2385,7 @@ end end + if P.REQUEST mkendreq(WO,P); end From 8c426e47b9820e0dbff2ac2f6419ecb05b989d17 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:08:18 +0200 Subject: [PATCH 23/33] Fix typo in geo variable assignment in GNSS processing --- CODE/matlab/superprocs/gnss.m | 44 +++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 5e7f8892..c03f2495 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -81,6 +81,9 @@ cmpnames = split(field2str(P,'COMPONENT_NAMELIST','Relative Eastern,Relative Northern,Relative Vertical'),','); disp_yscale = field2num(P,'DISP_YSCALE_M',0); +export_header_proc_keylist = split(field2str(P,'EXPORT_HEADER_PROC_KEYLIST',''),','); + + % Harmonic correction: period list (day), pairs of sine, cosine (mm) for each component harm_refdate = field2num(P,'HARMONIC_ORIGIN_DATE'); harm_period = field2num(P,'HARMONIC_PERIOD_DAY',0); @@ -306,7 +309,7 @@ modeltime_markersize = pi*(field2num(P,'MODELTIME_MARKERSIZE',10,'notempty')/2)^2; % scatter needs marker size as a surface (πr²) -geo = [cat(1,N.LAT_WGS84),cat(1,N.LON_WGS84),cat(1,N.ALTITUDE)]; +geo = [cat(1,N.LAT_WGS84),cat(1,N.LAT_WGS84),cat(1,N.ALTITUDE)]; V.name = P.NAME; V.velref = itrf; @@ -654,24 +657,31 @@ end E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); - E.meta = struct( ... - 'NODE_FID',N(n).FID, ... - 'NODE_NAME',N(n).NAME, ... - 'NODE_GNSS_9CHAR',N(n).GNSS_9CHAR, ... - 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... - 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... - 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - % ITRF reference (this is a string displayed on graph title, not functional) - 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... - % Relative velocity reference E,N,U (mm/yr) from ITRF = constant trend - % substracted to all data before any other processing - 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... - ); - if vrelmode - % substracts a reference vector (can be NODE-dependent) - E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); + E.meta = {}; + if ~isempty(export_header_proc_keylist) + for iexport = 1:length(export_header_proc_keylist) + E.meta.("NODE." + export_header_proc_keylist{iexport}) = N(n).(export_header_proc_keylist{iexport}); + end end + %E.meta = struct( ... + % 'NODE_FID',N(n).FID, ... + % 'NODE_NAME',N(n).NAME, ... + % 'NODE_GNSS_9CHAR',N(n).GNSS_9CHAR, ... + % 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... + % 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... + % 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... + % % ITRF reference (this is a string displayed on graph title, not functional) + % 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... + % % Relative velocity reference E,N,U (mm/yr) from ITRF = constant trend + % % substracted to all data before any other processing + % 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... + % ); + %if vrelmode + % % substracts a reference vector (can be NODE-dependent) + % E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); + %end + mkexport(WO,sprintf('%s_%s',N(n).ID,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); E.meta = {}; % meta are erased after the export end From c6aebe06cd19e4a49a36b42003f5b0cd063e8203 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:18:11 +0200 Subject: [PATCH 24/33] Refactor meta key assignment in export to use underscore notation for consistency --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index c03f2495..7ab69cd0 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -660,7 +660,7 @@ E.meta = {}; if ~isempty(export_header_proc_keylist) for iexport = 1:length(export_header_proc_keylist) - E.meta.("NODE." + export_header_proc_keylist{iexport}) = N(n).(export_header_proc_keylist{iexport}); + E.meta.(['NODE_', export_header_proc_keylist{iexport}]) = N(n).(export_header_proc_keylist{iexport}); end end From 912b937999a7baab7ee3feaa4461f5e5c3094258 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:21:17 +0200 Subject: [PATCH 25/33] Update metadata assignment in GNSS processing to use PROC_ prefix for consistency --- CODE/matlab/superprocs/gnss.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 7ab69cd0..56866074 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -658,9 +658,16 @@ E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); E.meta = {}; + + if ~isempty(export_header_node_keylist) + for iexport = 1:length(export_header_node_keylist) + E.meta.(['NODE_', export_header_node_keylist{iexport}]) = N(n).(export_header_node_keylist{iexport}); + end + end + if ~isempty(export_header_proc_keylist) for iexport = 1:length(export_header_proc_keylist) - E.meta.(['NODE_', export_header_proc_keylist{iexport}]) = N(n).(export_header_proc_keylist{iexport}); + E.meta.(['PROC_', export_header_proc_keylist{iexport}]) = P(n).(export_header_proc_keylist{iexport}); end end From 757f9ea6cf0760525078f4e19b8b36396f15ad06 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:23:37 +0200 Subject: [PATCH 26/33] Add export header node key list to GNSS processing --- CODE/matlab/superprocs/gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 56866074..5e7bb81f 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -82,7 +82,7 @@ disp_yscale = field2num(P,'DISP_YSCALE_M',0); export_header_proc_keylist = split(field2str(P,'EXPORT_HEADER_PROC_KEYLIST',''),','); - +export_header_node_keylist = split(field2str(P,'EXPORT_HEADER_NODE_KEYLIST',''),','); % Harmonic correction: period list (day), pairs of sine, cosine (mm) for each component harm_refdate = field2num(P,'HARMONIC_ORIGIN_DATE'); From a745c7d07f1ecd3a2ed8af0b51106b7fdcef7e69 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:26:54 +0200 Subject: [PATCH 27/33] Update export meta key assignment to use dot notation for consistency --- CODE/matlab/superprocs/gnss.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 5e7bb81f..655a5721 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,13 +661,13 @@ if ~isempty(export_header_node_keylist) for iexport = 1:length(export_header_node_keylist) - E.meta.(['NODE_', export_header_node_keylist{iexport}]) = N(n).(export_header_node_keylist{iexport}); + E.meta.(['NODE.', export_header_node_keylist{iexport}]) = N(n).(export_header_node_keylist{iexport}); end end if ~isempty(export_header_proc_keylist) for iexport = 1:length(export_header_proc_keylist) - E.meta.(['PROC_', export_header_proc_keylist{iexport}]) = P(n).(export_header_proc_keylist{iexport}); + E.meta.(['PROC.', export_header_proc_keylist{iexport}]) = P(n).(export_header_proc_keylist{iexport}); end end From 197c1bf9ca624b6da4ebd33e6c5bcbf6c41e1150 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:32:22 +0200 Subject: [PATCH 28/33] Update export meta key assignments to convert values to string format --- CODE/matlab/superprocs/gnss.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 655a5721..073ee1a9 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -661,13 +661,13 @@ if ~isempty(export_header_node_keylist) for iexport = 1:length(export_header_node_keylist) - E.meta.(['NODE.', export_header_node_keylist{iexport}]) = N(n).(export_header_node_keylist{iexport}); + E.meta.(['NODE.', export_header_node_keylist{iexport}]) = any2str(N(n).(export_header_node_keylist{iexport})); end end if ~isempty(export_header_proc_keylist) for iexport = 1:length(export_header_proc_keylist) - E.meta.(['PROC.', export_header_proc_keylist{iexport}]) = P(n).(export_header_proc_keylist{iexport}); + E.meta.(['PROC.', export_header_proc_keylist{iexport}]) = any2str(P.(export_header_proc_keylist{iexport})); end end From 04e0425575119d35bfe33f578784b8e82297550c Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:51:52 +0200 Subject: [PATCH 29/33] Refactor metadata assignment in GNSS processing to consolidate export metadata handling --- CODE/matlab/add_export_metadata.m | 23 +++++++++++++++++++++++ CODE/matlab/superprocs/gnss.m | 8 +++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 CODE/matlab/add_export_metadata.m diff --git a/CODE/matlab/add_export_metadata.m b/CODE/matlab/add_export_metadata.m new file mode 100644 index 00000000..78f63734 --- /dev/null +++ b/CODE/matlab/add_export_metadata.m @@ -0,0 +1,23 @@ +function outstruct = add_export_metadata(NP, export_header_keylist, np_type) +%ADD_EXPORT_METADATA Add metadata to export structure based on node and process parameters +% +% INPUTS: +% NP - Node or Proc configuration structure +% export_header_keylist - Cell array of node/proc field names to export +% np_type - String indicating the type ('NODE' or 'PROC') +% +% OUTPUT: +% outstruct - export structure with added metadata + + % Initialize meta field if it doesn't exist + outstruct = struct(); + + % Add node metadata + if ~isempty(export_header_keylist) + for iexport = 1:length(export_header_keylist) + fieldname = export_header_keylist{iexport}; + outstruct.([np_type,'.', fieldname]) = any2str(NP.(fieldname)); + end + end +end + diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 073ee1a9..12c0b7de 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -658,7 +658,7 @@ E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); E.meta = {}; - + if ~isempty(export_header_node_keylist) for iexport = 1:length(export_header_node_keylist) E.meta.(['NODE.', export_header_node_keylist{iexport}]) = any2str(N(n).(export_header_node_keylist{iexport})); @@ -671,6 +671,12 @@ end end + E.meta = {}; + meta_n = add_export_metadata(N(n),export_header_node_keylist,"NODE"); + meta_p = add_export_metadata(P,export_header_proc_keylist,"PROC"); + E.meta = [meta_n, meta_p]; + + %E.meta = struct( ... % 'NODE_FID',N(n).FID, ... % 'NODE_NAME',N(n).NAME, ... From 20cdf273a1ef2d4d47fd723f992589aec0312f2b Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 14:58:50 +0200 Subject: [PATCH 30/33] Refactor add_export_metadata function to modify export structure directly and improve metadata handling --- CODE/matlab/add_export_metadata.m | 16 ++++++++++------ CODE/matlab/superprocs/gnss.m | 8 +++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CODE/matlab/add_export_metadata.m b/CODE/matlab/add_export_metadata.m index 78f63734..32d7464c 100644 --- a/CODE/matlab/add_export_metadata.m +++ b/CODE/matlab/add_export_metadata.m @@ -1,23 +1,27 @@ -function outstruct = add_export_metadata(NP, export_header_keylist, np_type) +function E = add_export_metadata(E, NP, export_header_keylist, np_type) %ADD_EXPORT_METADATA Add metadata to export structure based on node and process parameters % % INPUTS: +% E - Export structure to modify % NP - Node or Proc configuration structure % export_header_keylist - Cell array of node/proc field names to export % np_type - String indicating the type ('NODE' or 'PROC') % % OUTPUT: -% outstruct - export structure with added metadata +% E - Modified export structure with added metadata % Initialize meta field if it doesn't exist - outstruct = struct(); + if ~isfield(E, 'meta') + E.meta = struct(); + end % Add node metadata if ~isempty(export_header_keylist) for iexport = 1:length(export_header_keylist) fieldname = export_header_keylist{iexport}; - outstruct.([np_type,'.', fieldname]) = any2str(NP.(fieldname)); + if isfield(NP, fieldname) + E.meta.(['NODE.', fieldname]) = any2str(NP.(fieldname)); + end end end -end - +end \ No newline at end of file diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 12c0b7de..8b40e52f 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -658,7 +658,7 @@ E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); E.meta = {}; - + if ~isempty(export_header_node_keylist) for iexport = 1:length(export_header_node_keylist) E.meta.(['NODE.', export_header_node_keylist{iexport}]) = any2str(N(n).(export_header_node_keylist{iexport})); @@ -672,11 +672,9 @@ end E.meta = {}; - meta_n = add_export_metadata(N(n),export_header_node_keylist,"NODE"); - meta_p = add_export_metadata(P,export_header_proc_keylist,"PROC"); - E.meta = [meta_n, meta_p]; + E = add_export_metadata(E,N(n),export_header_node_keylist,"NODE"); + E = add_export_metadata(E,P,export_header_proc_keylist,"PROC"); - %E.meta = struct( ... % 'NODE_FID',N(n).FID, ... % 'NODE_NAME',N(n).NAME, ... From 3c40d368cb8f9eafc30558040e332204ce7b5ac7 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 15:01:42 +0200 Subject: [PATCH 31/33] Update export metadata assignment to use dynamic np_type for consistency --- CODE/matlab/add_export_metadata.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/add_export_metadata.m b/CODE/matlab/add_export_metadata.m index 32d7464c..f3dce8af 100644 --- a/CODE/matlab/add_export_metadata.m +++ b/CODE/matlab/add_export_metadata.m @@ -20,7 +20,7 @@ for iexport = 1:length(export_header_keylist) fieldname = export_header_keylist{iexport}; if isfield(NP, fieldname) - E.meta.(['NODE.', fieldname]) = any2str(NP.(fieldname)); + E.meta.([np_type, '.', fieldname]) = any2str(NP.(fieldname)); end end end From 86fa9a5c39b4d1bab00e14857227137fa5bdb021 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 15:06:52 +0200 Subject: [PATCH 32/33] Update function documentation to include author and creation date --- CODE/matlab/add_export_metadata.m | 4 ++++ CODE/matlab/superprocs/gnss.m | 18 ------------------ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/CODE/matlab/add_export_metadata.m b/CODE/matlab/add_export_metadata.m index f3dce8af..05927fa9 100644 --- a/CODE/matlab/add_export_metadata.m +++ b/CODE/matlab/add_export_metadata.m @@ -9,6 +9,10 @@ % % OUTPUT: % E - Modified export structure with added metadata +% +% Author: Pierre Sakic / WEBOBS, IPGP +% Created: 2025-08-22 +% Updated: 2025-08-22 % Initialize meta field if it doesn't exist if ~isfield(E, 'meta') diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 8b40e52f..74508a54 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -675,24 +675,6 @@ E = add_export_metadata(E,N(n),export_header_node_keylist,"NODE"); E = add_export_metadata(E,P,export_header_proc_keylist,"PROC"); - %E.meta = struct( ... - % 'NODE_FID',N(n).FID, ... - % 'NODE_NAME',N(n).NAME, ... - % 'NODE_GNSS_9CHAR',N(n).GNSS_9CHAR, ... - % 'NODE_LATITUDE',sprintf('%1.6f',N(n).LAT_WGS84), ... - % 'NODE_LONGITUDE',sprintf('%1.6f',N(n).LON_WGS84), ... - % 'NODE_ELEVATION',sprintf('%1.2f',N(n).ALTITUDE), ... - % % ITRF reference (this is a string displayed on graph title, not functional) - % 'PROC_ITRF_REF',sprintf('%s',any2str(field2str(P,'ITRF_REF',''))), ... - % % Relative velocity reference E,N,U (mm/yr) from ITRF = constant trend - % % substracted to all data before any other processing - % 'PROC_VELOCITY_REF',sprintf('%s',any2str(field2str(P,'VELOCITY_REF',''))) ... - % ); - %if vrelmode - % % substracts a reference vector (can be NODE-dependent) - % E.meta.PROC_VECTORS_VELOCITY_REF = sprintf('%s',any2str(vref)); - %end - mkexport(WO,sprintf('%s_%s',N(n).ID,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); E.meta = {}; % meta are erased after the export end From e60bdad9b101cad32275e881e4f895cfc0dbdc23 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Fri, 22 Aug 2025 15:45:28 +0200 Subject: [PATCH 33/33] Refactor export metadata handling to streamline assignment process --- CODE/matlab/superprocs/gnss.m | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/CODE/matlab/superprocs/gnss.m b/CODE/matlab/superprocs/gnss.m index 74508a54..3d7d0f73 100644 --- a/CODE/matlab/superprocs/gnss.m +++ b/CODE/matlab/superprocs/gnss.m @@ -657,20 +657,6 @@ end E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(N(n).ID)); - E.meta = {}; - - if ~isempty(export_header_node_keylist) - for iexport = 1:length(export_header_node_keylist) - E.meta.(['NODE.', export_header_node_keylist{iexport}]) = any2str(N(n).(export_header_node_keylist{iexport})); - end - end - - if ~isempty(export_header_proc_keylist) - for iexport = 1:length(export_header_proc_keylist) - E.meta.(['PROC.', export_header_proc_keylist{iexport}]) = any2str(P.(export_header_proc_keylist{iexport})); - end - end - E.meta = {}; E = add_export_metadata(E,N(n),export_header_node_keylist,"NODE"); E = add_export_metadata(E,P,export_header_proc_keylist,"PROC");