Changeset 227 for trunk/src/read_field.m


Ignore:
Timestamp:
Mar 31, 2011, 1:42:51 PM (13 years ago)
Author:
sommeria
Message:

add function sub_field_series to apply the sub_field operation to a series of fileds (for instance subtracting a background to an image series)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_field.m

    r221 r227  
    3131ParamOut=[];
    3232errormsg='';
    33 %FieldName=ParamIn.FieldName;
    3433VelType=ParamIn.VelType;
    3534
     
    4241    end
    4342    test_civx=0;
    44     if ~strcmp(ParamOut.FieldName,'get_field...')% if get_field is not requested, look for Civx data
     43    ParamIn
     44    if ~strcmp(ParamIn.FieldName,'get_field...')% if get_field is not requested, look for Civx data
    4545        FieldList=calc_field;%list of possible fields for Civx data
    4646        ParamOut.ColorVar='';%default
    4747        field_index=strcmp(ParamOut.FieldName,FieldList);%look for ParamOut.FieldName in the list
    4848        if isempty(find(field_index,1))% ParamOut.FieldName is not in the list, check whether Civx data exist
    49             Data=nc2struct(ObjectName,'ListGlobalAttribute','absolut_time_T0','civ');
     49            'TESTnc1'
     50            Data=nc2struct(ObjectName,'ListGlobalAttribute','absolut_time_T0','civ')
    5051            if ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
    5152                ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
     
    8384        set(hhget_field.inputfile,'String',ObjectName)
    8485        set(hhget_field.list_fig,'Value',1)
     86        if exist('num','var')&&~isnan(num)
     87            set(hhget_field.TimeIndexValue,'String',num2str(num))
     88        end
    8589        funct_list=get(hhget_field.ACTION,'UserData');
    8690        funct_index=get(hhget_field.ACTION,'Value');
     
    107111            end
    108112        end
    109         set(hhget_field.attributes,'String',Tabchar);%update list of global attributes in get_field
     113        %set(hhget_field.attributes,'String',Tabchar);%update list of global attributes in get_field
    110114        ParamOut.CivStage=0;
    111115        ParamOut.VelType=[];
     116        if isfield(Field,'TimeIndex')
     117            ParamOut.TimeIndex=Field.TimeIndex;
     118        end
     119        if isfield(Field,'TimeValue')
     120            ParamOut.TimeValue=Field.TimeValue;
     121        end
    112122    end
    113123    if test_civx
     
    127137                A=read(ObjectName,num);
    128138                FieldName='image';
    129             catch
    130                 errormsg=lasterr;
     139            catch ME
     140                errormsg=ME.message;
    131141                return
    132142            end
     
    134144            try
    135145                mov=aviread(ObjectName,num);
    136             catch
    137                 errormsg=lasterr;
     146            catch ME
     147                errormsg=ME.message;
    138148                return
    139149            end
Note: See TracChangeset for help on using the changeset viewer.