Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update age analysis routine (the script itself probably has errors but it's more of a reference anyway)
  • Loading branch information
Austin Blevins committed Jul 21, 2023
1 parent 12481e8 commit 3aa3f62
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions python/analyze_single_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def map_meltfrac_to_depth(depth,apollo=True,log=False):
return

def find_all_ages(x,y,depth,rego,age):
nlayers, bothickness = traverse(y,x,depth,rego)
nlayers, bothickness = traverse(y,x,depth)
agearray = np.zeros((nlayers,nage))
rt = np.zeros(nlayers)
rt[0] = bothickness
Expand All @@ -295,11 +295,11 @@ def find_all_ages(x,y,depth,rego,age):
trueages = []
xax = np.arange(nage)
for a in xax:
trueage = ctem.craterproduction.T_from_scale(((1+a)*(interval/nage)),'NPF_Moon')
trueage = a * binsize
trueages.append(trueage[0])
order = trueages[::-1]

totalmelt, idc = find_melt_at_pixel(x,y,depth,rego,melt,meltdist)
totalmelt, idc = find_melt_at_pixel(x,y,depth)
qmcarray = np.zeros(nage)
for i in range(nlist-1):
age_number = qmcages[i]
Expand All @@ -315,8 +315,8 @@ def find_all_ages(x,y,depth,rego,age):
return order, agedist, qmcarray

def aggregate_ages(x,y,depth,n,rego,age,log=False,apollo=False):
if n==0:
order,agedist,qmcarray = find_all_ages(x,y,depth,rego,age)
if n==0:
order,agedist,qmcarray = find_all_ages(x,y,depth)
k = 1
elif n<0:
print("number of pixels must be >=0")
Expand All @@ -328,7 +328,7 @@ def aggregate_ages(x,y,depth,n,rego,age,log=False,apollo=False):
for j in range(-n,n+1):
agedist.append(np.zeros(nage))
qmcarray.append(np.zeros(nage))
o,localage,qmcage = find_all_ages(x+i,y+j,depth,rego,age)
o,localage,qmcage = find_all_ages(x+i,y+j,depth)
agedist[k] = localage
qmcarray[k] = qmcage
k += 1
Expand Down Expand Up @@ -363,21 +363,20 @@ def aggregate_ages(x,y,depth,n,rego,age,log=False,apollo=False):
a1.set_xlabel('Age (Ga)')
a1.set_ylabel('Melt Depth (m)')
a2.imshow(img)
if apollo:
a2.scatter(apollo_x, surfcoords, color='red', label='Apollo 14-17 Landing Sites')
if n == 0:
a2.scatter(x, gridsize-y, color='blue', label='Selected Region')
else:
rect = patches.Rectangle((x,gridsize-y),n,n,linewidth=1,edgecolor='b',facecolor='b',label='Selected Region')
a2.add_patch(rect)
a2.xaxis.set_ticklabels([])
a2.yaxis.set_ticklabels([])
if apollo:
a2.scatter(apollo_x, surfcoords, color='red', label='Apollo 14-17 Landing Sites')
a2.tick_params(left = False)
a2.tick_params(bottom = False)
a1.legend()
a2.legend()
plt.rcParams['figure.figsize'] = [13, 5]
plt.show()
return mf * depth

if __name__ == '__main__':
Expand Down

0 comments on commit 3aa3f62

Please sign in to comment.