Skip to content

Commit

Permalink
Merge pull request #467 from HajimeKawahara/refact2
Browse files Browse the repository at this point in the history
self merge. Refact2
  • Loading branch information
HajimeKawahara authored Jan 18, 2024
2 parents 7d79ebd + 739bdc4 commit 31b655b
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions src/exojax/spec/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,70 +195,6 @@ def activate(self, df, mask=None):
if self.gpu_transfer:
self.generate_jnp_arrays()

def compute_broadening_(
self, jlower, jupper, alpha_ref_def=None, n_Texp_def=None, output=None
):
"""computing broadening parameters
Parameters
----------
jlower: jlower array
jupper: jupper array
alpha_ref: set default alpha_ref and apply it. None=use self.alpha_ref_def
n_Texp_def: set default n_Texp and apply it. None=use self.n_Texp_def
Returns
-------
None. Store values in self.n_Texp and self.alpha_ref.
"""
if alpha_ref_def:
self.alpha_ref_def = alpha_ref_def
if n_Texp_def:
self.n_Texp_def = n_Texp_def

if self.broadf:
try:
print(".broad is used.")
bdat = read_broad(self.broad_file)
codelv = check_bdat(bdat)
print("Broadening code level=", codelv)
if codelv == "a0":
j2alpha_ref, j2n_Texp = make_j2b(
bdat,
alpha_ref_default=self.alpha_ref_def,
n_Texp_default=self.n_Texp_def,
jlower_max=np.max(jlower),
)
self.alpha_ref = np.array(j2alpha_ref[jlower])
self.n_Texp = np.array(j2n_Texp[jlower])
elif codelv == "a1":
j2alpha_ref, j2n_Texp = make_j2b(
bdat,
alpha_ref_default=self.alpha_ref_def,
n_Texp_default=self.n_Texp_def,
jlower_max=np.max(jlower),
)
jj2alpha_ref, jj2n_Texp = make_jj2b(
bdat,
j2alpha_ref_def=j2alpha_ref,
j2n_Texp_def=j2n_Texp,
jupper_max=np.max(jupper),
)
self.alpha_ref = np.array(jj2alpha_ref[jlower, jupper])
self.n_Texp = np.array(jj2n_Texp[jlower, jupper])
except FileNotFoundError:
print(
"Warning: Cannot load .broad. The default broadening parameters are used."
)
self.alpha_ref = np.array(self.alpha_ref_def * np.ones_like(jlower))
self.n_Texp = np.array(self.n_Texp_def * np.ones_like(jlower))

else:
print("The default broadening parameters are used.")
self.alpha_ref = np.array(self.alpha_ref_def * np.ones_like(jlower))
self.n_Texp = np.array(self.n_Texp_def * np.ones_like(jlower))

def compute_load_mask(self, df):
# wavelength
print(df)
Expand Down

0 comments on commit 31b655b

Please sign in to comment.