Changeset 944


Ignore:
Timestamp:
May 20, 2016, 6:19:16 PM (8 years ago)
Author:
sommeria
Message:

merge_proj_polar updated

Location:
trunk/src
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_cells.m

    r924 r944  
    263263        if ~isempty(ind_dim)
    264264            DimIndices=[DimIndices ind_dim]; %update the list of dim indices included in DimCell
    265             if check_var && CoordSize(ind_dim)==2 % determine the size of the coordinate in case of coordinate definition limited to lower and upper bounds
     265            if check_var & CoordSize(ind_dim)==2 % determine the size of the coordinate in case of coordinate definition limited to lower and upper bounds
    266266                if isvector(Data.(ListVarName{ivardim}))
    267267                    if numel(Data.(ListVarName{ivardim}))>2
  • trunk/src/series/civ_series.m

    r938 r944  
    550550        nbvar=length(Data.ListVarName);
    551551        Data.VarAttribute{nbvar}.Role='errorflag';
    552         Data.Civ1_FF=fix(Param.ActionInput.Fix1,Data.Civ1_F,Data.Civ1_C,Data.Civ1_U,Data.Civ1_V);
     552        Data.Civ1_FF=int8(fix(Param.ActionInput.Fix1,Data.Civ1_F,Data.Civ1_C,Data.Civ1_U,Data.Civ1_V));
    553553        Data.CivStage=2;
    554554    end
     
    595595        Data.Civ1_U_smooth(ind_good)=Ures;% take the interpolated (smoothed) velocity values for good vectors, keep 0 for the others
    596596        Data.Civ1_V_smooth(ind_good)=Vres;
    597         Data.Civ1_FF(ind_good)=FFres;
     597        Data.Civ1_FF(ind_good)=int8(FFres);
    598598        disp('patch1 performed')
    599599    end
  • trunk/src/series/merge_proj_polar.m

    r943 r944  
    146146%% define the name for result file (with path=RootPath{1})
    147147OutputDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
    148 OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},'.nc','_1',i1_series{1}(1));
    149 CheckOverwrite=1;%default
    150 if isfield(Param,'CheckOverwrite')
    151     CheckOverwrite=Param.CheckOverwrite;
    152 end
    153 if ~CheckOverwrite && exist(OutputFile,'file')
    154     disp(['existing output file ' OutputFile ' already exists, skip to next field'])
    155     return% skip iteration if the mode overwrite is desactivated and the result file already exists
    156 end
     148% OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},'.nc','_1',i1_series{1}(1));
     149% CheckOverwrite=1;%default
     150% if isfield(Param,'CheckOverwrite')
     151%     CheckOverwrite=Param.CheckOverwrite;
     152% end
     153% if ~CheckOverwrite && exist(OutputFile,'file')
     154%     disp(['existing output file ' OutputFile ' already exists, skip to next field'])
     155%     return% skip iteration if the mode overwrite is desactivated and the result file already exists
     156% end
    157157
    158158if ~isfield(Param,'InputFields')
    159159    Param.InputFields.FieldName='';
    160160end
    161 
    162 %% prepare output file content
    163 %     TimeData.ListGlobalAttribute={'Conventions','Project','CoordUnit','TimeUnit','ZPos'};
    164 %     TimeData.Conventions='uvmat';
    165 %     TimeData.Project='2016_Circumpolar';
    166 %     TimeData.CoordUnit='cm';
    167 %     TimeData.TimeUnit='s';
    168 %     TimeData.ZPos=0;
    169 %     TimeData.ListVarName={'time','radius','azimuth','U','V','curl','div'};
    170 %     TimeData.VarDimName={'time','radius','azimuth',{'time','radius','azimuth'},{'time','radius','azimuth'}...
    171 %                         {'time','radius','azimuth'},{'time','radius','azimuth'}};
    172 %                     TimeData.VarAttribute{1}.Role='';
    173 %                     TimeData.VarAttribute{2}.Role='';
    174 %                     TimeData.VarAttribute{3}.Role='';
    175 %                     TimeData.VarAttribute{4}.Role='vector_x';
    176 %                     TimeData.VarAttribute{5}.Role='vector_y';
    177 %                     TimeData.VarAttribute{6}.Role='scalar';
    178 %                     TimeData.VarAttribute{7}.Role='scalar';
    179 %                     TimeData.time=nan(1,NbField);
    180 %                     TimeData.radius=radius_shifted;
    181 %                     TimeData.azimuth=azimuth_arclength;
    182 %                     nby=numel(radius);
    183 %                     nbx=numel(azimuth);
    184 %                     TimeData.U=nan(NbField,nby,nbx);
    185 %                     TimeData.V=nan(NbField,nby,nbx);
    186 %                     TimeData.curl=nan(NbField,nby,nbx);
    187 %                     TimeData.div=nan(NbField,nby,nbx);
    188                    
    189 %     if ~isempty(timeread)
    190 %         MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'Time'}];
    191 %         MergeData.Time=timeread;
    192 %     end
    193    
    194     % time unit
    195 %     if isfield(Data{1},'TimeUnit')
    196 %         TimeUnit=Data{1}.TimeUnit;
    197 %         for iview =2:numel(Data)
    198 %             if ~(isfield(Data{iview},'TimeUnit')&& isequal(Data{iview}.TimeUnit,TimeUnit))
    199 %                 TimeUnit=[];%TimeUnit not the same for all fields
    200 %             end
    201 %         end
    202 %         if ~isempty(TimeUnit)
    203 %             MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'TimeUnit'}];
    204 %             MergeData.TimeUnit=TimeUnit;
    205 %         end
    206 %     end
    207161
    208162
     
    309263%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    310264tstart=tic; %used to record the computing time
    311 
     265CheckOverwrite=1;%default
     266if isfield(Param,'CheckOverwrite')
     267    CheckOverwrite=Param.CheckOverwrite;
     268end
    312269
    313270for index=1:NbField
  • trunk/src/struct2nc.m

    r943 r944  
    118118            case {'single','double'}
    119119                VarType='nc_float'; % store all floating reals as single
    120             case {'uint8','int16','uint16','int32','uint32','int64','uint64'}
     120            case {'int8','uint8','int16','uint16','int32','uint32','int64','uint64'}
    121121                VarType='nc_int';
    122122            case  'logical'
  • trunk/src/transform_field/signal_spectrum.m

    r924 r944  
    8080            DataOut.TransformInput.IndexRange(ilist,1:2)=str2num(answer{ilist+1});
    8181        end
     82        if DataOut.TransformInput.IndexRange(1,2)-DataOut.TransformInput.IndexRange(1,1)<DataOut.TransformInput.WindowLength
     83            msgbox_uvmat('ERROR','WindowLength must be smaller than the total time index range')
     84            return
     85        end
     86        huvmat=findobj(allchild(0),'Tag','uvmat');
     87        UvData=get(huvmat,'UserData');
     88        Data=UvData.PlotAxes;
     89        YName=Data.ListVarName{1};
     90        XName=Data.ListVarName{2};
     91        yindex=DataOut.TransformInput.IndexRange(2,:);
     92        y=Data.(YName)(yindex);
     93        xindex=DataOut.TransformInput.IndexRange(3,:);
     94        x=Data.(XName)(xindex);
     95        haxes=findobj(huvmat,'Tag','PlotAxes');
     96        axes(haxes);
     97        hbounds=findobj(haxes,'Tag','Bounds');
     98        if isempty(hbounds)
     99        hbounds=rectangle('Position',[x(1) y(1) x(2)-x(1) y(2)-y(1)],'Tag','Bounds');
     100        else
     101            set(hbounds,'Position',[x(1) y(1) x(2)-x(1) y(2)-y(1)])
     102        end
    82103    end
    83104    return
     
    90111
    91112%% get the variable to process
     113if  ~isfield(DataIn,Param.TransformInput.VariableName)
     114    return
     115end
    92116Var= DataIn.(Param.TransformInput.VariableName);%variable to analyse
    93117if isfield(Param.TransformInput,'IndexRange')
     
    128152end
    129153
    130 %% claculate the spectrum
     154%% calculate the spectrum
    131155specmean=0;% mean spectrum initialisation
    132156cospecmean=0;
Note: See TracChangeset for help on using the changeset viewer.