Ignore:
Timestamp:
May 19, 2013, 11:37:49 PM (11 years ago)
Author:
sommeria
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/aver_stat.m

    r633 r635  
    9494nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    9595nbfield=nbfield_j*nbfield_i; %total number of fields
    96 [first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);
    97 if ~isempty(errormsg),display(errormsg),return,end
    9896
    9997%% determine the file type on each line from the first input file
     
    140138elseif CheckNc{1}
    141139    FileExtOut='.nc';% write result as .nc files for netcdf inputs
    142 else 
     140else
    143141    msgbox_uvmat('ERROR',['invalid file type input ' FileType{1}])
    144142    return
    145143end
    146144if nbview==2 && ~isequal(CheckImage{1},CheckImage{2})
    147         msgbox_uvmat('ERROR','input must be two image series or two netcdf file series')
     145    msgbox_uvmat('ERROR','input must be two image series or two netcdf file series')
    148146    return
    149147end
    150 %NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series
     148
     149%% settings for the output file
    151150NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file
     151first_i=i1_series{1}(1);
     152last_i=i1_series{1}(end);
     153if isempty(j1_series{1})% if there is no second index j
     154    first_j=1;last_j=1;
     155else
     156    first_j=j1_series{1}(1);
     157    last_j=j1_series{1}(end);
     158end
    152159
    153160%% Set field names and velocity types
     
    177184for index=1:nbfield
    178185    update_waitbar(WaitbarHandle,index/nbfield)
    179     if ~isempty(RUNHandle)&& ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     186    if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    180187        disp('program stopped by user')
    181188        break
     
    238245       
    239246        %%%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
    240         %update sum
    241247        if nbfiles==1 %first field
    242248            time_1=[];
     
    255261                siz=size(Field.(VarName));
    256262                if ~isequal(DataOut.(VarName),0)&& ~isequal(siz,sizmean)
    257                     msgbox_uvmat('ERROR',['unequal size of input field ' VarName ', need to project  on a grid'])
     263                    displ_uvmat('ERROR',['unequal size of input field ' VarName ', need to project  on a grid'],checkrun)
    258264                    return
    259265                else
     
    285291    end
    286292else  % time from ImaDoc prevails if it exists
    287     %         j1=1;%default
    288     %         if ~isempty(j1_series{1})
    289     %             j1=j1_series{1};
    290     %         end
    291     %DataOut.Time=time(1,i1_series{1}(1),j1);
    292     %DataOut.Time_end=time(end,i1_series{end}(end),j1_series{end}(end));
    293293    DataOut.Time=time(1);
    294294    DataOut.Time_end=time(end);
Note: See TracChangeset for help on using the changeset viewer.