Skip to content

Commit

Permalink
Updated import of chemistry module
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstolker committed May 4, 2021
1 parent 712d004 commit e8bb876
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions species/analysis/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@ def run_multinest(self,
print(' [DONE]')

print('Importing chemistry module...', end='', flush=True)
from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem import \
interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances
print(' [DONE]')

print('Importing rebin module...', end='', flush=True)
Expand Down
3 changes: 1 addition & 2 deletions species/read/read_radtrans.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ def get_model(self,
elif f'{item[:-3].lower()}_tau' in model_param:
# Import the chemistry module here because it is slow

from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem \
import interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances

# Interpolate the abundances, following chemical equilibrium

Expand Down
12 changes: 4 additions & 8 deletions species/util/retrieval_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def pt_ret_model(temp_3: Optional[np.ndarray],
# Importing interpol_abundances is only slow the first time, which occurs at the start
# of the run_multinest method of AtmosphericRetrieval

from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem import \
interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances

ab = interpol_abundances(np.full(tedd.shape[0], c_o_ratio),
np.full(tedd.shape[0], metallicity),
Expand Down Expand Up @@ -642,8 +641,7 @@ def calc_spectrum_clear(rt_object,
# Importing interpol_abundances is only slow the first time, which occurs at the start
# of the run_multinest method of AtmosphericRetrieval

from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem import \
interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances

if chemistry == 'equilibrium':
# Chemical equilibrium
Expand Down Expand Up @@ -784,8 +782,7 @@ def calc_spectrum_clouds(rt_object,
# Importing interpol_abundances is only slow the first time, which occurs at the start
# of the run_multinest method of AtmosphericRetrieval

from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem import \
interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances

# Interpolate the abundances, following chemical equilibrium
abund_in = interpol_abundances(np.full(pressure.shape, c_o_ratio),
Expand Down Expand Up @@ -2048,8 +2045,7 @@ def quench_pressure(pressure: np.ndarray,
co_array = np.full(pressure.shape[0], c_o_ratio)
feh_array = np.full(pressure.shape[0], metallicity)

from poor_mans_nonequ_chem_FeH.poor_mans_nonequ_chem.poor_mans_nonequ_chem import \
interpol_abundances
from poor_mans_nonequ_chem.poor_mans_nonequ_chem import interpol_abundances

abund_eq = interpol_abundances(
co_array, feh_array, temperature, pressure, Pquench_carbon=None)
Expand Down

0 comments on commit e8bb876

Please sign in to comment.