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
56 stars 14 forks source link

added self.logsij0 for the case of gpu_transfer=False #436

Closed ykawashima closed 11 months ago

ykawashima commented 11 months ago

I am not sure whether this implementation is a bug, but I have realized that mdb.logsij0 is available only for the case of gpu_transfer=True, which I think is a bit confusing when calculating with the lpf mode. So, I have modified the code. The minimum script you can check is as follows. Thank you.

from exojax.spec import api
nus, wav, res = wavenumber_grid(22920.0,
                                23100.0,
                                100000,
                                unit='AA',
                                xsmode="lpf")

mdb = api.MdbExomol("/home/kawashima/database/CO/12C-16O/Li2015",nus,gpu_transfer=True)
print(mdb.logsij0)
mdb = api.MdbExomol("/home/kawashima/database/CO/12C-16O/Li2015",nus,gpu_transfer=False)
print(mdb.logsij0)

mdb = api.MdbHitemp("/home/kawashima/database/CO/05_HITEMP2019",nus,gpu_transfer=True)
print(mdb.logsij0)
mdb = api.MdbHitemp("/home/kawashima/database/CO/05_HITEMP2019",nus,gpu_transfer=False)
print(mdb.logsij0)

mdb = api.MdbHitran("/home/kawashima/database/CO/05_hit12.par",nus,gpu_transfer=True)
print(mdb.logsij0)
mdb = api.MdbHitran("/home/kawashima/database/CO/05_hit12.par",nus,gpu_transfer=False)
print(mdb.logsij0)
HajimeKawahara commented 11 months ago

@ykawashima Thank you! This change looks quite reasonable for me.