Changeset 1119


Ignore:
Timestamp:
Aug 16, 2022, 2:02:02 PM (19 months ago)
Author:
sommeria
Message:
 
Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/script_readnc.m

    r890 r1119  
    1 DataFolder=''; %TODO: put the actual path to start browser
    2 DataFolder='C:\Users\sommeria\Documents\MATLAB_WORK\UVMAT_DEMO_SOURCES\UVMAT_DEMO03_PIVchallenge_2005C';
     1DataFolder='.fsnet/project/meige/2019/19TORE';
     2fileinput={'Tore_a8b40_T22s_N047_A1cm.png.civ.mproj.tfilter_1'}
    33fileinput=uigetfile_uvmat('pick an input file',DataFolder);
    44Data=nc2struct(fileinput);
  • trunk/src/series.m

    r1114 r1119  
    25222522FieldList_1=get(handles.FieldName_1,'String'); % previous list as default
    25232523if ~iscell(FieldList_1),FieldList_1={FieldList_1};end
    2524 CheckList_1=1; % indicate whether FieldName_1 has been updated
     2524CheckPivData_1=0; % indicate whether FieldName_1 has been updated with civ data, 0 by default
    25252525handles_coord=[handles.Coord_x handles.Coord_y handles.Coord_z handles.Coord_x_title handles.Coord_y_title handles.Coord_z_title];
    25262526if VelTypeRequest && numel(iview_civ)>=1
     
    25412541        set(handles.VelType_title_1,'Visible','on')
    25422542        FieldList_1=[set_field_list('U','V');{'C'};{'add_field...'}]; % standard menu for civx data
    2543         CheckList_1=1;
     2543        CheckPivData_1=1;
    25442544        set(handles.FieldName_1,'Value',1); % velocity vector choice by default
    25452545    else
     
    25672567            end
    25682568        end
    2569         if ~isempty(FieldList)
     2569        if ~isempty(FieldList)iview_netcdf
    25702570            if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName)))||...
    25712571                    isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName)))
     
    25842584        set(handles.Field_text,'Visible','off')
    25852585    end
    2586    
    25872586    set(handles_coord,'Visible','on')
    25882587    if isempty(find(strcmp('add_field...',FieldList)))
     
    25912590    if FieldNameRequest_1 && numel(iview_netcdf)>=2
    25922591        set(handles.FieldName_1,'Visible','on')
    2593         if CheckList_1==0        % not civ input made
     2592        set(handles.Field_text_1,'Visible','on')
     2593        if CheckPivData_1==0        % not civ input made
     2594            FieldList_1={'add_field...'}
    25942595            ListVarName=SeriesData.FileInfo{iview_netcdf(2)}.ListVarName;
    25952596            ind_var=get(handles.FieldName,'Value'); % indices of previously selected variables
    25962597            for ilist=1:numel(ind_var)
    25972598                if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName)))
    2598                     FieldList_1={}; % previous choice not consistent with new input field
     2599                    %FieldList_1={}; % previous choice not consistent with new input field
    25992600                    set(handles.FieldName_1,'Value',1)
    26002601                    break
     
    26072608            end
    26082609            if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName)))
    2609                 FieldList_1={};
     2610                FieldList_1={'add_field...'};
    26102611                warn_coord=1;
    26112612            end
     
    30273028field_index=get(handles.FieldName_1,'Value');
    30283029field=field_str{field_index(1)};
    3029 if isequal(field,'add_field...')
     3030if strcmp(field,'add_field...')
     3031    %iview=find(ismember(SeriesData.FileType,{'netcdf','civx','civdata'})); % all nc files, icluding civ
    30303032    hget_field=findobj(allchild(0),'name','get_field');
    30313033    if ~isempty(hget_field)
     
    30333035    end
    30343036    Param=read_GUI(handles.series);
    3035     Param.InputTable=Param.InputTable(1,:);
     3037    InputTable=Param.InputTable(2,:);
    30363038    % check the existence of the first file in the series
    30373039    first_j=[];
     
    30413043    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
    30423044    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
    3043     FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
    3044         Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     3045    FirstFileName=fullfile_uvmat(Param.InputTable{2,1},Param.InputTable{2,2},Param.InputTable{2,3},...
     3046        Param.InputTable{2,5},Param.InputTable{2,4},i1,i2,j1,j2);
    30453047    if exist(FirstFileName,'file')
    30463048        ParamIn.SeriesInput=1;
     
    30653067                set(handles.FieldName,'Value',2) % set menu to 'velocity
    30663068        end
    3067         if ~strcmp(GetFieldData.FieldOption,'civdata...')
    3068             TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
    3069             switch TimeNameStr
    3070                 case 'file index'
    3071                     set(handles.TimeName,'String','');
    3072                 case 'attribute'
    3073                     set(handles.TimeName,'String',['att:' GetFieldData.Time.TimeName]);
    3074                 case 'variable'
    3075                     set(handles.TimeName,'String',['var:' GetFieldData.Time.TimeName])
    3076                     set(handles.NomType,'String','*')
    3077                     set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])% A VERIFIER !!!!!!
    3078                     set(handles.FileIndex,'String','')
    3079                     ParamIn.TimeVarName=GetFieldData.Time.TimeName;
    3080                 case 'matrix_index'
    3081                     set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]);
    3082                     set(handles.NomType,'String','*')
    3083                     set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
    3084                     set(handles.FileIndex,'String','')
    3085                     ParamIn.TimeDimName=GetFieldData.Time.TimeName;
    3086             end
    3087         end
     3069%         if ~strcmp(GetFieldData.FieldOption,'civdata...')
     3070%             TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
     3071%             switch TimeNameStr
     3072%                 case 'file index'
     3073%                     set(handles.TimeName,'String','');
     3074%                 case 'attribute'
     3075%                     set(handles.TimeName,'String',['att:' GetFieldData.Time.TimeName]);
     3076%                 case 'variable'
     3077%                     set(handles.TimeName,'String',['var:' GetFieldData.Time.TimeName])
     3078%                     set(handles.NomType,'String','*')
     3079%                     set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])% A VERIFIER !!!!!!
     3080%                     set(handles.FileIndex,'String','')
     3081%                     ParamIn.TimeVarName=GetFieldData.Time.TimeName;
     3082%                 case 'matrix_index'
     3083%                     set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]);
     3084%                     set(handles.NomType,'String','*')
     3085%                     set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     3086%                     set(handles.FileIndex,'String','')
     3087%                     ParamIn.TimeDimName=GetFieldData.Time.TimeName;
     3088%             end
     3089%         end
    30883090        set(handles.FieldName_1,'Value',1)
    30893091        set(handles.FieldName_1,'String',[FieldList; {'add_field...'}]);
  • trunk/src/series/sliding_average.m

    r1114 r1119  
    179179if isfield(Param,'InputFields')
    180180    InputFields{1}=Param.InputFields;
    181 end5.804
     181end
    182182
    183183nbfiles=0;
  • trunk/src/series/time_series.m

    r1114 r1119  
    9797        msgbox_uvmat('WARNING','''time_series'' uses only one or two input lines (two for substraction). To concatene fields first use ''merge_proj''');
    9898    end
    99     if size(Param.InputTable,1)>=2
    100         answer=msgbox_uvmat('INPUT_Y-N','substract the two input file series?');
    101         if strcmp(answer,'Yes')
    102             if isempty(Param.FieldTransform.TransformName)
    103                 set(hhseries.TransformName,'value',2) %select sub_field
    104             end
    105         else
    106             set(hhseries.InputTable,'Data',Param.InputTable(1,:))
    107         end
    108     end
     99%     if size(Param.InputTable,1)>=2
     100%         answer=msgbox_uvmat('INPUT_Y-N','substract the two input file series with sub_field.m?');
     101%         if strcmp(answer,'Yes')
     102%             if isempty(Param.FieldTransform.TransformName)
     103%                 set(hhseries.TransformName,'value',2) %select sub_field
     104%             end
     105%         else
     106%             set(hhseries.InputTable,'Data',Param.InputTable(1,:))
     107%         end
     108%     end
    109109   
    110110    % check the existence of the first and last file in the series
  • trunk/src/transform_field/ima_filter.m

    r1107 r1119  
    2929%=======================================================================
    3030
    31 function DataOut=ima_filter(DataIn,Param)
     31function DataOut=ima_filter(DataIn,Param,DataIn_1)
    3232
    3333%% request input parameters
     
    7676    end
    7777end
     78if exist('DataIn_1','var')
     79    [CellInfo,NbDim,errormsg]=find_field_cells(DataIn_1);
     80for icell=1:numel(CellInfo)
     81    if isfield(CellInfo{icell},'CoordType')&& strcmp(CellInfo{icell}.CoordType,'grid')
     82        for ivar=1:numel(CellInfo{icell}.VarIndex)
     83            VarName=DataIn_1.ListVarName{CellInfo{icell}.VarIndex(ivar)};
     84            Atype=class(DataIn_1.(VarName));% detect integer 8 or 16 bits
     85            if numel(size(DataIn_1.(VarName)))==3
     86                DataOut.(VarName)=filter2(Mfiltre,sum(DataIn_1.(VarName),3));%filter the input image, after summation on the color component (for color images)
     87                DataOut.(VarName)=uint16(DataOut.(VarName)); %transform to 16 bit images
     88            else
     89                DataOut.(VarName)=filter2(Mfiltre,DataIn_1.(VarName));
     90                DataOut.(VarName)=feval(Atype,DataOut.(VarName));%transform to the initial image format
     91            end
     92        end
     93    end
     94end
     95end
     96
    7897 
Note: See TracChangeset for help on using the changeset viewer.