Skip to content

Commit

Permalink
Change escape wrapper to get hf_row[Rxuv] from atmos_clim in EL_escap…
Browse files Browse the repository at this point in the history
…e() function
  • Loading branch information
EmmaPostolec committed Nov 6, 2024
1 parent 441ab83 commit a7f59c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/proteus/atmos_clim/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def RunAtmosphere(config:Config, dirs:dict, loop_counter:dict,
hf_row["z_xuv"] = atm_output["z_xuv"] # Scale height at Pxuv [m]
hf_row["R_xuv"] = hf_row["R_int"] + hf_row["z_xuv"] # Computed XUV planetary radius

log.info(f"XUV planetary radius : Rxuv = { hf_row["R_xuv"]} [m]")

# Calculate observables (measured at infinite distance)
R_obs = hf_row["z_obs"] + hf_row["R_int"] # observed radius
hf_row["transit_depth"] = (R_obs / hf_row["R_star"])**2.0
Expand Down
17 changes: 1 addition & 16 deletions src/proteus/escape/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,6 @@ def RunZEPHYRUS(config, hf_row, stellar_track):

log.info(f"Interpolated Fxuv_star_SI at age_star = {age_star} Myr is {Fxuv_star_SI} [W/m2]")

# Compute Rxuv
##### DRAFT STAGE
# ncdfs = read_ncdfs('output/'+config.params.out.path, hf_all['Time'])
# print(int(hf_all['Time'][-1]))
# profiles = ncdfs[int(hf_all['Time'][0])]
# p_ncdfs = profiles['p']
# z_ncdfs = profiles['z']
# log.info('p_ncdfs : ', p_ncdfs)
# index_Pxuv = find_nearest(p_ncdfs, config.escape.zephyrus.Pxuv)[1] # Find the scale heigh z for the corresponding Pxuv [m]
# z_Pxuv = z_ncdfs[index_Pxuv]
# log.info(f"Scale height at Pxuv : z = {z_Pxuv} [m]?")
# Rxuv = hf_row["R_int"] + z_Pxuv # XUV optically thick planetary radius [m]
# log.info(f"XUV optically thick planetary radius : Rxuv = {Rxuv} [m]")

# Compute energy-limited escape
mlr = EL_escape(config.escape.zephyrus.tidal, #tidal contribution (True/False)
config.orbit.semimajoraxis * AU, #planetary semi-major axis [m]
Expand All @@ -107,8 +93,7 @@ def RunZEPHYRUS(config, hf_row, stellar_track):
config.star.mass, #stellar mass [kg]
config.escape.zephyrus.efficiency, #efficiency factor
hf_row["R_int"], #planetary radius [m]
hf_row["R_int"], #XUV optically thick planetary radius [m]
#Rxuv, #XUV optically thick planetary radius [m]
hf_row["R_xuv"], #XUV optically thick planetary radius [m]
Fxuv_star_SI) # [kg s-1]

log.info('Zephyrus escape computation done :)')
Expand Down

0 comments on commit a7f59c9

Please sign in to comment.