Git Product home page Git Product logo

Comments (4)

Goobley avatar Goobley commented on August 15, 2024

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!

from lightweaver.

wtbarnes avatar wtbarnes commented on August 15, 2024

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.

from lightweaver.

wtbarnes avatar wtbarnes commented on August 15, 2024

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?

from lightweaver.

Goobley avatar Goobley commented on August 15, 2024

If you would like to write up this example into a documented gallery example, I would be more than happy to accept a PR!

from lightweaver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.