Changeset 22339


Ignore:
Timestamp:
01/05/18 14:45:40 (7 years ago)
Author:
seroussi
Message:

NEW: added scaling_factor option for polar stereographic projections in ll2xy and xy2ll

Location:
issm/trunk-jpl/src/m/coordsystems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/coordsystems/ll2xy.m

    r21041 r22339  
    1 function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 
     1function [x,y,scale_factor] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 
    22%LL2XY - converts lat long to polar stereographic
    33%
    44%   Converts from geodetic latitude and longitude to Polar
    55%   Stereographic (X,Y) coordinates for the polar regions.
     6%   Optional scale factor provides the scaling factor needed to correct projection error
     7%   in areas and volumes
    68%   Author: Michael P. Schodlok, December 2003 (map2ll)
    79%
    810%   Usage:
    911%      [x,y] = ll2xy(lat,lon,sgn)
     12%      [x,y,scale_factor] = ll2xy(lat,lon,sgn)
    1013%      [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
    1114%
     
    2932else
    3033        help ll2xy
     34        error('bad usage');
     35end
     36
     37if nargout~=3 & nargout~=2,
     38        help xy2ll
    3139        error('bad usage');
    3240end
     
    6573        y(cnt1) = 0.0;
    6674end
     75
     76if nargout==3,
     77        m=((1+sin(abs(slat)*pi/180))*ones(length(lat),1)./(1+sin(abs(lat)*pi/180)));
     78        scale_factor=(1./m).^2;
     79end
  • issm/trunk-jpl/src/m/coordsystems/xy2ll.m

    r21041 r22339  
    1 function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
     1function [lat,lon,scale_factor] = xy2ll(x,y,sgn,central_meridian,standard_parallel)
    22%XY2LL - converts xy to lat long
    33%
     
    55%   latitude and longitude Stereographic (X,Y) coordinates for the polar
    66%   regions.
     7%   Optional scale factor provides the scaling factor needed to correct projection error
     8%   in areas and volumes
    79%   Author: Michael P. Schodlok, December 2003 (map2xy.m)
    810%
    911%   Usage:
    1012%      [lat,lon] = xy2ll(x,y,sgn);
     13%      [lat,lon,scale_factor] = xy2ll(x,y,sgn);
    1114%      [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel);
    1215%
     
    2932        end
    3033else
     34        help xy2ll
     35        error('bad usage');
     36end
     37
     38if nargout~=3 & nargout~=2,
    3139        help xy2ll
    3240        error('bad usage');
     
    7179lat = lat * 180. / pi;
    7280lon = lon - delta;
     81if nargout==3,
     82        m=((1+sin(abs(slat)*pi/180))*ones(length(lat),1)./(1+sin(abs(lat)*pi/180)));
     83        scale_factor=(1./m).^2;
     84end
Note: See TracChangeset for help on using the changeset viewer.