Changeset 25836 for issm/trunk/src/m/mesh/TwoDToThreeD.m
- Timestamp:
- 12/08/20 08:45:53 (4 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/mesh/TwoDToThreeD.m
r24313 r25836 1 function md=TwoDToThreeD(md) 2 1 function md=TwoDToThreeD(md,planet) 3 2 %reproject model into lat,long if necessary: 4 if md.mesh.epsg~=4326,5 [md.mesh.x,md.mesh.y]=gdaltransform(md.mesh.x,md.mesh.y, sprintf('EPSG:%i',md.mesh.epsg),sprintf('EPSG:4326'));3 if ~strcmpi(md.mesh.proj,epsg2proj(4326)), 4 [md.mesh.x,md.mesh.y]=gdaltransform(md.mesh.x,md.mesh.y,md.mesh.proj,'EPSG:4326'); 6 5 end 7 6 8 7 %Make a 3dsurface mesh out of this: 9 R= 6.371012*10^6;8 R=planetradius(planet); 10 9 11 10 %we assume x and y hold the long,lat values: 12 11 long=md.mesh.x; 13 12 lat=md.mesh.y; 14 mask=md.mask;15 13 14 %Assume spherical body: 16 15 x = R .* cosd(lat) .* cosd(long); 17 16 y = R .* cosd(lat) .* sind(long); … … 21 20 vc=md.mesh.vertexconnectivity; 22 21 vb=md.mesh.vertexonboundary; 23 md.mesh=mesh3dsurface(); md.mask=maskpsl();22 md.mesh=mesh3dsurface(); 24 23 md.mesh.lat=lat; 25 24 md.mesh.long=long; … … 33 32 md.mesh.vertexconnectivity=vc; 34 33 md.mesh.vertexonboundary=vb; 35 if strcmpi(class(mask),'maskpsl'),36 md.mask=mask;37 else38 md.mask.ice_levelset=mask.ice_levelset;39 md.mask.groundedice_levelset=mask.groundedice_levelset;40 end
Note:
See TracChangeset
for help on using the changeset viewer.