Giter Club home page Giter Club logo

miescatter.jl's Introduction

MieScatter

Compute Mie scattering in Julia. Mie scattering is the scattering of an electromagnetic plane wave by a homogeneous sphere.

Based on a Fortran code by Karri Muinonen.

Now updated for Julia 1.0.

Usage

The work is done by the compute_mie function. There are two ways to call it:

using MieScatter
S, Qsca, Qext, Qback = compute_mie(x, m, N)
S, Qsca, Qext, Qback = compute_mie(x, m, list_of_angles)

where x is the size parameter (two pi times the sphere radius divided by the wavelength) and m is the (possibly complex-valued) relative refractive index of the sphere (the refractive index of the sphere divided by the refractive index of the infinite medium containing it).

In the first form, N is the number of different scattering angles to compute. The range from 0 to 180 degrees in scattering angle will be split in N steps. N needs to be at least 2.

In the second form, the third parameter can be a list of numbers, which should be between 0 and pi. The Mie computation is performed using these numbers as scattering angles. The list can contain only one number. For example, to compute only backscattering, you can call compute_mie(x, m, [pi]).

The returned matrix S is an Nx4 matrix containing the scattering matrix elements S11, S12, S33 and S34 (in this order), for all N scattering angles. Qsca is the scattering coefficient, Qext the extinction coefficient and Qback backscattering coefficient. Multiplying these coefficients by pi times the radius of the particle squared, you get the cross sections. The absorbtion coefficient Qabs = Qext-Qsca.

Note that if the list of scattering angles is provided by the user, Qext and Qback can only be computed if the list includes zero (forward scattering) and pi (backscattering). These variables will return NaN if this is not true.

For convenience, there is also a function size_parameter(r, lambda), which just returns the size parameter x = 2*pi*r / lambda.

miescatter.jl's People

Contributors

dronir avatar py9mrg 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.