|
34 | 34 | % data format: extract from SmoothFinal.tdp output file (grep "Station.SSSS.State.pos.[XYZ]" lines) |
35 | 35 | % node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) |
36 | 36 | % |
| 37 | +% format 'gins-ippp' |
| 38 | +% type: GINS IPPP solutions |
| 39 | +% filename/url: P.RAWDATA (use $FID to point the right file/url) |
| 40 | +% data format: yyyymmdd hhmmss yyyy.yyyyyyyyy jjjjj.jj X Y Z dX dY dZ E N V dE dN dV |
| 41 | +% node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) |
| 42 | +% |
| 43 | +% format 'gamit-pos' |
| 44 | +% type: GAMIT/GLOBK POS file |
| 45 | +% filename/url: P.RAWDATA (use $FID to point the right file/url) |
| 46 | +% data format: yyyymmdd jjjjj.jjjj E N U dE dN dU |
| 47 | +% node calibration: no .CLB file or 4 components (East, North, Up) in meters and (Orbit) |
| 48 | +% |
37 | 49 | % format 'usgs-rneu' |
38 | 50 | % type: USGS GPS results ITRF08 |
39 | 51 | % filename/url: P.RAWDATA (use $FID to point the right file/url) |
|
55 | 67 | % |
56 | 68 | % Authors: François Beauducel and Jean-Bernard de Chabalier, WEBOBS/IPGP |
57 | 69 | % Created: 2016-07-10, in Yogyakarta (Indonesia) |
58 | | -% Updated: 2021-11-12 |
| 70 | +% Updated: 2025-01-23 |
59 | 71 |
|
60 | 72 | wofun = sprintf('WEBOBS{%s}',mfilename); |
61 | 73 |
|
| 74 | +% minimum decent error is 0.1 mm (!) |
| 75 | +min_error = 1e-4; |
62 | 76 |
|
63 | 77 | switch F.fmt |
64 | 78 | % ----------------------------------------------------------------------------- |
|
118 | 132 | %end |
119 | 133 | %D.ITRF_YEAR = itrf; |
120 | 134 |
|
| 135 | + |
| 136 | +% ----------------------------------------------------------------------------- |
| 137 | +case 'gamit-pos' |
| 138 | + % format example |
| 139 | + % yyyymmdd jjjjj.jjjj E N U dE dN dU |
| 140 | + % 20100101 55197.4993 -0.09875 -0.11953 0.00075 0.00198 0.00161 0.00645 |
| 141 | + |
| 142 | + fdat = sprintf('%s/%s.dat',F.ptmp,N.ID); |
| 143 | + wosystem(sprintf('rm -f %s',fdat),P); |
| 144 | + for a = 1:length(F.raw) |
| 145 | + fraw = F.raw{a}; |
| 146 | + cmd0 = sprintf('awk ''/^[^!]/ {print}'' >> %s',fdat); % removes header lines |
| 147 | + if strncmpi('http',fraw,4) |
| 148 | + s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); |
| 149 | + if s ~= 0 |
| 150 | + break; |
| 151 | + end |
| 152 | + else |
| 153 | + s = wosystem(sprintf('cat %s | %s',fraw,cmd0),P); |
| 154 | + end |
| 155 | + if s ~= 0 |
| 156 | + fprintf('%s: ** WARNING ** Raw data "%s" not found.\n',wofun,fraw); |
| 157 | + end |
| 158 | + end |
| 159 | + |
| 160 | + % load the file |
| 161 | + if exist(fdat,'file') |
| 162 | + dd = load(fdat); |
| 163 | + else |
| 164 | + dd = []; |
| 165 | + end |
| 166 | + if ~isempty(dd) |
| 167 | + t = dd(:,2) + 678941.5007; % converts MJD to datenum |
| 168 | + d = [dd(:,3:5),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit |
| 169 | + e = dd(:,6:8); |
| 170 | + e(e<min_error) = min_error; |
| 171 | + fprintf('%d data imported.\n',size(dd,1)); |
| 172 | + else |
| 173 | + fprintf('no data found!\n') |
| 174 | + t = []; |
| 175 | + d = []; |
| 176 | + e = []; |
| 177 | + end |
| 178 | + |
121 | 179 | % ----------------------------------------------------------------------------- |
122 | 180 | case {'gipsy','gipsy-tdp','gipsyx'} |
123 | 181 |
|
|
183 | 241 | % converts cartesian geocentric (X,Y,Z) to UTM, estimating errors |
184 | 242 | [enu,e] = cart2utm(dd(:,[2,6,10])*kmfact,dd(:,[3,7,11])*kmfact); |
185 | 243 | d = [enu,dd(:,4)]; |
186 | | - % minimum decent error is 1 mm (!) |
187 | | - e(e<1e-3) = 1e-3; |
| 244 | + e(e<min_error) = min_error; |
188 | 245 | fprintf(' %d data imported.\n',size(dd,1)); |
189 | 246 | else |
190 | 247 | fprintf(' no data found!\n') |
|
194 | 251 | end |
195 | 252 | %D.ITRF_YEAR = 'ITRF08'; |
196 | 253 |
|
| 254 | +% ----------------------------------------------------------------------------- |
| 255 | +case 'spotgins-ippp' |
| 256 | + % format example |
| 257 | + % !yyyymmdd hhmmss yyyy.yyyyyyyyy jjjjj.jj X_position Y_position Z_position dX dY dZ E N V dE dN dV |
| 258 | + % 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 |
| 259 | + |
| 260 | + fdat = sprintf('%s/%s.dat',F.ptmp,N.ID); |
| 261 | + wosystem(sprintf('rm -f %s',fdat),P); |
| 262 | + for a = 1:length(F.raw) |
| 263 | + fraw = F.raw{a}; |
| 264 | + cmd0 = sprintf('awk ''/^[^!]/ {print}'' >> %s',fdat); % removes header lines |
| 265 | + if strncmpi('http',fraw,4) |
| 266 | + s = wosystem(sprintf('curl -s -S "%s" | %s',fraw,cmd0),P); |
| 267 | + if s ~= 0 |
| 268 | + break; |
| 269 | + end |
| 270 | + else |
| 271 | + s = wosystem(sprintf('cat %s | %s',fraw,cmd0),P); |
| 272 | + end |
| 273 | + if s ~= 0 |
| 274 | + fprintf('%s: ** WARNING ** Raw data "%s" not found.\n',wofun,fraw); |
| 275 | + end |
| 276 | + end |
| 277 | + |
| 278 | + % load the file |
| 279 | + if exist(fdat,'file') |
| 280 | + dd = load(fdat); |
| 281 | + else |
| 282 | + dd = []; |
| 283 | + end |
| 284 | + if ~isempty(dd) |
| 285 | + t = datenum(dd(:,3),1,1,0,0,0); |
| 286 | + d = [dd(:,11:13),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit |
| 287 | + e = dd(:,14:16); |
| 288 | + e(e<min_error) = min_error; |
| 289 | + fprintf('%d data imported.\n',size(dd,1)); |
| 290 | + else |
| 291 | + fprintf('no data found!\n') |
| 292 | + t = []; |
| 293 | + d = []; |
| 294 | + e = []; |
| 295 | + end |
| 296 | + |
197 | 297 | % ----------------------------------------------------------------------------- |
198 | 298 | case 'usgs-rneu' |
199 | 299 | % format example |
|
230 | 330 | t = datenum(ty,tm,td,12,0,0); % date is YYYYMMDD and we force time to 12:00:00 |
231 | 331 | d = [dd(:,[3,2,4])/1e3,dd(:,5)]; % North(mm),East(mm),Up(mm),Orbit => E(m),N(m),U(m),O |
232 | 332 | e = dd(:,[7,6,8])/1e3; |
233 | | - % minimum decent error is 1 mm (!) |
234 | | - e(e<1e-3) = 1e-3; |
| 333 | + e(e<min_error) = min_error; |
235 | 334 | fprintf('%d data imported.\n',size(dd,1)); |
236 | 335 | else |
237 | 336 | fprintf('no data found!\n') |
|
274 | 373 | t = datenum(dd(:,1),1,1,0,0,0); % date is decimal year |
275 | 374 | d = [dd(:,[4,2,6]),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm),Orbit => E(m),N(m),U(m),O |
276 | 375 | e = dd(:,[5,3,7]); |
277 | | - % minimum decent error is 1 mm (!) |
278 | | - e(e<1e-3) = 1e-3; |
| 376 | + e(e<min_error) = min_error; |
279 | 377 | fprintf('%d data imported.\n',size(dd,1)); |
280 | 378 | else |
281 | 379 | fprintf('no data found!\n') |
|
318 | 416 | t = datenum(dd(:,2),dd(:,3),dd(:,4),12,0,0); % here we force time to noon |
319 | 417 | d = [dd(:,[6,5,7]),zeros(size(dd,1),1)]; % North(mm),East(mm),Up(mm) => E(m),N(m),U(m),Orbit |
320 | 418 | e = dd(:,[9,8,10]); |
321 | | - % minimum decent error is 1 mm (!) |
322 | | - e(e<1e-3) = 1e-3; |
| 419 | + e(e<min_error) = min_error; |
323 | 420 | fprintf('%d data imported.\n',size(dd,1)); |
324 | 421 | else |
325 | 422 | fprintf('no data found!\n') |
|
367 | 464 | t = datenum(dd(:,1),1,1); % here we force time to January 1st! |
368 | 465 | d = [dd(:,2:4),zeros(size(dd,1),1)]; |
369 | 466 | e = dd(:,5:7); |
370 | | - % minimum decent error is 1 mm (!) |
371 | | - e(e<1e-3) = 1e-3; |
| 467 | + e(e<min_error) = min_error; |
372 | 468 | fprintf('%d data imported.\n',size(dd,1)); |
373 | 469 | else |
374 | 470 | fprintf('no data found!\n') |
|
0 commit comments