Ignore:
Timestamp:
Feb 27, 2011, 10:40:29 PM (13 years ago)
Author:
sommeria
Message:

bug fixes to deal with volumes, storage of ACTION menu in series fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_civxdata.m

    r186 r206  
    4848
    4949function [Field,VelTypeOut]=read_civxdata(filename,FieldNames,VelType)
    50 
     50%% default input
    5151if ~exist('VelType','var')
    5252    VelType=[];
     
    5858    FieldNames=[]; %default
    5959end
     60
     61%% reading data
    6062VelTypeOut=VelType;%default
    6163[var,role,units,vel_type_out_cell]=varcivx_generator(FieldNames,VelType);%determine the names of constants and variables to read
    62 [Field,vardetect,ichoice]=nc2struct(filename,var);
    63 % if isfield(Field,'Txt')
    64 %     return % error in file reading
    65 % end
     64[Field,vardetect,ichoice]=nc2struct(filename,var);%read the variables in the netcdf file
     65if isfield(Field,'Txt')
     66    return
     67end
    6668if vardetect(1)==0
    6769     Field.Txt=[ 'requested field not available in ' filename '/' VelType];
     70     return
    6871end
    6972var_ind=find(vardetect);
    7073for ivar=1:length(var_ind)
    7174    Field.VarAttribute{ivar}.Role=role{var_ind(ivar)};
    72      Field.VarAttribute{ivar}.Mesh=0.1;%typical mesh for histograms O.1 pixel
    73 %     Field.VarAttribute{ivar}.units=units{var_ind(ivar)};% not necessary: set with calc_field
     75    Field.VarAttribute{ivar}.Mesh=0.1;%typical mesh for histograms O.1 pixel
    7476end
    7577VelTypeOut=VelType;
     
    7880end
    7981
    80 %adjust for Djui:
     82%% adjust for Djui:
    8183if isfield(Field,'DjUi')
    8284    Field.ListVarName(end-2:end)=[];
     
    8688end
    8789
    88 %renaiming for standard conventions
     90%% renaming for standard conventions
    8991Field.NbCoord=Field.nb_coord;
    9092Field.NbDim=Field.nb_dim;
    9193
    92 % CivStage
     94%% CivStage
    9395if isfield(Field,'patch2')&& isequal(Field.patch2,1)
    9496    Field.CivStage=6;
     
    178180function [var,role,units,vel_type_out]=varcivx_generator(FieldNames,vel_type)
    179181
    180 %default input values
     182%% default input values
    181183if ~exist('vel_type','var'),vel_type=[];end;
    182184if iscell(vel_type),vel_type=vel_type{1}; end;%transform cell to string if needed
    183 % if ~exist('display','var'),display=[];end;
    184185if ~exist('FieldNames','var'),FieldNames={'ima_cor'};end;%default scalar
    185186if ischar(FieldNames), FieldNames={FieldNames}; end;
    186187
    187 %select the priority order for automatic vel_type selection
     188%% select the priority order for automatic vel_type selection
    188189testder=0;
    189190for ilist=1:length(FieldNames)
     
    221222vel_type_out=vel_type_out';
    222223
    223 %determine names of netcdf variables to read
     224%% determine names of netcdf variables to read
    224225var={'X','Y','Z','U','V','W','C','F','FF'};
    225226role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag'};
     
    234235end
    235236
    236  
    237 %-------------------------
    238 %determine  var names to read
    239 %--------------------------------------
     237%------------------------------------------------------------------------ 
     238%--- determine  var names to read
    240239function varin=varname1(vel_type,FieldNames)
    241 
     240%------------------------------------------------------------------------
    242241testder=0;
    243242C1='';
Note: See TracChangeset for help on using the changeset viewer.