Giter Club home page Giter Club logo

linebroadenings.jl's Introduction

LineBroadenings

Stable Dev Build Status Coverage

Example

using GLMakie
using LineBroadenings

μ, γ, σ = 0, 20 * (2 * log(2)), 20
fl = Lorentz(μ, γ)
fg = Gaussian(μ, σ)
fv = Voigt(μ, σ, γ)
x = LinRange(-250, 250, 100000)

let
    fig = Figure()
    ax = Axis(fig[1, 1])
    lines!(ax, x, pdf.(fl, x), label = "Lorentz")
    lines!(ax, x, pdf.(fg, x), label = "Gaussian")
    lines!(ax, x, pdf.(fv, x), label = "Voigt")
    axislegend()
    fig
end

fig1

M = 126.9u"u"
k34 = 7603.14u"cm^-1"

kx = collect(7603.05:0.00001:7603.23)u"cm^-1"
T, P = 150 * u"K", 10 * u"Torr"

fwhm_d = fwhm_doppler(k34, M, T)
fwhm_p = fwhm_pressure(P, 5.0u"MHz/Torr") / 𝑐 |> u"cm^-1"
let
    fig = Figure()
    ax = Axis(fig[1, 1], xlabel="Wavenumber (cm⁻¹)", ylabel="intensity distribution(a. u.)", title="line broadenings of I¹²⁷ (T=$T, P=$P)")
    offset = 7603
    kxx = ustrip.(u"cm^-1", kx) .- offset
    lines!(ax, kxx, ustrip.(profile_pressure.(kx; ν0=k34, νp=fwhm_p)), label="Pressure")
    lines!(ax, kxx, ustrip.(profile_doppler.(kx; ν0=k34, νd=fwhm_d)), label="Doppler")
    lines!(ax, kxx, ustrip.(profile_voigt.(kx; ν0=k34, νd=fwhm_d, νp=fwhm_p)), label="Voigt")
    ax.xtickformat = xs -> ["$(x + offset)" for x in xs]
    axislegend()
    fig
end

fig2

linebroadenings.jl's People

Contributors

lihua-cat avatar

Stargazers

 avatar

Watchers

 avatar

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.