|
40 | 40 | % Authors: François Beauducel, Aline Peltier, Patrice Boissier, Antoine Villié,
|
41 | 41 | % Jean-Marie Saurel / WEBOBS, IPGP
|
42 | 42 | % Created: 2010-06-12 in Paris (France)
|
43 |
| -% Updated: 2022-10-19 |
| 43 | +% Updated: 2023-09-05 |
44 | 44 |
|
45 | 45 | WO = readcfg;
|
46 | 46 | wofun = sprintf('WEBOBS{%s}',mfilename);
|
|
925 | 925 | if isok(P.GTABLE(r),'EXPORTS')
|
926 | 926 | E.infos = { ...
|
927 | 927 | sprintf('Velocity reference (%s): E %+g mm/yr, N %+g mm/yr, U %+g mm/yr',datestr(velrefdate),velref), ...
|
928 |
| - sprintf('Stations'' aliases: %s',strjoin(cellstr(cat(1,N(knv).ALIAS)),',')), ... |
| 928 | + sprintf('Stations'' aliases: %s',strjoin(cat(1,{N(knv).ALIAS}),',')), ... |
929 | 929 | };
|
930 | 930 | E.t = max(cat(1,D(knv).tfirstlast),[],2);
|
931 | 931 | E.d = [geo(knv,:),tr(knv,:),tre(knv,:)];
|
|
1425 | 1425 | 'E_mod(mm)','N_mod(mm)','Up_mod(mm)'};
|
1426 | 1426 | if any(~isnan(m0))
|
1427 | 1427 | E.infos = { ...
|
1428 |
| - sprintf('Stations'' aliases: %s',strjoin(cellstr(cat(1,N(kn).ALIAS)),',')), ... |
| 1428 | + sprintf('Stations'' aliases: %s',strjoin(cat(1,{N(kn).ALIAS}),',')), ... |
1429 | 1429 | '', ...
|
1430 | 1430 | };
|
1431 | 1431 | switch lower(mt)
|
|
2290 | 2290 | E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(sprintf('%s_%s',proc,summary)));
|
2291 | 2291 | E.infos = {sprintf('Source type: %s',mt)};
|
2292 | 2292 | for m = 1:numel(modeltime_period)
|
2293 |
| - E.infos = cat(2,E.infos,sprintf('Time period #%d = %g days (%s)',m,modeltime_period(m),days2h(modeltime_period(m),'round'))); |
2294 |
| - end |
2295 |
| - mkexport(WO,sprintf('%s_%s',summary,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); |
2296 |
| - end |
2297 |
| - |
2298 |
| - if isok(P,'MODELTIME_EXPORT_MAT') |
2299 |
| - f = sprintf('%s_%s.mat',summary,P.GTABLE(r).TIMESCALE); |
2300 |
| - fprintf('%s: saving workspace in %s...',wofun,f); |
2301 |
| - save(sprintf('%s/%s/%s',P.GTABLE(r).OUTDIR,WO.PATH_OUTG_EXPORT,f),'-v6') |
2302 |
| - fprintf(' done.\n'); |
| 2293 | + E.infos = cat(2,E.infos,sprintf('Time period #%d = %g days (%s)',m,modeltime_period(m),days2h(modeltime_period(m),'round'))); |
2303 | 2294 | end
|
| 2295 | + mkexport(WO,sprintf('%s_%s',summary,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r)); |
2304 | 2296 | end
|
| 2297 | + |
| 2298 | + if isok(P,'MODELTIME_EXPORT_MAT') |
| 2299 | + f = sprintf('%s_%s.mat',summary,P.GTABLE(r).TIMESCALE); |
| 2300 | + fprintf('%s: saving workspace in %s...',wofun,f); |
| 2301 | + save(sprintf('%s/%s/%s',P.GTABLE(r).OUTDIR,WO.PATH_OUTG_EXPORT,f),'-v6') |
| 2302 | + fprintf(' done.\n'); |
2305 | 2303 | end
|
2306 | 2304 | end
|
| 2305 | +end |
| 2306 | +end |
2307 | 2307 |
|
2308 | 2308 | if P.REQUEST
|
2309 |
| - mkendreq(WO,P); |
| 2309 | +mkendreq(WO,P); |
2310 | 2310 | end
|
2311 | 2311 |
|
2312 | 2312 | timelog(procmsg,2)
|
2313 | 2313 |
|
2314 | 2314 |
|
2315 | 2315 | % Returns data in DOUT
|
2316 | 2316 | if nargout > 0
|
2317 |
| - DOUT = D; |
| 2317 | +DOUT = D; |
2318 | 2318 | end
|
2319 | 2319 |
|
2320 | 2320 |
|
|
2329 | 2329 | emin = abs(d(:,1:3))*opt.minerrorrel/100;
|
2330 | 2330 | k = (e < emin | isnan(d(:,1:3)) | isnan(e));
|
2331 | 2331 | if any(k)
|
2332 |
| - e(k) = emin(k); |
2333 |
| - if ~strcmpi(opt.verbose,'quiet') |
2334 |
| - fprintf('---> %d data errors have been increased to %g%%.\n',sum(k(:)),opt.minerrorrel); |
2335 |
| - end |
| 2332 | +e(k) = emin(k); |
| 2333 | +if ~strcmpi(opt.verbose,'quiet') |
| 2334 | + fprintf('---> %d data errors have been increased to %g%%.\n',sum(k(:)),opt.minerrorrel); |
| 2335 | +end |
2336 | 2336 | end
|
2337 | 2337 |
|
2338 | 2338 | % forces a minimum relative error
|
2339 | 2339 | k = (e < opt.minerror);
|
2340 | 2340 | if any(k)
|
2341 |
| - e(k) = opt.minerror; % forces a minimum absolute error |
2342 |
| - if ~strcmpi(opt.verbose,'quiet') |
2343 |
| - fprintf('---> %d data errors have been set to %g mm.\n',sum(k(:)),opt.minerror); |
2344 |
| - end |
| 2341 | +e(k) = opt.minerror; % forces a minimum absolute error |
| 2342 | +if ~strcmpi(opt.verbose,'quiet') |
| 2343 | + fprintf('---> %d data errors have been set to %g mm.\n',sum(k(:)),opt.minerror); |
| 2344 | +end |
2345 | 2345 | end
|
2346 | 2346 |
|
2347 | 2347 | % ajusts component errors using a priori factor ratio
|
2348 | 2348 | if any(opt.enuerror ~= 1)
|
2349 |
| - e = e.*repmat(opt.enuerror(1:3),size(e,1),1); |
2350 |
| - if ~strcmpi(opt.verbose,'quiet') |
2351 |
| - fprintf('---> all data errors dE,dN,dU have been multiplied by %g,%g,%g.\n',opt.enuerror); |
2352 |
| - end |
| 2349 | +e = e.*repmat(opt.enuerror(1:3),size(e,1),1); |
| 2350 | +if ~strcmpi(opt.verbose,'quiet') |
| 2351 | + fprintf('---> all data errors dE,dN,dU have been multiplied by %g,%g,%g.\n',opt.enuerror); |
| 2352 | +end |
2353 | 2353 | end
|
2354 | 2354 |
|
2355 | 2355 |
|
|
2365 | 2365 |
|
2366 | 2366 | switch dim
|
2367 | 2367 | case 1
|
2368 |
| - [j,k] = ind2sub(sz([2,3]),idx); |
2369 |
| - y = x(sub2ind(sz,id3(:),j(:),k(:))); |
| 2368 | +[j,k] = ind2sub(sz([2,3]),idx); |
| 2369 | +y = x(sub2ind(sz,id3(:),j(:),k(:))); |
2370 | 2370 | case 2
|
2371 |
| - [i,k] = ind2sub(sz([1,3]),idx); |
2372 |
| - y = x(sub2ind(sz,i(:),id3(:),k(:))); |
| 2371 | +[i,k] = ind2sub(sz([1,3]),idx); |
| 2372 | +y = x(sub2ind(sz,i(:),id3(:),k(:))); |
2373 | 2373 | case 3
|
2374 |
| - [i,j] = ind2sub(sz([1,2]),idx); |
2375 |
| - y = x(sub2ind(sz,i(:),j(:),id3(:))); |
| 2374 | +[i,j] = ind2sub(sz([1,2]),idx); |
| 2375 | +y = x(sub2ind(sz,i(:),j(:),id3(:))); |
2376 | 2376 | end
|
2377 | 2377 | y = reshape(y,size(id3));
|
2378 | 2378 |
|
|
2384 | 2384 | % azimuth/longitude LAMBDA and polar/latitude GAMMA angles (in radian)
|
2385 | 2385 |
|
2386 | 2386 | r = prod(abc)./sqrt(abc(3)^2*(abc(2)^2*cos(lambda).^2 ...
|
2387 |
| - + abc(1)^2*sin(lambda).^2).*cos(gamma).^2 ... |
2388 |
| - + abc(1)^2*abc(2)^2*sin(gamma).^2); |
| 2387 | ++ abc(1)^2*sin(lambda).^2).*cos(gamma).^2 ... |
| 2388 | ++ abc(1)^2*abc(2)^2*sin(gamma).^2); |
2389 | 2389 |
|
2390 | 2390 |
|
2391 | 2391 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
0 commit comments