Skip to content

Commit f5154c9

Browse files
committed
fix a possible issue with export due to node aliases
1 parent 4e3650b commit f5154c9

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

CODE/matlab/superprocs/gnss.m

+35-35
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
% Authors: François Beauducel, Aline Peltier, Patrice Boissier, Antoine Villié,
4141
% Jean-Marie Saurel / WEBOBS, IPGP
4242
% Created: 2010-06-12 in Paris (France)
43-
% Updated: 2022-10-19
43+
% Updated: 2023-09-05
4444

4545
WO = readcfg;
4646
wofun = sprintf('WEBOBS{%s}',mfilename);
@@ -925,7 +925,7 @@
925925
if isok(P.GTABLE(r),'EXPORTS')
926926
E.infos = { ...
927927
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}),',')), ...
929929
};
930930
E.t = max(cat(1,D(knv).tfirstlast),[],2);
931931
E.d = [geo(knv,:),tr(knv,:),tre(knv,:)];
@@ -1425,7 +1425,7 @@
14251425
'E_mod(mm)','N_mod(mm)','Up_mod(mm)'};
14261426
if any(~isnan(m0))
14271427
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}),',')), ...
14291429
'', ...
14301430
};
14311431
switch lower(mt)
@@ -2290,31 +2290,31 @@
22902290
E.title = sprintf('%s {%s}',P.GTABLE(r).GTITLE,upper(sprintf('%s_%s',proc,summary)));
22912291
E.infos = {sprintf('Source type: %s',mt)};
22922292
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')));
23032294
end
2295+
mkexport(WO,sprintf('%s_%s',summary,P.GTABLE(r).TIMESCALE),E,P.GTABLE(r));
23042296
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');
23052303
end
23062304
end
2305+
end
2306+
end
23072307

23082308
if P.REQUEST
2309-
mkendreq(WO,P);
2309+
mkendreq(WO,P);
23102310
end
23112311

23122312
timelog(procmsg,2)
23132313

23142314

23152315
% Returns data in DOUT
23162316
if nargout > 0
2317-
DOUT = D;
2317+
DOUT = D;
23182318
end
23192319

23202320

@@ -2329,27 +2329,27 @@
23292329
emin = abs(d(:,1:3))*opt.minerrorrel/100;
23302330
k = (e < emin | isnan(d(:,1:3)) | isnan(e));
23312331
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
23362336
end
23372337

23382338
% forces a minimum relative error
23392339
k = (e < opt.minerror);
23402340
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
23452345
end
23462346

23472347
% ajusts component errors using a priori factor ratio
23482348
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
23532353
end
23542354

23552355

@@ -2365,14 +2365,14 @@
23652365

23662366
switch dim
23672367
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(:)));
23702370
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(:)));
23732373
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(:)));
23762376
end
23772377
y = reshape(y,size(id3));
23782378

@@ -2384,8 +2384,8 @@
23842384
% azimuth/longitude LAMBDA and polar/latitude GAMMA angles (in radian)
23852385

23862386
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);
23892389

23902390

23912391
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)