Giter Club home page Giter Club logo

abcdmatrixoptics.jl's Introduction

ABCDMatrixOptics.jl

Build Status codecov Documentation for stable version Documentation for development version

This package implements the linear tracing of simple optical systems based on the Ray transfer matrix analysis. The convention of the optical elements is identical to those on Wikipedia. So far we allow most standard optical elements and geometric and Gaussian beams. If you need another element, feel free to open an issue!

Installation

This package is registered, so type (literally type a ] in the terminal to enter the package manager and leave the package manager with pressing backspace):

julia> ]add ABCDMatrixOptics.jl

Simple Example

See the Pluto.jl examples here. A simple 4f re-imaging system with a magnification of 2 can be expressed as.

using ABCDMatrixOptics

# create needed optical elements
f1 = FreeSpace(200)
l1 = ThinLens(200.0)
f12 = FreeSpace(200 + 400)
l2 = ThinLens(400.0)
f2 = FreeSpace(400)

# simple, single ray
beam = GeometricBeam(w=10.0, k=0.1)

# create optical system
# it's built from left to right.
M = [f1, l1, f12, l2, f2]

# apply the system to the beam
# The matrices are evaluates as f2 * l2 * f12 * l1 * f1 * beam
# * is syntactic sugar for propagate
beam_p = M * beam
GeometricBeam{Float64}(-19.999999999999996, -0.05000000000000001, 1200.0)
# beam is magnified by 2 in size


# GaussianBeam
red_beam = GaussianBeam(w0=5e-3)
blue_beam = GaussianBeam(w0=5e-3, λ=405e-9)

using Plots

plot(M, red_beam)
plot!(M, blue_beam)

Simple plot

To-Dos

  • Plotting mechanism
  • Mirrors
  • Proper docstrings for all functions
  • Handle refractive index inside GaussianBeam properly (check that it works)
  • More testing
  • Host examples as nice Pluto examples.
  • Plotting of Optical elements such as lenses
  • Sagital and tangential elements
  • Examples on cavities and mode matching

Contributing

For any discussion and issues, please open an issue here. If your proposed changes are small, you can directly create a PR. If the proposed changes are larger, it might save time on all sides if we discuss the issue beforehand!

Credits

Substantial parts of this software are forked from ngedwin98 and the ABCDBeamTrace.jl package.

abcdmatrixoptics.jl's People

Contributors

roflmaostc 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.