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

Mie scattering of clouds, and Refelection Spectrum (Forward modelling) #477

Closed HajimeKawahara closed 5 months ago

HajimeKawahara commented 5 months ago

Finally, I implemented the radiative transfer of the reflection spectrum with Ackerman and Marley cloud model + Mie scattering, but currently only for the forward modelling. #431 #432

Check the following jupyter notebook samples:

Some important changes

New features we focus on

We added new art, opa, pdb and also amp (Atmospheric Micro Physics class) for this new enhancement.

exojax

spec.atmrt.ArtReflectPure

art class for the pure (i.e. no emission) reflection spectrum (ArtReflectEmis, reflection+emis has not been verified)

The RT algorithm is basically the flux-adding treatment by Robinson & Crisp 2018; Robinson & Salvador 2023,

We added the opacity computation of clouds in art

dtau_cld = art.opacity_profile_cloud_lognormal(sigma_extinction, rhoc, MMRc, rg, sigmag, gravity)

spec.pardb.PdbCloud

pdb (particulate database) for clouds/condensates.

from exojax.spec.pardb import PdbCloud
pdb_nh3 = PdbCloud("NH3")
#condensate substance density
rhoc = pdb_nh3.condensate_substance_density #g/cc

spec.opacont.OpaMie

opa for Mie scattering. The following code computes the Mie parameters using PyMieScatt. So, OpaMie is a kind of a wrapper of PyMieScatt currently. I will update this for retrieval.

from exojax.spec.opacont import OpaMie
opa = OpaMie(pdb_nh3, nus)
sigma_extinction, sigma_scattering, asymmetric_factor = opa.mieparams_vector_direct_from_pymiescatt(rg, sigmag)

spec.amp.AmpAmcloud

amp for the Akerman and Marley cloud model

For instance, amp.calc_ammodel computes rg (condensate typical radius) and mass mixing ratio from the cloud parameters

rg_layer, MMRc = amp.calc_ammodel(Parr, Tarr, mu, molmass_nh3, gravity, fsed, sigmag, Kzz, MMRbase_nh3)

AM cloud model in ExoJAX

The tutorial of the implementation of the AM cloud model in ExoJAX can be found in documents/tutorials/Ackerman_and_Marley_cloud_model.ipynb, see here.

We also compared the code with VIRGA:

github-actions[bot] commented 5 months ago

Unit Test Results

154 tests  +15   154 :heavy_check_mark: +15   35s :stopwatch: +3s βŸβ€„βŸβ€„1 suites Β±βŸβ€„0β€‚β€ƒβ€ƒβŸβ€„βŸβ€„0 :zzz: Β±βŸβ€„0  βŸβ€„βŸβ€„1 files   Β±βŸβ€„0β€‚β€ƒβ€ƒβŸβ€„βŸβ€„0 :x: Β±βŸβ€„0 

Results for commit ed0d5001. ± Comparison against base commit 4de023c0.

:recycle: This comment has been updated with latest results.

ykawashima commented 5 months ago

Thank you very much!

I got a bit different result for the final figure of Ackerman and Marley cloud model tutorial. Is the figure outdated or did I do something wrong?

-> thanks! No, your results are correct. done it. (H.K.)

γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2024-03-25 13 23 56

As far as I understand, it seems that vmap is not used here. https://github.com/HajimeKawahara/exojax/blob/74fb1dd4387d08037b375713ee90249a1b89ac1f/documents/tutorials/Ackerman_and_Marley_cloud_model.rst?plain=1#L102 https://github.com/HajimeKawahara/exojax/blob/74fb1dd4387d08037b375713ee90249a1b89ac1f/documents/tutorials/Ackerman_and_Marley_cloud_model.ipynb#L213

HajimeKawahara commented 5 months ago

@ykawashima Thanks a lot!