From 38c776f95390649ea668f02471d2be5b47159677 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 22 Sep 2025 12:31:52 +0200 Subject: [PATCH 01/10] add both spotgins v2 & v3 --- CODE/matlab/readfmtdata_gnss.m | 77 ++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 4912f8af..4d4b769e 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -308,17 +308,65 @@ % ----------------------------------------------------------------------------- -case 'spotgins-enu-v2' - % format exemple +case 'spotgins-enu' + % Supports both v2 and v3 SPOTGINS formats + % + % v2 format example: %#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 + % + % v3 format example: + %#MJD DispEast DispNorth DispUp SigmaEast SigmaNorth SigmaUp CorrEN CorrEU CorrNU yyyy-mm-ddTHH:MM:SS DecimalYear Const Flag DateOfExe GinsVersion PrairieVersion + % 51668.5 0.080276 -2.058358 0.009854 0.000312 0.000439 0.001339 -0.028963 -0.085824 -0.011884 2000-05-04T12:00:00 2000.340164 G 0 250910_120313 25_1 v56 + % 51669.5 0.077154 -2.057207 0.005923 0.000257 0.000371 0.001109 -0.017412 -0.060937 -0.124317 2000-05-05T12:00:00 2000.342896 G 0 250910_120313 25_1 v56 fdat = sprintf('%s/%s.dat',F.ptmp,N.ID); wosystem(sprintf('rm -f %s',fdat),P); + + % Detect format version from first file + format_version = ''; + if ~isempty(F.raw) + first_raw = F.raw{1}; + if strncmpi('http',first_raw,4) + [s,header] = wosystem(sprintf('curl -s -S "%s" | head -20',first_raw),P); + else + [s,header] = wosystem(sprintf('head -20 %s',first_raw),P); + end + if s == 0 + if contains(header,'SPOTGINS SOLUTION [POSITION] v3') || contains(header,'MJD DispEast') + format_version = 'v3'; + elseif contains(header,'SPOTGINS SOLUTION [POSITION] v2') || contains(header,'jjjjj.jjjjjjjj') + format_version = 'v2'; + else + % Try to detect from data columns (fallback method) + if strncmpi('http',first_raw,4) + [s,sample] = wosystem(sprintf('curl -s -S "%s" | grep -v "^#" | head -1',first_raw),P); + else + [s,sample] = wosystem(sprintf('grep -v "^#" %s | head -1',first_raw),P); + end + if s == 0 && ~isempty(sample) + cols = length(strsplit(strtrim(sample))); + if cols >= 17 % v3 has 17+ columns + format_version = 'v3'; + elseif cols >= 11 % v2 has 11+ columns + format_version = 'v2'; + end + end + end + end + end + + if isempty(format_version) + format_version = 'v2'; % default fallback + fprintf('%s: ** INFO ** Could not detect SPOTGINS format version, assuming v2.\n',wofun); + else + fprintf('%s: ** INFO ** Detected SPOTGINS format %s.\n',wofun,format_version); + end + 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 @@ -332,19 +380,30 @@ end end - - % load the file + % load the file if exist(fdat,'file') 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 - e = dd(:,5:7); + switch format_version + case 'v3' + % v3 format: MJD DispEast DispNorth DispUp SigmaEast SigmaNorth SigmaUp ... + t = dd(:,1) + 678941.5007; % converts MJD to datenum + d = [dd(:,2:4),zeros(size(dd,1),1)]; % DispEast,DispNorth,DispUp,Orbit => E(m),N(m),U(m),Orbit + e = dd(:,5:7); % SigmaEast,SigmaNorth,SigmaUp + + case 'v2' + % v2 format: jjjjj.jj E N U dE dN dU ... + t = dd(:,1) + 678941.5007; % converts MJD to datenum + d = [dd(:,2:4),zeros(size(dd,1),1)]; % E,N,U,Orbit => E(m),N(m),U(m),Orbit + e = dd(:,5:7); % dE,dN,dU + end + e(e Date: Mon, 22 Sep 2025 12:38:56 +0200 Subject: [PATCH 02/10] add in conf file --- CODE/etc/rawformats.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/CODE/etc/rawformats.conf b/CODE/etc/rawformats.conf index 5755fa24..fb9ad382 100644 --- a/CODE/etc/rawformats.conf +++ b/CODE/etc/rawformats.conf @@ -23,6 +23,7 @@ gipsy|GNSS|JPL GIPSY-OASIS .tdp file|ANTENNA,RECEIVER,XYZ|fullpath of root direc 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-v2|GNSS|SPOTGINS solutions - version 2 (<2025-08)||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file +spotgins-enu|GNSS|SPOTGINS solutions - v2&3||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 2e38f406123d9e146846242af51744cb4438745c Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 22 Sep 2025 12:39:10 +0200 Subject: [PATCH 03/10] add header spotgins 2&3 --- CODE/matlab/readfmtdata_gnss.m | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 4d4b769e..15e76fe2 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -40,6 +40,13 @@ % 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-enu' +% type: SPOTGINS solutions - supports v2 and v3 formats (auto-detection) +% filename/url: P.RAWDATA (use $FID to point the right file/url) +% data format v2: jjjjj.jj E N V dE dN dV yyyymmddhhmmss yyyy.yyyyyyyyy +% data format v3: MJD DispEast DispNorth DispUp SigmaEast SigmaNorth SigmaUp CorrEN CorrEU CorrNU yyyy-mm-ddTHH:MM:SS DecimalYear Const Flag DateOfExe GinsVersion PrairieVersion +% node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit)READFMTDATA_GNSS subfunction of readfmtdata.m +% % format 'spotgins-ippp' % type: GINS IPPP solutions % filename/url: P.RAWDATA (use $FID to point the right file/url) @@ -501,6 +508,80 @@ e = []; end +% ----------------------------------------------------------------------------- +case 'ies-neu' + % format example: + % Time dN eN dE eE dU eU + % 2008.65846986 -0.00502209 0.00647 0.193237 0.01492 0.0314239 0.01846 + + 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 ''{ if (NR!=1) {print}}'' >> %s',fdat); + if strncmpi('http',fraw,4) + s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); + if s ~= 0 + break; + end + elseif exist(fraw,'file') + % extracts necessary data + wosystem(sprintf('cat %s | %s',fraw,cmd0),P); + else + 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 = datenum(dd(:,1),1,1,0,0,0); % date is decimal year + d = [dd(:,[4,2,6]),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),O +0501 2012.3322 3.3 -79.2 -19.6 rrr 3.5 5.8 16.0 -0.2535 Agung.20120501.stacov.point-2017/10/02-13:45:58 + + 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}; + if strncmpi('http',fraw,4) + s = wosystem(sprintf('curl -s -S "%s" | awk ''{print $1,$3,$4,$5,$6,$7,$8,$9}'' | sed -e ''s/rrr/0/g;s/ppp/1/g'' >> %s',fraw,fdat),P); + if s ~= 0 + break; + end + elseif exist(fraw,'file') + % extracts necessary data and replaces orbit with 0 (rrr) and 1 (ppp) + wosystem(sprintf('awk ''{print $1,$3,$4,$5,$6,$7,$8,$9}'' %s | sed -e ''s/rrr/0/g;s/ppp/1/g'' >> %s',fraw,fdat),P); + else + 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) + ty = floor(dd(:,1)/1e4); + tm = floor(dd(:,1)/1e2) - ty*1e2; + td = dd(:,1) - ty*1e4 - tm*1e2; + t = datenum(ty,tm,td,12,0,0); % date is YYYYMMDD and we force time to 12:00:00 + d = [dd(:,[3,2,4])/1e3,dd(:,5)]; % North(mm),East(mm),Up(mm),Orbit => E(m),N(m),U(m),O + e = dd(:,[7,6,8])/1e3; + e(e Date: Mon, 22 Sep 2025 12:41:53 +0200 Subject: [PATCH 04/10] indentation --- CODE/matlab/readfmtdata_gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 15e76fe2..effa28ba 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -421,7 +421,7 @@ % ----------------------------------------------------------------------------- case 'spotgins-ippp' - % From J.S. - ITES Strasbourg + % From J.S. - ITES Strasbourg % format example % !yyyymmdd hhmmss yyyy.yyyyyyyyy jjjjj.jj X_position Y_position Z_position dX dY dZ E N V dE dN dV % 20160723 65619 2016.558521561 57592.29 4182067.152057 570976.439258 4765940.539811 0.000611 0.000218 0.000673 -0.006574 -0.008848 -0.014844 0.000205 0.000307 0.000859 From 4772fb39c36fd8c6b4ff5ca8c4836e4c2799e244 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 22 Sep 2025 16:59:13 +0200 Subject: [PATCH 05/10] update comment for clarity in readfmtdata_gnss function --- CODE/matlab/readfmtdata_gnss.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index effa28ba..6a8fa4d9 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -541,7 +541,7 @@ if ~isempty(dd) t = datenum(dd(:,1),1,1,0,0,0); % date is decimal year d = [dd(:,[4,2,6]),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),O -0501 2012.3322 3.3 -79.2 -19.6 rrr 3.5 5.8 16.0 -0.2535 Agung.20120501.stacov.point-2017/10/02-13:45:58 + % 0501 2012.3322 3.3 -79.2 -19.6 rrr 3.5 5.8 16.0 -0.2535 Agung.20120501.stacov.point-2017/10/02-13:45:58 fdat = sprintf('%s/%s.dat',F.ptmp,N.ID); wosystem(sprintf('rm -f %s',fdat),P); From aabfb30d1b29cd4d9d00775303e67c2271c1e104 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 22 Sep 2025 17:04:55 +0200 Subject: [PATCH 06/10] correct usgs-rneu --- CODE/matlab/readfmtdata_gnss.m | 74 ---------------------------------- 1 file changed, 74 deletions(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 6a8fa4d9..5bb40e3b 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -508,80 +508,6 @@ e = []; end -% ----------------------------------------------------------------------------- -case 'ies-neu' - % format example: - % Time dN eN dE eE dU eU - % 2008.65846986 -0.00502209 0.00647 0.193237 0.01492 0.0314239 0.01846 - - 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 ''{ if (NR!=1) {print}}'' >> %s',fdat); - if strncmpi('http',fraw,4) - s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); - if s ~= 0 - break; - end - elseif exist(fraw,'file') - % extracts necessary data - wosystem(sprintf('cat %s | %s',fraw,cmd0),P); - else - 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 = datenum(dd(:,1),1,1,0,0,0); % date is decimal year - d = [dd(:,[4,2,6]),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),O - % 0501 2012.3322 3.3 -79.2 -19.6 rrr 3.5 5.8 16.0 -0.2535 Agung.20120501.stacov.point-2017/10/02-13:45:58 - - 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}; - if strncmpi('http',fraw,4) - s = wosystem(sprintf('curl -s -S "%s" | awk ''{print $1,$3,$4,$5,$6,$7,$8,$9}'' | sed -e ''s/rrr/0/g;s/ppp/1/g'' >> %s',fraw,fdat),P); - if s ~= 0 - break; - end - elseif exist(fraw,'file') - % extracts necessary data and replaces orbit with 0 (rrr) and 1 (ppp) - wosystem(sprintf('awk ''{print $1,$3,$4,$5,$6,$7,$8,$9}'' %s | sed -e ''s/rrr/0/g;s/ppp/1/g'' >> %s',fraw,fdat),P); - else - 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) - ty = floor(dd(:,1)/1e4); - tm = floor(dd(:,1)/1e2) - ty*1e2; - td = dd(:,1) - ty*1e4 - tm*1e2; - t = datenum(ty,tm,td,12,0,0); % date is YYYYMMDD and we force time to 12:00:00 - d = [dd(:,[3,2,4])/1e3,dd(:,5)]; % North(mm),East(mm),Up(mm),Orbit => E(m),N(m),U(m),O - e = dd(:,[7,6,8])/1e3; - e(e Date: Mon, 22 Sep 2025 17:12:22 +0200 Subject: [PATCH 07/10] add support for 'spotgins-enu-v2' format in readfmtdata_gnss function --- CODE/matlab/readfmtdata_gnss.m | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 5bb40e3b..9dfa905b 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -313,6 +313,51 @@ end %D.ITRF_YEAR = 'ITRF08'; +% ----------------------------------------------------------------------------- +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 + % 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 + 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 = 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 + e = dd(:,5:7); + e(e Date: Mon, 22 Sep 2025 17:15:43 +0200 Subject: [PATCH 08/10] add 'spotgins-enu' format support in readfmtdata function --- 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 b553e83f..e9f35f96 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-v2','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-enu-v2','spotgins-ippp','gamit-pos','pbogps-pos'} D(n) = readfmtdata_gnss(WO,P,N(n),F); case {'hyp71sum2k','fdsnws-event','scevtlog-xml'} From 84300540985ddd3c43abd859cca9253a40296410 Mon Sep 17 00:00:00 2001 From: PiSa on TPX1 Date: Mon, 22 Sep 2025 17:18:12 +0200 Subject: [PATCH 09/10] refactor comments for clarity and consistency in spotgins format handling --- CODE/matlab/readfmtdata_gnss.m | 50 +++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 9dfa905b..b088bd4a 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -315,16 +315,16 @@ % ----------------------------------------------------------------------------- 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 - % 52671.50195600 0.057207 0.054240 -0.004722 0.000705 0.000619 0.002600 20030201120249 2003.0863067 G 250404_185253 VALIDE_24_2 - + % 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 @@ -337,16 +337,16 @@ fprintf('%s: ** WARNING ** Raw data "%s" not found.\n',wofun,fraw); end end - - - % load the file + + + % load the file if exist(fdat,'file') dd = dlmread(fdat); else dd = []; end if ~isempty(dd) - t = dd(:,1) + 678941.5007; % converts MJD to datenum + 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: Mon, 22 Sep 2025 17:33:14 +0200 Subject: [PATCH 10/10] refactor spotgins format handling: update descriptions for clarity and remove v2 case --- CODE/etc/rawformats.conf | 5 ++-- CODE/matlab/readfmtdata.m | 2 +- CODE/matlab/readfmtdata_gnss.m | 46 ---------------------------------- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/CODE/etc/rawformats.conf b/CODE/etc/rawformats.conf index fb9ad382..34d189e5 100644 --- a/CODE/etc/rawformats.conf +++ b/CODE/etc/rawformats.conf @@ -22,9 +22,8 @@ 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-v2|GNSS|SPOTGINS solutions - version 2 (<2025-08)||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file -spotgins-enu|GNSS|SPOTGINS solutions - v2&3||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 +spotgins-enu|GNSS|SPOTGINS ENU solutions - v2&3||fullpath of file(s) with bash wildcard facilities, possible $FID, or URL to single file +spotgins-ippp|GNSS|SPOTGINS IPPP time series (ITES)||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 usgs-rneu|GNSS|USGS RNEU text file||fullpath of file(s) with bash wildcard facilities diff --git a/CODE/matlab/readfmtdata.m b/CODE/matlab/readfmtdata.m index e9f35f96..33cd49d2 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-enu-v2','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 b088bd4a..e8ce6611 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -313,52 +313,6 @@ end %D.ITRF_YEAR = 'ITRF08'; -% ----------------------------------------------------------------------------- -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 - % 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 - 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 = 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 - e = dd(:,5:7); - e(e