Code Monkey home page Code Monkey logo

gravi_align's Introduction

Spectral calibration/alignment of GRAVITY

Python 3.9

Command-line tool to perform a spectral calibration on high-resolution GRAVITY data.

Installation

It is recommended to create a separate environment with conda create -n <env_name> python=3.7. Then, within your Conda env (conda activate <env_name>):

# Install package from github
python -m pip install git+https://github.com/DrSoulain/gravi_align

How to use it?

You are supposed to be on top repo where --datadir (default: reduced/) repository is located. This calibration step supposed that you used run_gravi_reduced.py first to save the spectrum files (*spectrumaligned.fits), and created all *.sof, *.sh and *_wave.fits.

The first step uses the correlation map between spectrum to compute inter-spectrum shifts. Spectral calibration is also performed to offset the entire wavelengths table fitted with telluric lines around Brγ. You can add -p to plot diagnostic figures and -s to save those figures (fig_gravi_align/). The diagnostic figures include the computation of the applied shifts (in nm, 'compute_shift_*.png'), the correlation map ('corr_map_*.png'), the raw ('raw_spectra_*.png') and aligned spectrum ('aligned_spectra_*.png'), the absolute tellurics fit ('fit_tellu_*.png') and the spectra plot ('Selected_spectrum_*.png').

Note: If you used --flag argument, 'Selected_spectrum_*.png' show the rejected points for each spectrum.

You can add -d to perform the calibration using the first calibrator file. See gravi_align run -h for details.

gravi_align run

Note: By default, the shifts are computed using the telluric doublet around 2.18 µm (2.182, 2.1865).

You can select an other region by adding --corr argument:

gravi_align run --corr 2.16 2.17

Tips: It is usefull to check the region around Brγ (i.e.: --corr 2.146 2.186).

By default, the Brγ line is skipped by the correlation to focus on telluric lines. For noisy data, where tellurics are too weak, you can force to use the Brγ region by adding --brg.

Once good and satisfied by the alignment, you can overwrite the *_wave.fits with the same arguments (-corr, --flag, --brg, etc. if any):

gravi_align run -w

You can check the different spectrum (*_spectrumaligned.fits) alignment present in --datadir (default: reduced/):

gravi_align check --wl 2.166 0.02

Then, you can modify the .sof corresponding to p2vm computation (add modified *_wave.fits as WAVE) and run the p2vm recipe (esorex).

gravi_align p2vm

And finally, remove all the fits file in --datadir except the calibration files. The diagnostic table is printed to check if all mandatory calibration files are present.

gravi_align clean

Note: Be highly careful with this feature; the shifts computation and the associated *_wave.fits modification need to be executed before.

The calibrated *_wave.fits and the new associated p2vm calibration file (*_p2vm.fits) are now computed. You can now run run_gravi_reduce.py to finally extract your data including the new spectral calibration.

gravi_align's People

Contributors

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