Changeset 190 for trunk


Ignore:
Timestamp:
Feb 2, 2011, 1:23:28 AM (14 years ago)
Author:
sommeria
Message:

various bug repairs and cleaning, pb of dates in french with check_files

Location:
trunk/src/series
Files:
3 edited

Legend:

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

    r169 r190  
    368368                end
    369369             end   
     370
    370371             % coordinate transform (or other user defined transform)
    371372             if ~isempty(transform_fct)
     
    422423                    end
    423424                end
    424 %             else
    425 %                 nbmissing=nbmissing+1;
    426 %             end
    427425        end
    428426    end %end averaging loop
     
    447445        DataMean.Time_end=time(end,num_i1{end}(end),num_j1{end}(end));
    448446    end
    449    
     447
    450448    %writing the result file
    451449   if testima   
    452 %        if NbSlice==1
    453450        [filemean]=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.png',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end),subdir_result);
    454 %        else % label the file number by the slice # for simplicity
    455 %           [filemean]=name_generator(filebase_out,i_slice,1,'.png','_i');
    456 %        end
    457451        if exist(filemean,'file')
    458452            backupfile=filemean;
     
    485479            DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {'Time','Time_end'}];
    486480        end 
    487 %         if NbSlice==1
    488           filemean=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.nc',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end),subdir_result);
    489 %         else % label the file number by the slice # for simplicity
    490 %           [filemean]=name_generator(filebase_out,i_slice,1,'.nc','_i');
    491 %         end
     481        filemean=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.nc',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end),subdir_result);
    492482        if exist(filemean,'file')
    493483            backupfile=filemean;
  • trunk/src/series/check_files.m

    r169 r190  
    8888        Tabchar=message;
    8989    else
    90         datnum=[];
     90        datnum=zeros(1,nbfield);
    9191        Tabchar={};
    9292        %LOOP ON SLICES
     
    109109                    else
    110110                        datfile=dir(file);
    111                         datnum(ifile)=datenum(datfile.date);
     111                        if isfield(datfile,'datenum')
     112                            datnum(ifile)=datfile.datenum;
     113                        end
    112114                        filefound(ifile)={datfile.name};
    113115                        lastfield='';
  • trunk/src/series/time_series.m

    r169 r190  
    3737WaitbarPos=get(hseries.waitbar_frame,'Position'); %position of the waitbar frame
    3838
    39 %projection object
     39%% projection object
    4040test_object=get(hseries.GetObject,'Value');
    4141if test_object
     
    5252end
    5353
    54 % root names
     54%% root names
    5555if iscell(Series.RootPath)
    5656    RootPath=Series.RootPath;
     
    7979nbfield=size(num_i1{1},1)*size(num_i1{1},2); %number of fields in the time series
    8080
    81 %Number of input series: this function  accepts only a single input file series
     81%Number of input series: this function  accepts only one or two input file series (sub_field is used in the latter case)
    8282nbview=length(RootPath);
    83 if nbview==2
    84     %TODO: choose between difference and two series
    85 elseif nbview>2  % TODO: make multiple series
    86 %     RootPath=RootPath(1:2);
    87 %     set(hseries.RootPath,'String',RootPath)
    88 %     SubDir=SubDir(1:2);
    89 %     set(hseries.SubDir,'String',SubDir)
    90 %     RootFile=RootFile(1:2);
    91 %     set(hseries.RootFile,'String',RootFile)
    92 %     NomType=NomType(1:2);
    93 %     %set(hseries.NomType,'String',NomType)
    94 %     FileExt=FileExt(1:2);
    95 %     set(hseries.FileExt,'String',FileExt)
    96 %     nbview=2;
    97 end
    9883
    9984%determine image type
     
    147132       return
    148133    end
    149     %hhget_field=guidata(hget_field);%handles of GUI elements in get_field
    150134    SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
    151135    if isempty(SubField)
     
    155139        SubField=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
    156140    end
    157 %     if isequal(get(hhget_field.menu_coord,'Visible'),'on')
    158 %         list_transform=get(hhget_field.menu_coord,'String');
    159 %         val_list=get(hhget_field.menu_coord,'Value');
    160 %         transform=list_transform{val_list};
    161 %     end
    162141end
    163142
    164143%detect whether the two files are 'images' or 'netcdf'
    165 % testima=0;
    166 % testvol=0;
     144
    167145testcivx=0;
    168 % testnc=0;
    169146FileExt=get(hseries.FileExt,'String');
    170 % for iview=1:nbview
    171 %      ext=FileExt{iview};
    172 %      form=imformats(ext([2:end]));
    173 %      if isequal(lower(ext),'.vol')
    174 %          testvol=testvol+1;
    175 %      elseif ~isempty(form)||isequal(lower(ext),'.avi')% if the extension corresponds to an image format recognized by Matlab
    176 %          testima=testima+1;
    177 %      elseif isequal(ext,'.nc')
    178 %          testnc=testnc+1;
    179 %      end
    180 % end
    181 % if testvol
    182 %     msgbox_uvmat('ERROR','volume images not implemented yet')
    183 %     return
    184 % end
    185 % if testnc~=nbview && testima~=nbview && testvol~=nbview
    186 %     msgbox_uvmat('need a set of images or a set of netcdf files with the same fields as input','ERROR')
    187 %     return
    188 % end
    189147if ~isequal(FieldName,{'get_field...'})
    190148    testcivx=isequal(FileType{1},'netcdf');
     
    200158end
    201159
    202 %Calibration data and timing: read the ImaDoc files
     160%% Calibration data and timing: read the ImaDoc files
    203161mode=''; %default
    204162timecell={};
     
    245203end
    246204
    247 %check coincidence in time
     205%% check coincidence in time
    248206multitime=0;
    249207if length(timecell)==0
     
    275233end
    276234
    277 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
     235%% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
    278236subdir_result='time_series';
    279 if ~exist(fullfile(RootPath{1},subdir_result),'dir')
    280     dircur=pwd; %record current working directory
    281     cd(RootPath{1})% goes to the iamge directory
    282     [m1,m2,m3]=mkdir(subdir_result);
    283     if ~isequal(m2,'')
    284          msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
    285     end
    286     [xx,msg2] = fileattrib(subdir_result,'+w','g'); %yield writing access (+w) to user group (g)
    287     if ~strcmp(msg2,'')
    288         msgbox_uvmat('ERROR',['pb of permission for ' subdir_result ': ' msg2])%error message for directory creation
    289         cd(dircur)
    290         return
    291     end
    292     cd(dircur) %back to the initial working directory
    293 end
     237pathdir=fullfile(RootPath{1},subdir_result);
     238while exist(pathdir,'dir')
     239    pathdir=[pathdir '.0'];
     240end
     241[m1,m2,m3]=mkdir(pathdir);
     242if ~isequal(m2,'')
     243     msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
     244end
     245[xx,msg2] = fileattrib(pathdir,'+w','g'); %yield writing access (+w) to user group (g)
     246if ~strcmp(msg2,'')
     247    msgbox_uvmat('ERROR',['pb of permission for ' subdir_result ': ' msg2])%error message for directory creation
     248    return
     249end
     250
    294251filebase_out=filebase{1};
    295252NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1));
    296253
    297 % coordinate transform or other user defined transform
     254%% coordinate transform or other user defined transform
    298255transform_fct=[];%default
    299256if isfield(Series,'transform_fct')
     
    301258end
    302259
    303 % to update:
     260%% velocity type
    304261VelType_str=get(hseries.VelTypeMenu,'String');
    305262VelType_val=get(hseries.VelTypeMenu,'Value');
     
    311268end
    312269
    313 %LOOP ON SLICES
     270%% LOOP ON SLICES
    314271for i_slice=1:NbSlice
    315272     dt=[];
Note: See TracChangeset for help on using the changeset viewer.