HajimeKawahara / exojax

🐈 Automatic differentiable spectrum modeling of exoplanets/brown dwarfs using JAX, compatible with NumPyro and JAXopt
http://secondearths.sakura.ne.jp/exojax/
MIT License
45 stars 14 forks source link

None of the lines in mdb is in nu_grid range error #449

Closed HajimeKawahara closed 8 months ago

HajimeKawahara commented 8 months ago

I found that when using HITRAN with Premodit. I guess this is due to zero lines in LBD (Nline ~ 10^4). In this case, should we recommend to use LPF direct instead? need to think.

wavelength_start = 7100.0 #AA
wavelength_end = 7450.0 #AA
from exojax.spec.api import MdbHitran
from exojax.spec.opacalc import OpaPremodit
from exojax.utils.grids import wavenumber_grid
N=40000
mdb_water = MdbHitran("H2O", nurange=[1.e8/wavelength_end, 1.e8/wavelength_start], isotope=0)
nus, wav, res = wavenumber_grid(wavelength_start, wavelength_end, N, xsmode="premodit")
opa = OpaPremodit(mdb_water, nu_grid=nus, allow_32bit=True, auto_trange=[150.0,250.0])
HajimeKawahara commented 8 months ago

This is due to my silly mistake.... forgotto put unit="AA".

wavelength_start = 7100.0 #AA
wavelength_end = 7450.0 #AA
from exojax.spec.api import MdbHitran
from exojax.spec.opacalc import OpaPremodit
from exojax.utils.grids import wavenumber_grid
N=40000
mdb_water = MdbHitran("H2O", nurange=[1.e8/wavelength_end, 1.e8/wavelength_start], isotope=0)
nus, wav, res = wavenumber_grid(wavelength_start, wavelength_end, N, xsmode="premodit", unit="AA")
opa = OpaPremodit(mdb_water, nu_grid=nus, allow_32bit=True, auto_trange=[150.0,250.0])
HajimeKawahara commented 8 months ago

So, the real issue is we do not have the value error, when x0 > x1 for unit="cm-1"

HajimeKawahara commented 8 months ago

The real issue is we need to have ValueError when none of opa.mdb.nu_lines is in opa.nu_grid for Premodit