Changeset 6343
- Timestamp:
- 10/19/10 13:10:23 (14 years ago)
- Location:
- issm/trunk/src/m/utils/LatLong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/LatLong/ll2xy.m
r6341 r6343 1 function [x,y] = ll2xy(lat,lon,sgn )1 function [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 2 2 %LL2XY - converts lat long to polar stereographic 3 3 % … … 7 7 % 8 8 % Usage: 9 % [x,y] = map2ll(lat,lon,sgn) 10 % - sgn = Sign of latitude +1 : north latitude 11 % -1 : south latitude 9 % [x,y] = ll2xy(lat,lon,sgn) 10 % [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 11 % 12 % - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70) 13 % -1 : south latitude (default is mer=0 lat=70) 12 14 13 if nargin ~= 3 14 help map2ll 15 %Get central_meridian and standard_parallel depending on hemisphere 16 if nargin==5, 17 delta = central_meridian; 18 slat = standard_parallel; 19 elseif nargin==3 20 if sgn == 1, 21 delta = 45; slat = 70; 22 elseif sgn==-1, 23 delta = 0; slat = 70; 24 else 25 error('Sign should be either +1 or -1'); 26 end 27 else 28 help ll2xy 15 29 error('bad usage'); 16 30 end … … 18 32 % Conversion constant from degrees to radians 19 33 cde = 57.29577951; 20 % Standard latitude for the SSM/I grid with no distorsion21 slat = 70.;22 34 % Radius of the earth in meters 23 35 re = 6378.273*10^3; … … 26 38 % Eccentricity of the Hughes ellipsoid 27 39 ex = sqrt(ex2); 28 29 if sgn == 130 delta = 45.;31 else32 delta = 0.0;33 end34 40 35 41 latitude = abs(lat) * pi/180.; -
issm/trunk/src/m/utils/LatLong/xy2ll.m
r6341 r6343 1 function [lat,lon] = xy2ll(x,y,sgn )1 function [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel) 2 2 %XY2LL - converts xy to lat long 3 3 % … … 8 8 % 9 9 % Usage: 10 % [lat,lon] = map2xy(x,y,sgn); 11 % - sgn = Sign of latitude +1 : north latitude 12 % -1 : south latitude 10 % [lat,lon] = xy2ll(x,y,sgn); 11 % [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel); 12 % 13 % - sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70) 14 % -1 : south latitude (default is mer=0 lat=70) 13 15 14 if nargin ~= 3 15 help map2xy 16 %Get central_meridian and standard_parallel depending on hemisphere 17 if nargin==5, 18 delta = central_meridian; 19 slat = standard_parallel; 20 elseif nargin==3 21 if sgn == 1, 22 delta = 45; slat = 70; 23 elseif sgn==-1, 24 delta = 0; slat = 70; 25 else 26 error('Sign should be either +1 or -1'); 27 end 28 else 29 help xy2ll 16 30 error('bad usage'); 17 31 end … … 19 33 % Conversion constant from degrees to radians 20 34 cde = 57.29577951; 21 % Standard latitude for the SSM/I grid with no distorsion22 slat = 70.;23 35 % Radius of the earth in meters 24 36 re = 6378.273*10^3; … … 27 39 % Eccentricity of the Hughes ellipsoid 28 40 ex = sqrt(ex2); 29 30 if sgn == 131 delta = 45.;32 else33 delta = 0.0;34 end35 41 36 42 sl = slat*pi/180.;
Note:
See TracChangeset
for help on using the changeset viewer.