Giter VIP home page Giter VIP logo

milne's Introduction

milne

Milne-Eddington synthesis

This is a module for the synthesis of spectral lines in the Milne-Eddington approximation.

Compilation

The code is written in Fortran 90 and has to be compiled with the gfortran free compiler. Install it in your system and type the following in the source directory:

python setup.py build_ext --inplace

Usage

from milne import milne

# Define the details of the spectral line
lambda0 = 6301.5080
JUp = 2.0
JLow = 2.0
gUp = 1.5
gLow = 1.833
lambdaStart = 6300.8
lambdaStep = 0.03
nLambda = 50

lineInfo = np.asarray([lambda0, JUp, JLow, gUp, gLow, lambdaStart, lambdaStep])

# Define the model
BField = 100.0
BTheta = 20.0
BChi = 20.0
VMac = 2.0
damping = 0.0
B0 = 0.8
B1 = 0.2
mu = 1.0
VDop = 0.085
kl = 5.0
modelSingle = np.asarray([BField, BTheta, BChi, VMac, damping, B0, B1, VDop, kl])

# Generate the object and do one synthesis. The wavelength axis is a property of the object
s = milne(nLambda, lineInfo)
stokes = s.synth(modelSingle,mu)

# It can also synthesize many models at the same time
model = np.tile(modelSingle, (nModels,1)).T
stokes = s.synthGroup(model,mu)

# It can also return the response functions
stokes, dStokes = s.synthDerivatives(modelSingle,mu)

# Or for many models
stokes, dStokes = s.synthGroupDerivatives(model,mu)

milne's People

Contributors

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