Ignore:
Timestamp:
Jul 30, 2024, 6:44:35 PM (2 months ago)
Author:
sommeria
Message:

various bugs repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_series.m

    r1164 r1165  
    456456                    par_civ1.NbSlice_j=par_civ1.NbSlice;
    457457                end
    458             end
    459         else
    460             maskname=Param.ActionInput.Civ1.Mask;
    461         end
    462         if strcmp(maskoldname,maskname)% mask exist, not already read in civ1
    463             par_civ1.Mask=mask; %use mask already opened
    464         else
    465             if ~isempty(regexp(maskname,'(^http://)|(^https://)', 'once'))|| exist(maskname,'file')
    466                 try
    467                     par_civ1.Mask=imread(maskname);%update the mask, an store it for future use
    468                 catch ME
    469                     if ~isempty(ME.message)
    470                         errormsg=['error reading input image: ' ME.message];
    471                         disp_uvmat('ERROR',errormsg,checkrun)
    472                         return
     458            else
     459                maskname=Param.ActionInput.Civ1.Mask;
     460            end
     461            if strcmp(maskoldname,maskname)% mask exist, not already read in civ1
     462                par_civ1.Mask=mask; %use mask already opened
     463            else
     464                if ~isempty(regexp(maskname,'(^http://)|(^https://)', 'once'))|| exist(maskname,'file')
     465                    try
     466                        par_civ1.Mask=imread(maskname);%update the mask, an store it for future use
     467                    catch ME
     468                        if ~isempty(ME.message)
     469                            errormsg=['error reading input image: ' ME.message];
     470                            disp_uvmat('ERROR',errormsg,checkrun)
     471                            return
     472                        end
    473473                    end
    474                 end
    475             else
    476                 par_civ1.Mask=[];
    477             end
    478             mask=par_civ1.Mask;
    479             maskoldname=maskname;
    480         end
    481        
     474                else
     475                    par_civ1.Mask=[];
     476                end
     477                mask=par_civ1.Mask;
     478                maskoldname=maskname;
     479            end
     480        end
    482481       
    483482        % case of input grid
     
    495494            return
    496495        end
    497        
    498         if exist('ncfile','var')
    499             CivFile=ncfile;
    500             % [Data,tild,tild,errormsg]=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format
    501             % if ~isempty(errormsg)
    502             %     disp_uvmat('ERROR',errormsg,checkrun)
    503             %     return
    504             % end
    505             [Data,tild,tild,errormsg]=nc2struct(CivFile);%read civ1 and fix1 data in the existing netcdf file
    506         elseif isfield(Param,'Civ1_X')
    507             Data.ListGlobalAttribute={};
    508             Data.ListVarName={};
    509             Data.VarDimName={};
    510             Data.Civ1_X=Param.Civ1_X;
    511             Data.Civ1_Y=Param.Civ1_Y;
    512             Data.Civ1_U=Param.Civ1_U;
    513             Data.Civ1_V=Param.Civ1_V;
    514             Data.Civ1_FF=Param.Civ1_FF;
    515         end
     496%         
     497%         if exist('ncfile','var')
     498%             CivFile=ncfile;
     499%             % [Data,tild,tild,errormsg]=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format
     500%             % if ~isempty(errormsg)
     501%             %     disp_uvmat('ERROR',errormsg,checkrun)
     502%             %     return
     503%             % end
     504%             [Data,tild,tild,errormsg]=nc2struct(CivFile);%read civ1 and fix1 data in the existing netcdf file
     505%             if ~isempty(errormsg)
     506%                 disp(errormsg)
     507%                 return
     508%             end
     509%         elseif isfield(Param,'Civ1_X')
     510%             Data.ListGlobalAttribute={};
     511%             Data.ListVarName={};
     512%             Data.VarDimName={};
     513%             Data.Civ1_X=Param.Civ1_X;
     514%             Data.Civ1_Y=Param.Civ1_Y;
     515%             Data.Civ1_U=Param.Civ1_U;
     516%             Data.Civ1_V=Param.Civ1_V;
     517%             Data.Civ1_FF=Param.Civ1_FF;
     518%         end
    516519    end
    517520
Note: See TracChangeset for help on using the changeset viewer.