Ignore:
Timestamp:
09/22/09 13:38:39 (16 years ago)
Author:
Eric.Larour
Message:

More flexible mapll and mapxy.
New change of axis: stereomap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/LatLong/mapll.m

    r2079 r2271  
    1 function  [x,y]=mapll(lat,lon,hem);
     1function  [x,y]=mapll(lat,lon,hem,varargin);
    22%MAPLL - convert latitude and longitude into x and y
    33%
     
    1010%   See also MAPXY, LL2XY
    1111
     12%check number of arguments.
     13if ~((nargin==3) | (nargin==5)),
     14        mapllerrorusage();
     15end
     16
     17%hem: must be either 's' or 'n'
     18if ~ischar(hem),
     19        error('mapll error message: hemisphere argument should be ''n'' or ''s''');
     20end
     21
     22%check hem is either 'n' or 's':
     23if ~(hem=='s' | hem=='n'),
     24        error('mapll error message: hem should be ''s'' or ''n''');
     25end
     26
     27%set sn:
     28if hem=='s',
     29        slat=71;
     30        sn=-1.0;
     31        xlam=0;
     32else
     33        slat=70;
     34        sn=1.0;
     35        xlam=45;
     36end
     37
     38%set defaults for standard parallels and centre meridians.
     39if nargin==5,
     40        slat=varargin{1};
     41        xlam=varargin{2};
     42end
     43
     44
    1245%some corrections
    1346lon=lon+360;       % to have 0<lon<360
     
    1750e2= 0.00669437999015;
    1851e=sqrt(e2);
    19 
    20 %Standard parallel - latitude with no distortion = -71.
    21 if hem==1,
    22         %Northern hemisphere
    23         sn=1;
    24         slat=70;
    25         xlam=45;
    26 else
    27         %Southern Hemisphere
    28         sn=-1.0;
    29         slat=71;
    30         xlam=0;
    31 end
    3252
    3353lat=sn*lat*pi/180;
     
    4868x= rho*sn.*sin((lon+xlam));
    4969y=-rho*sn.*cos((lon+xlam));
     70
     71end
     72
     73function mapllerrorusage(),
     74        help mapll
     75end
Note: See TracChangeset for help on using the changeset viewer.