Open wtbarnes opened 3 years ago
Aha, good question, and something that should almost certainly be treated better in the docs.
By default, and in the way most people use it, VACUUM_TO_AIR
in keyword.dat
is set to TRUE
for RH.
Lightweaver, on the other hand, doesn't touch the output wavelength grid unless you explicitly do conversions using lw.vac_to_air
.
Thus, to get a +/- 0.2 nm grid around the Halpha core, you can get the line core as follows:
In [1]: from lightweaver.rh_atoms import H_6_atom
In [2]: h = H_6_atom()
In [3]: h.lines[4].lambda0
Out[3]: 656.4691622298104
# Thus showing why the core is where it is on your plot
and then something like
halphaCore = h.lines[4].lambda0
wave = np.linspace(halphaCore - 0.2, halphaCore + 0.2, 1000)
Then if you want to plot using air wavelengths, like Ivan does, you can just call lw.vac_to_air(wave)
to use as your abscissa.
Whilst it's nice to see that things work, with the way you're recomputing the spectrum using your own choice of wavelength grid (the wave
variable), there's no need to adjust the quadrature on the model atom.
For most things (definitely in quiet sun cases) the basic quadrature that's defined on the atom should be sufficient for the RT operator to converge, and then wave
allows you to synthesise in as little, or as much detail as you want, to get a nice smooth output. Now, for very high Doppler shifts you may need to adjust the quadrature, in the way you've done here to avoid undersampling the core if it flies off into the distance. So, it is worth being aware of.
I'd definitely like to improve the docs further, currently it's essentially API documentation, but I expect it's very dense for anyone less familiar with the core materials to get into. Cheers!
Ahh I see. Thanks! That seems to work. And thanks for the tip regarding the quadrature changes. I was not exactly sure why those were needed and was admittedly blindly trying to reproduce the RH examples.
I'll go ahead and close this. Do you think the toy example involving the effect of velocity on the absorption profile (as shown in Ivan's notebook) would be a useful gallery example?
If you would like to write up this example into a documented gallery example, I would be more than happy to accept a PR!
This is perhaps less of an issue and more of a feature/docs request. My ignorance here is likely due to my unfamiliarity with Lightweaver, RH, and radiative transfer so I will apologize in advance 😅
I'm working through this toy example which uses RH (from the command line) + a combination of scripts to demonstrate the effect of the velocity on the shape of the absorption line profile around 656.25 nm. For simplicity, I'll focus just on the first part which leaves the velocity unmodified
Starting from the simple gallery example in the docs, my understanding is that I need to modify the H_6 atom that is passed to
RadiativeSet
in the following way:(the 4 comes from the fact that I want to modify the first line in the Balmer series, j=2, i=1). However, my resulting line profile is
compared to the example produced in RH,
I've included the complete code to reproduce my figure below. I'm sure I'm likely doing something wrong or not completely understanding what I'm doing here!