Skip to content

Commit 9d6a248

Browse files
committed
* qp_getdata: DimFlags = cat(1,DataProps.DimFlag) doesn't work since empty DimFlag arrays for separators don't contribute and then the indices are messed up, recoded.
* swanfil: remove unnecessary code * qp_updatefieldprop: bugfix
1 parent bffedc0 commit 9d6a248

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/tools_lgpl/matlab/quickplot/progsrc/private/qp_updatefieldprop.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ function qp_updatefieldprop(UD)
527527
numberLength = ceil(log10(nStations+1));
528528
numberFormat = strcat('%-',num2str(numberLength),'i');
529529
stationNumbers = sprintf(numberFormat, 1:nStations);
530-
stationNames = cat(2,repmat('station ',nStations,1),reshape(stationNumbers,[Statw,nStations])');
530+
stationNames = cat(2,repmat('station ',nStations,1),reshape(stationNumbers,[numberLength,nStations])');
531531
stationNames = cellstr(stationNames);
532532
end
533533
if showStationNames

src/tools_lgpl/matlab/quickplot/progsrc/private/swanfil.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,6 @@
260260
% -----------------------------------------------------------------------------
261261
function S=readsts(FI,Props,t)
262262
%======================== SPECIFIC CODE =======================================
263-
if nargin==2
264-
t=':';
265-
end
266263
if isfield(FI,'Directions')
267264
if ~isempty(Props.Fld)
268265
% remove locations at which all quantities at all times are non-specified

src/tools_lgpl/matlab/quickplot/progsrc/qp_getdata.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,13 @@
287287
DEFAULT = sort_stations('default');
288288
stationSortMethod = qp_option(FI,'sortStations','default',DEFAULT);
289289
if ~isequal(stationSortMethod,DEFAULT)
290-
% check if there is actually any data set in this file
291-
% that has a station dimension
292-
DimFlags = cat(1,DataProps.DimFlag);
293-
hasStationDim = find(DimFlags(:,ST_) ~= 0);
294-
for i = hasStationDim'
295-
% Loop over the fields that have a station dimension
296-
Stations = feval(Fcn,FI,argin{:},DataProps(i),'stations',0);
297-
[DataProps(i).QP_SortedStations,DataProps(i).QP_StationOrder] = sort_stations(Stations,stationSortMethod);
290+
for i = 1:length(DataProps)
291+
DimFlags = DataProps(i).DimFlag;
292+
if length(DimFlags) > ST_ && DimFlags(ST_) ~= 0
293+
% only for quantities that have a station dimension
294+
Stations = feval(Fcn,FI,argin{:},DataProps(i),'stations',0);
295+
[DataProps(i).QP_SortedStations,DataProps(i).QP_StationOrder] = sort_stations(Stations,stationSortMethod);
296+
end
298297
end
299298
end
300299
DataProps = separators(DataProps);

0 commit comments

Comments
 (0)