Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ed07256
add spotgins enu
Jul 30, 2025
731997a
add spotgins enu
Jul 30, 2025
82ba53f
change load for dlmread
Jul 31, 2025
968ca85
spotgins-enu-v2
Jul 31, 2025
63347ef
Merge branch 'dev' into ps_read_gins_01a
Aug 11, 2025
f386850
Merge branch 'dev' into ps_read_gins_01a
Aug 11, 2025
2cf1a56
Add metadata structure for GNSS node details in export
Aug 11, 2025
eed9970
Add warning messages for unknown formats in readfmtdata function
Aug 11, 2025
041fa25
Fix formatting in GNSS output for ITRF reference
Aug 11, 2025
4d9cd17
Add 'spotgins-enu-v2' format to GNSS data reading cases
Aug 11, 2025
f245b04
Fix uistack call to check for function existence before execution
Aug 11, 2025
75bcebe
Refactor uistack handling to include Octave compatibility for error bars
Aug 11, 2025
2885082
Remove Octave equivalent handling for uistack in plotorbit function
Aug 11, 2025
801f9dd
Fix metadata assignment in GNSS processing for correct node reference
Aug 11, 2025
0eb87f9
Update ITRF reference formatting in GNSS processing and remove commen…
Aug 11, 2025
e990c31
Fix formatting of ITRF reference output in GNSS processing
Aug 11, 2025
939e420
Fix velocity reference formatting in GNSS processing
Aug 11, 2025
92adc27
Fix formatting of PROC_ITRF_REF and PROC_VELOCITY_REF in GNSS processing
Aug 11, 2025
1a9e52d
Add PROC_VECTORS_REF to metadata in GNSS processing
Aug 11, 2025
aba22fc
Fix formatting of PROC_VELOCITY_REF and PROC_VECTORS_REF in GNSS proc…
Aug 11, 2025
ca3e6fe
CORRECT BUG: meta are now erased after the export
Aug 11, 2025
f4b5da0
Fix formatting of PROC_ITRF_REF in GNSS processing
Aug 11, 2025
c23b345
Enhance metadata handling by adding comments for PROC_ITRF_REF and PR…
Aug 11, 2025
4dfeb97
new branch 1st commit
Aug 22, 2025
8c426e4
Fix typo in geo variable assignment in GNSS processing
Aug 22, 2025
c6aebe0
Refactor meta key assignment in export to use underscore notation for…
Aug 22, 2025
912b937
Update metadata assignment in GNSS processing to use PROC_ prefix for…
Aug 22, 2025
757f9ea
Add export header node key list to GNSS processing
Aug 22, 2025
a745c7d
Update export meta key assignment to use dot notation for consistency
Aug 22, 2025
197c1bf
Update export meta key assignments to convert values to string format
Aug 22, 2025
04e0425
Refactor metadata assignment in GNSS processing to consolidate export…
Aug 22, 2025
20cdf27
Refactor add_export_metadata function to modify export structure dire…
Aug 22, 2025
3c40d36
Update export metadata assignment to use dynamic np_type for consistency
Aug 22, 2025
86fa9a5
Update function documentation to include author and creation date
Aug 22, 2025
e60bdad
Refactor export metadata handling to streamline assignment process
Aug 22, 2025
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
1 change: 1 addition & 0 deletions CODE/etc/rawformats.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions CODE/matlab/add_export_metadata.m
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion CODE/matlab/plotorbit.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions CODE/matlab/readfmtdata.m
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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);
Expand Down
56 changes: 55 additions & 1 deletion CODE/matlab/readfmtdata_gnss.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<min_error) = min_error;
fprintf('%d data imported.\n',size(dd,1));
else
fprintf('no data found!\n')
t = [];
d = [];
e = [];
end


% -----------------------------------------------------------------------------
case 'spotgins-ippp'
% 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
Expand Down
13 changes: 12 additions & 1 deletion CODE/matlab/superprocs/gnss.m
Original file line number Diff line number Diff line change
Expand Up @@ -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',''),',');
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');
harm_period = field2num(P,'HARMONIC_PERIOD_DAY',0);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -653,7 +656,13 @@
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 = {};
E = add_export_metadata(E,N(n),export_header_node_keylist,"NODE");
E = add_export_metadata(E,P,export_header_proc_keylist,"PROC");

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

Expand Down Expand Up @@ -2328,6 +2337,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
Expand Down Expand Up @@ -2364,6 +2374,7 @@
end
end


if P.REQUEST
mkendreq(WO,P);
end
Expand Down