Changeset 27471
- Timestamp:
- 12/21/22 11:46:44 (2 years ago)
- Location:
- issm/trunk-jpl/src/m/coordsystems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/coordsystems/ll2xy.m
r27038 r27471 40 40 end 41 41 42 %Move to CoordTransform now... 43 if exist('CoordTransform_matlab')==3 44 disp('Calling CoordTransform instead, make sure to change your MATLAB script'); 45 if sgn==+1 46 if delta==45 && slat==70 %BedMachine 47 [x y]=CoordTransform(lat,lon,'EPSG:4326','EPSG:3413'); return; 48 elseif delta==0 && slat==75 %IBCAO 49 [x y]=CoordTransform(lat,lon,'EPSG:4326','EPSG:3996'); return; 50 elseif delta==39 && slat==71 %Bamber 51 Bamber_proj = '+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'; 52 [x y]=CoordTransform(lat,lon,'EPSG:4326',Bamber_proj); return; 53 else 54 error('not supported yet'); 55 end 56 else 57 assert(delta==0); assert(slat ==71); 58 [x y]=CoordTransform(lat,lon,'EPSG:4326','EPSG:3031'); 59 return; 60 end 42 %Choose ellipsoid 43 if 0 44 %Hughes ellipsoid 45 re = 6378.273*10^3; % Radius of the earth in meters 46 ex2 = .006693883; % Eccentricity of the Hughes ellipsoid squared 47 else 48 %WGS84 ellipsoid 49 re = 6378137; % Radius of the earth in meters 50 f = 1./298.257223563;% Earth flattening 51 ex2 = 2*f-f^2 % Eccentricity squared 61 52 end 62 53 63 % Conversion constant from degrees to radians 64 cde = 57.29577951; 65 % Radius of the earth in meters 66 re = 6378.273*10^3; 67 % Eccentricity of the Hughes ellipsoid squared 68 ex2 = .006693883; 69 % Eccentricity of the Hughes ellipsoid 70 ex = sqrt(ex2); 54 % Eccentricity 55 ex = sqrt(ex2); 71 56 72 57 latitude = abs(lat) * pi/180.; -
issm/trunk-jpl/src/m/coordsystems/xy2ll.m
r27038 r27471 36 36 end 37 37 38 %Move to CoordTransform now... 39 if exist('CoordTransform_matlab')==3 40 disp('Calling CoordTransform instead, make sure to change your MATLAB script'); 41 if sgn==+1 42 if delta==45 && slat==70 %BedMachine 43 [lat lon]=CoordTransform(x, y,'EPSG:3413','EPSG:4326'); return; 44 elseif delta==0 && slat==75 %IBCAO 45 [lat lon]=CoordTransform(x, y,'EPSG:3996','EPSG:4326'); return; 46 elseif delta==39 && slat==71 %Bamber 47 Bamber_proj = '+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'; 48 [lat lon]=CoordTransform(x, y, Bamber_proj, 'EPSG:4326'); return; 49 else 50 error('not supported yet'); 51 end 52 else 53 assert(delta==0); assert(slat ==71); 54 [lat lon]=CoordTransform(x, y,'EPSG:3031','EPSG:4326'); 55 return; 56 end 38 %Choose ellipsoid 39 if 0 40 %Hughes ellipsoid 41 re = 6378.273*10^3; % Radius of the earth in meters 42 ex2 = .006693883; % Eccentricity of the Hughes ellipsoid squared 43 else 44 %WGS84 ellipsoid 45 re = 6378137; % Radius of the earth in meters 46 f = 1./298.257223563;% Earth flattening 47 ex2 = 2*f-f^2 % Eccentricity squared 57 48 end 58 49 59 if nargout~=3 & nargout~=2, 60 help xy2ll 61 error('bad usage'); 62 end 63 64 % Conversion constant from degrees to radians 65 cde = 57.29577951; 66 % Radius of the earth in meters 67 re = 6378.273*10^3; 68 % Eccentricity of the Hughes ellipsoid squared 69 ex2 = .006693883; 70 % Eccentricity of the Hughes ellipsoid 71 ex = sqrt(ex2); 50 % Eccentricity 51 ex = sqrt(ex2); 72 52 73 53 sl = slat*pi/180.;
Note:
See TracChangeset
for help on using the changeset viewer.