|
465 | 465 | % case, we might want to sort them, but we haven't implemented that |
466 | 466 | % yet. |
467 | 467 | % |
| 468 | + timeLabels = xyz.Params(xyz.Time); |
468 | 469 | if ~isempty(crds) |
469 | 470 | sortloc = unique(xyz.XYZ(:,crds),'rows'); |
470 | 471 | nLoc = size(sortloc,1); |
471 | 472 | nVal = size(xyz.XYZ,1); |
472 | 473 | locations = xyz.XYZ(1:nLoc,crds); % alternatively use unique(...,'stable') |
473 | 474 | if nVal/nLoc == floor(nVal/nLoc) && isequal(xyz.XYZ(:,crds),repmat(locations,[nVal/nLoc 1])) |
474 | | - Times = gettimes(xyz.XYZ(1:nLoc:nVal,xyz.Time)); |
| 475 | + Times = gettimes(xyz.XYZ(1:nLoc:nVal,xyz.Time),timeLabels); |
475 | 476 | iTime = cumsum(repmat((1:nLoc)'==1,[nVal/nLoc 1])); |
476 | 477 | end |
477 | 478 | end |
478 | 479 | if isempty(iTime) |
479 | | - [Times,idum,iTime] = unique(gettimes(xyz.XYZ(:,xyz.Time),xyz.Params(xyz.Time)),'stable'); |
| 480 | + [Times,idum,iTime] = unique(gettimes(xyz.XYZ(:,xyz.Time),timeLabels),'stable'); |
480 | 481 | nLoc = hist(iTime,max(iTime)); |
481 | 482 | end |
482 | 483 | % |
@@ -524,12 +525,12 @@ function Local_write_samples(filename,header,format,xyz) |
524 | 525 | fclose(fid); |
525 | 526 |
|
526 | 527 |
|
527 | | -function Times = gettimes(Times,ColLabels) |
| 528 | +function Times = gettimes(Times,timeLabels) |
528 | 529 | if size(Times,2)==2 % gpp => 20140118 105120 |
529 | 530 | d = Times(:,1); |
530 | 531 | s = Times(:,2); |
531 | 532 | else |
532 | | - switch ColLabels{1} |
| 533 | + switch lower(timeLabels{1}) |
533 | 534 | case 'time (min)' |
534 | 535 | Times = Times/1440; |
535 | 536 | return |
|
0 commit comments