diff --git a/CODE/etc/rawformats.conf b/CODE/etc/rawformats.conf index 7668091e..5755fa24 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-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/add_export_metadata.m b/CODE/matlab/add_export_metadata.m new file mode 100644 index 00000000..05927fa9 --- /dev/null +++ b/CODE/matlab/add_export_metadata.m @@ -0,0 +1,31 @@ +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: +% 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') + E.meta = struct(); + end + + % Add node metadata + if ~isempty(export_header_keylist) + for iexport = 1:length(export_header_keylist) + fieldname = export_header_keylist{iexport}; + if isfield(NP, fieldname) + E.meta.([np_type, '.', fieldname]) = any2str(NP.(fieldname)); + end + end + end +end \ No newline at end of file diff --git a/CODE/matlab/plotorbit.m b/CODE/matlab/plotorbit.m index d5307bfd..c65b4baf 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 % checks if uistack function exists, (only MATLAB, not octave compatible) + uistack(h,'bottom') + end end % overwrites non-final orbits diff --git a/CODE/matlab/readfmtdata.m b/CODE/matlab/readfmtdata.m index d5c5e7a1..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-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'} @@ -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); diff --git a/CODE/matlab/readfmtdata_gnss.m b/CODE/matlab/readfmtdata_gnss.m index 08d5cc47..05c83645 100644 --- a/CODE/matlab/readfmtdata_gnss.m +++ b/CODE/matlab/readfmtdata_gnss.m @@ -34,7 +34,13 @@ % 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-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 % 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 +306,56 @@ 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