Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug in crater_profile.py in complex example
  • Loading branch information
daminton committed Apr 14, 2020
1 parent cc04d98 commit 3d0b9ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/morphology_test_cases/complex/crater_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def image_dem(filename,gridsize,pix,CTEM_dem):
# Create surface dem map
solar_angle = 20.0
dem_map = np.copy(CTEM_dem) - np.roll(CTEM_dem, 1, 0)
dem_map = (0.5 * np.pi) + np.arctan2
dem_map = (0.5 * np.pi) + np.arctan2(dem_map, pix)
dem_map = dem_map - np.radians(solar_angle) * (0.5 * np.pi)
np.place(dem_map, dem_map > (0.5 * np.pi), 0.5 * np.pi)
dem_map = np.absolute(dem_map)
Expand Down Expand Up @@ -121,8 +121,10 @@ def pol2cart(rho, phi):


#Compare with CTEM output
gridsize = 2000
dem_file = 'surface_dem.dat'
CTEM_dem = np.fromfile(dem_file , dtype = np.float64)
CTEM_dem.shape = (gridsize,gridsize)
CTEM_dem *= 1e-3
pix = 0.200
gridsize = 2000
Expand Down Expand Up @@ -152,7 +154,7 @@ def pol2cart(rho, phi):


plt.savefig(f'{crater_name}_profile.png',dpi=300,bbox_inches='tight')
#os.system(f'open {crater_name}_profile.png')
os.system(f'open {crater_name}_profile.png')

imgfile = f'{crater_name}.png'
image_dem(imgfile,gridsize,pix,orig_dem)
Expand Down

0 comments on commit 3d0b9ba

Please sign in to comment.