Closed VectorZhao closed 2 weeks ago
@VectorZhao Thanks! can you show me the entire code? for instance, what value did you input to nu_grid
?
@VectorZhao Thanks! can you show me the entire code? for instance, what value did you input to
nu_grid
?
wav_arr = dat['wav'].to_numpy() * 10000
idx = (22250 < wav_arr) * (wav_arr < 23250)
mask = (22920 > wav_arr) + (wav_arr > 22660)
masked = mask*idx
wavd=dat['wav'].values[masked]*10000
flux=dat['flux'].values[masked]
err=dat['error'].values[masked]
nusd = jnp.array(1.e8/wavd)
# Number of points in the wavenumber grid
Nx = 4500
# Create the wavenumber grid for atmospheric radiative transfer calculations
# Parameters: min and max wavelength (in Angstrom) extended by 5 units, number of grid points,
# unit as Angstrom, cross-section mode as premodit
nu_grid, wav, res = wavenumber_grid(np.min(wavd) - 5.0, np.max(wavd) + 5.0, Nx, unit="AA", xsmode="premodit")
# Set the temperature range for the atmospheric model
Tlow = 300.0 # Lowest temperature in Kelvin
Thigh = 3000.0 # Highest temperature in Kelvin
# Initialize the atmospheric radiative transfer model for emission with pure absorption
# Parameters: wavenumber grid, top pressure (in bar), bottom pressure (in bar), number of layers
art = ArtEmisPure(nu_grid=nu_grid, pressure_top=1.e-5, pressure_btm=1.e2, nlayer=100)
# Change the temperature range in the atmospheric model
art.change_temperature_range(Tlow, Thigh)
# Set the instrumental resolution
Rinst = 30000. # Instrumental resolution
# Convert the instrumental resolution to Gaussian standard deviation for convolution
beta_inst = resolution_to_gaussian_std(Rinst)
# Create an instance of the molecular database for CO (carbon monoxide)
# Parameters: database path, wavenumber range, GPU transfer flag, maximum lower state energy
mdbCO = MdbExomol('.database/CO/12C-16O/Li2015/', nurange=nu_grid, gpu_transfer=False, elower_max=58242.689)
print('N=', len(mdbCO.nu_lines))
# Set the diffusion mode to 0
diffmode = 0
# Create the opacity model for CO using premodit method
# Parameters: molecular database, wavenumber grid, diffusion mode, automatic temperature range, grid resolution
opaCO = OpaPremodit(mdb=mdbCO, nu_grid=nu_grid, diffmode=diffmode, auto_trange=[Tlow, Thigh], dit_grid_resolution=1.0)
# Create an instance of the molecular database for H2O (water vapor)
# Parameters: database path, wavenumber range, GPU transfer flag, critical value, maximum lower state energy
mdbH2O = MdbExomol('.database/H2O/1H2-16O/POKAZATEL', nurange=nu_grid, gpu_transfer=False, crit=1.e-46, elower_max=23726.625476)
# Print the number of spectral lines in the H2O database
print('N=', len(mdbH2O.nu_lines))
# Create the opacity model for H2O using premodit method
# Parameters: molecular database, wavenumber grid, diffusion mode, automatic temperature range, grid resolution
opaH2O = OpaPremodit(mdb=mdbH2O, nu_grid=nu_grid, diffmode=diffmode, auto_trange=[Tlow, Thigh], dit_grid_resolution=1.0, allow_32bit=True)
# CIA (Collision-Induced Absorption) setting for H2-H2 interactions
# Create an instance of the CIA database for H2-H2
cdbH2H2 = CdbCIA('.database/H2-H2_2011.cia', nu_grid)
# Create the opacity model for H2-H2 CIA
opciaH2H2 = OpaCIA(cdb=cdbH2H2, nu_grid=nu_grid)
# Mean molecular weight
mmw = 2.33
# Mass mixing ratio for H2
mmrH2 = 0.74
# Molecular mass for H2
molmassH2 = molinfo.molmass_isotope('H2')
# Volume mixing ratio for H2
vmrH2 = (mmrH2 * mmw / molmassH2) # VMR
# CIA setting for H2-He interactions
# Create an instance of the CIA database for H2-He
cdbH2He = CdbCIA('.database/H2-He_2011.cia', nu_grid)
# Create the opacity model for H2-He CIA
opciaH2He = OpaCIA(cdb=cdbH2He, nu_grid=nu_grid)
# Mass mixing ratio for He
mmrHe = 0.25
# Molecular mass for He
molmassHe = molinfo.molmass_isotope('He', db_HIT=False)
# Volume mixing ratio for He
vmrHe = (mmrHe * mmw / molmassHe) # VMR
Several days ago, the code was functioning properly. Yesterday, I created a new environment. When the same spectral data was processed by executing the same code again, issues emerged, which is highly perplexing.
@VectorZhao I was able to reproduce this error! I will look for the reason.
@VectorZhao it's because the bug of radis==0.15.1
. for now, I think using radis==0.15
can solve it.
@HajimeKawahara thank you, I will test the code using radis==0.15
By the way, could you please tell me approximately when exojax 2.0 will be launched? We are really looking forward to it.
By the way, could you please tell me approximately when exojax 2.0 will be launched? We are really looking forward to it. @VectorZhao
Sorry to keep you waiting. Here is the current plan:
First, we aim to submit the ExoJAX2 paper in September or October, if possible. We will make the necessary revisions during the revise process and plan to release version 2.0 upon the paper's acceptance. The timing of this release depends on the review process, but we aim to release it within six months to a year at the latest. However, for the major components, we intend to release a new version as a pre-release around the time of the paper submission.
@VectorZhao it's because the bug of
radis==0.15.1
. for now, I think usingradis==0.15
can solve it.
radis==0.15
fixed it.
I will close this Issue after merging radis/radis#691 into radis/develop
.
package list
Here is the code
and the output is