Coder Social home page Coder Social logo

serval's Introduction

SERVAL (SpEctrum Radial Velocity AnaLyser)

calculate radial velocities from stellar spectra

The concept of SERVAL is described in http://adsabs.harvard.edu/abs/2017A&A...609A..12Z [pdf].

Currently, SERVAL can process data from CARM_VIS, CARM_NIR, ELODIE, HARPS, HARPN, and SOPHIE.

Recent changes

Install instruction

Requirements:

  • python 2.7 + numpy, scipy, pyfits, astropy
  • gnuplot

Setup the path:

export SERVALHOME=~/mzechmeister
export SERVAL=$SERVALHOME/serval/
export PYTHONPATH=$PYTHONPATH:$SERVALHOME/python/

You can include these lines into your ~/.bashrc. Above is for bash; for tcsh:

setenv SERVALHOME ~
...

Download SERVAL and required tools:

mkdir $SERVALHOME
cd $SERVALHOME
git clone https://github.com/mzechmeister/serval.git
git clone https://github.com/mzechmeister/python.git

Make main files executable:

chmod u+x $SERVAL/src/serval.py
chmod u+x $SERVAL/src/read_spec.py

Install barycorrpy:

pip install barycorrpy

or if you don't have root rights:

pip install --user barycorrpy

See also https://github.com/shbhuk/barycorrpy/wiki/1.-Installation for other possibilities. Note there is a numpy 1.14.0 einsum issue which I reported in astropy/astropy#7051 (comment). I fixed this by removing the unicode_literals in https://github.com/astropy/astropy/blob/v2.0.x/astropy/coordinates/builtin_frames/utils.py. But there might be other ways.

A few c programs come precompiled. But probably it is necessary to compile (e.g. Mac OS) ...

cd $SERVAL/src/
gcc -c  -Wall -O2 -ansi -pedantic -fPIC polyregression.c; gcc -o polyregression.so -shared polyregression.o
gcc -c  -Wall -O2 -ansi -pedantic -fPIC cbspline.c; gcc -o cbspline.so -shared cbspline.o
python -m numpy.f2py -c -m spl_int spl_int.f
cd $SERVAL/src/BarCor
gfortran bary.f -o bary.e

A first try to check whether there are any conflicts. It should list all available options:

$SERVAL/src/serval.py --help

If you have a ~/bin folder, a useful shortcut is:

ln -s $SERVAL/src/serval.py ~/bin/serval
ln -s $SERVAL/src/srv.py ~/bin/srv

Otherwise, an alias can be create and included in ~/.bashrc.

alias serval=$SERVAL/src/serval.py

and you can run it as

serval --help

SERVAL in action

A basic example is:

mkdir data
(cd data; git clone https://github.com/mzechmeister/HARPS.git)
serval gj699 data/HARPS/gj699/ -inst HARPS -targ gj699

-targ requests the coordinates from simbad (otherwise RA and DEC from fits header is used)

After serval has finished, you can inspect the results with srv.py, for instance

srv gj699 -rv -x

Tip

You may want to include the following lines in your ~/.gnuplot:

set colors classic
load "~/mzechmeister/python/zoom.gnu"

In gnuplot 5 this uses the old color scheme from gnuplot 4.

And zoom.gnu gives you some additional features, like pan and zoom with keyboard and arrows keys. In particular, very useful for the look and lookt options to explore the spectra.

Further tips are giving in the wiki.

serval's People

Contributors

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