Changeset 398 for trunk/src/series.m


Ignore:
Timestamp:
Apr 26, 2012, 12:12:43 PM (12 years ago)
Author:
sommeria
Message:

find_file_series corrected and rationalised, with induced transforms in uvmat, civ, series

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r393 r398  
    957957ind_shift=0;%default
    958958
    959 %determine the list of input file names
    960 nbmissing=0;
    961 % for iview=1:length(RootPath)
    962 %     %case of pairs (.nc files)
    963 %     fileinput=name_generator(fullfile(RootPath{iview},RootFile{iview}),first_i,first_j,FileExt{iview},NomType{iview},1,first_i+1,first_j+1,SubDir{iview});
    964 %     if strcmp(get(handles.Pairs,'Visible'),'on')
    965 %        pair_list=get(handles.list_pair_civ,'String');
    966 %        val=get(handles.list_pair_civ,'Value');
    967 %        pair_string=pair_list{val};
    968 %        r=regexp(pair_string,'.*\D(?<num1>[\d+|*])(?<delim>[-||])(?<num2>[\d+|*])','names');
    969 %        if ~isempty(r)
    970 %            if strcmp(r.num1,'*')%free pairs
    971 %                [tild,RootFile,i1_series,i2_series,j1_series,j2_series,tild,tild,Object]=find_file_series(fileinput);% TODO: choice pair when multiple choice
    972 
    973 %                if isempty(i2_series) %j pairs
    974 %                    ind_sel=i1_series>=i1_series>=first_i & i1_series<=last_i & j1_series>first_j & j2_series<last_j;
    975 %                    j2_series=j2_series(ind_sel);
    976 %                else%i pairs
    977 %                    if isempty(j1_series) %j pairs
    978 %                         ind_sel=i1_series>=first_i & i2_series<=last_i ;
    979 %                    else
    980 %                        ind_sel=i1_series>=first_i & i2_series<=last_i& j1_series>first_j & j1_series<last_j;
    981 %                        j1_series=j1_series(ind_sel);
    982 %                        i2_series=i2_series(ind_sel);
    983 %                    end
    984 %                end
    985 %                i1_series=i1_series(ind_sel);             
    986 %            else
    987 %                if strcmp(r.delim,'-')
    988 %                    ind_shift(1)=str2num(r.num1);
    989 %                    ind_shift(2)=str2num(r.num2);
    990 %                else
    991 %                    ind_shift(1)=-str2num(r.num1);
    992 %                    ind_shift(2)=str2num(r.num2);
    993 %                end
    994 %                [i1_series,i2_series,j1_series,j2_series,nbmissing]=find_file_indices(num_i,num_j,ind_shift,NomType{iview},mode);
    995 %            end
    996 %        end
    997 %        if isempty(i1_series)
    998 %            msgbox_uvmat('ERROR','no file in the considered range')
    999 %            return
    1000 %        end
    1001 %        if isempty(i2_series)
    1002 %            i2_series=i1_series;
    1003 %        end
    1004 %        if isempty(j2_series)
    1005 %            j2_series=j1_series;
    1006 %        end
    1007 %     else%case of images
    1008 %         [i1_series,j1_series]=meshgrid(num_i,num_j);
    1009 %         i2_series=i1_series;
    1010 %         j2_series=j1_series;
    1011 %     end
    1012 %     if length(RootPath)>1
    1013 %         i1_series_cell{iview}=i1_series;
    1014 %         i2_series_cell{iview}=i2_series;
    1015 %         j1_series_cell{iview}=j1_series;
    1016 %         j2_series_cell{iview}=j2_series;
    1017 %     end
    1018 % end
    1019959
    1020960%% defining the ACTION function handle
     
    18291769%% look for min and max indices existing in the file series and update SeriesData
    18301770errormsg='';
    1831 [RootPathSub,FileName,FileExt]=fileparts(fileinput);
    1832 [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPathSub,[FileName FileExt]);
     1771[FilePath,FileName,FileExt]=fileparts(fileinput);
     1772% detect the file type, get the movie object if relevant, and look for the corresponding file series:
     1773% the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists
     1774[RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName FileExt]);
     1775
     1776%
     1777% [RootPathSub,FileName,FileExt]=fileparts(fileinput);
     1778% [RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object]=find_file_series(RootPathSub,[FileName FileExt]);
    18331779if isempty(RootFile)&&isempty(i1_series)
    18341780    errormsg='no input file in the series';
    18351781    return
    18361782end
    1837 [tild,tild,FileExt]=fileparts(fileinput);
     1783% [tild,tild,FileExt]=fileparts(fileinput);
    18381784
    18391785MinIndex=get(handles.MinIndex,'Data');
     
    19681914%%  read image documentation file  if found%%%%%%%%%%%%%%%%%%%%%%%%%%%
    19691915ext_imadoc='';
    1970 FileBase=fullfile(RootPathSub,RootFile);
     1916FileBase=fullfile(RootPath,RootFile);
    19711917if isequal(FileExt,'.xml')||isequal(FileExt,'.civ')
    19721918    ext_imadoc=FileExt;
Note: See TracChangeset for help on using the changeset viewer.