Changeset 7245
- Timestamp:
- 01/31/11 08:47:57 (14 years ago)
- Location:
- issm/trunk/src/m/utils/Basins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/Basins/basinzoom.m
r7140 r7245 1 function varargout=basinzoom( varargin)1 function varargout=basinzoom(options) 2 2 %ANTZOOM - zoom on a basin in Antarctica or Greenland. 3 3 % … … 6 6 % 7 7 % Usage: 8 % varargout=basinzoom(region,unitmultiplier) 9 10 %initialize options 11 options=pairoptions(varargin{:}); 8 % varargout=basinzoom(options) 12 9 13 10 %recover some options, and set defaults 11 14 12 unitmultiplier=getfieldvalue(options,'unit',NaN); 15 13 basin=getfieldvalue(options,'basin'); 16 hemisphere=getfieldvalue(options,'hemisphere',+1);17 basindeltax=getfieldvalue(options,'basindeltax',300000); %100 km default18 basindeltay=getfieldvalue(options,'basindeltay',300000);19 14 20 if hemisphere==+1, 21 central_meridian=getfieldvalue(options,'central_meridian',45); 22 standard_parallel=getfieldvalue(options,'standard_parallel',70); 15 if exist(options,'basindelta'), 16 17 basindeltax=getfieldvalue(options,'basindelta',300000); 18 basindeltay=getfieldvalue(options,'basindelta',300000); 23 19 else 24 central_meridian=getfieldvalue(options,'central_meridian',0);25 standard_parallel=getfieldvalue(options,'standard_parallel',71);20 basindeltax=getfieldvalue(options,'basindeltax',300000); %100 km default 21 basindeltay=getfieldvalue(options,'basindeltay',300000); 26 22 end 27 23 … … 36 32 long=names{i,2}; 37 33 lat=names{i,3}; 34 hemisphere=names{i,4}; 38 35 found=1; 39 36 break; … … 43 40 if ~found, 44 41 error(['basinzoom error message: cannot find basin ' basin '. Use isbasin to determine a basin name.']); 42 end 43 44 if hemisphere==+1, 45 central_meridian=getfieldvalue(options,'central_meridian',45); 46 standard_parallel=getfieldvalue(options,'standard_parallel',70); 47 else 48 central_meridian=getfieldvalue(options,'central_meridian',0); 49 standard_parallel=getfieldvalue(options,'standard_parallel',71); 45 50 end 46 51 -
issm/trunk/src/m/utils/Basins/showbasins.m
r7140 r7245 11 11 % 12 12 13 %initialize options 14 options=pairoptions(varargin{:}); 13 %is varargin an options database already? 14 if nargin==0, 15 options=pairoptions(varargin{:}); 16 elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')), 17 %do nothing to the varargin: 18 options=varargin{1}; 19 else 20 %process varargin for options: 21 options=pairoptions(varargin{:}); 22 end 23 15 24 16 25 %recover some options, and set defaults 17 26 unitmultiplier=getfieldvalue(options,'unit',1); 18 hemisphere=getfieldvalue(options,'hemisphere',+1);19 27 fontsize=getfieldvalue(options,'fontsize',12); 28 hemisphere=getfieldvalue(options,'hemisphere'); 29 30 if strcmpi(hemisphere,'s'), 31 hemisphere=-1; 32 elseif strcmpi(hemisphere,'n'), 33 hemisphere=+1; 34 else 35 error('showbasins error message: hemispehre should be either ''n'' or ''s'''); 36 end 20 37 21 38 if hemisphere==+1, … … 26 43 standard_parallel=getfieldvalue(options,'standard_parallel',71); 27 44 end 28 29 45 30 46 %Ok, find basin we are talking about:
Note:
See TracChangeset
for help on using the changeset viewer.