Skip to main content

Small scripts for astronomy

Project description

# WARNING
Look at the wiki instead: https://github.com/DanielAndreasen/astro_scripts/wiki
It's not done, but I will gradually move documentation to the wiki.






Small tools for an astronomer
=============================

Small scripts to make my life easier.

The tools are mainly (if not exclusive) for spectroscopy. All the small scripts
are fairly well documented, and the python scripts use the module `argparse`
which means you can run them like

python numpy2moog -h

and get some fancy help information on how to use them. The shell scripts have
a block comment in top of the file.

I recommend putting this folder in your PATH so the scripts are easily accesible. To do so depends on your system. I am sure [google](http://www.google.com) can help you ;)

## Dependencies
* [Matplotlib](http://matplotlib.org/)
* [Astropy](http://astropy.org)
* [numpy](http://numpy.org)
* [argparse](https://docs.python.org/3/library/argparse.html)
* [PyAstronomy](http://www.hs.uni-hamburg.de/DE/Ins/Per/Czesla/PyA/PyA/index.html)


## plot_fits
This I find to be a very powerful and handy python script. It simply
plot a fits file and leave you in pan mode (matplotlib). More over it
has the feature to plot a part of the solar spectrum and telluric lines,
and finally redshift the spectrum.

For this script one needs to use the telluric and solar spectrum
provided here and change the path in `plot_fits` in line 46 and line 57.

The wavelength vector is created from the fits (which should be 1D). It uses
the keywords
- CRVAL1: The beginning of the wavelength.
- CDELT1: The step in wavelength.
- NAXIS: The length of the wavelength vector.

![Example](figure1.png "An example of using plot_fits with matplotlib")


## numpy2moog
This is a python script that converts ASCII arrays into the format for [MOOG](http://www.as.utexas.edu/~chris/moog.html]).
It can be a bit tricky, but I will provide examples in the future.


## VALDextraction
This script is used to send emails to `extract all` from the VALD database. A
central wavelength should be inputted with the `-h` flag, and the half range
should be given with the `-s` flag.

#### Example
VALDextraction -w 6743 -s 3

This will open a new email (Thunderbird) with the syntax required for VALD (no
reason to delete the signature) in a 6Å window centered on the wavelength
6743Å.


## splotCommenter.sh
This one-liner I have saved in a script put a `#` on all the lines containing a `center` from a IRAF files after using
the `splot` routine. This allows to easy read the `splot.log` with python using something like `np.loadtxt`. One
probably need to remove date strings. This should be easy to implement I guess.


## VALDprepare.sh
This bash script unpack a linelist from [VALD](http://vald.astro.univie.ac.at/~vald3/php/vald.php) when the download
option is set to FTP. The downloadable file is `.gz`. This file is unpacked and saved in an optional `output` argument
(see the block comment in the script). The references is saved in a seperate file, and the final file is relatively
easy to read with `np.loadtxt`.


## CONTRIBUTE
Feel free to open an issue with suggestions or bugs.


## LICENCE
Read the LICENCE file.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astro_scripts-0.1.0.tar.gz (23.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

astro_scripts-0.1.0-py2.7.egg (72.1 kB view details)

Uploaded Egg

astro_scripts-0.1.0-py2-none-any.whl (35.3 kB view details)

Uploaded Python 2

File details

Details for the file astro_scripts-0.1.0.tar.gz.

File metadata

  • Download URL: astro_scripts-0.1.0.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for astro_scripts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3697a769686d9a9c501b7cdc525409c7f93fd4b1ee91a1bb7e329f8a707a5c19
MD5 baafa731f1909e3315868bfad1887b5e
BLAKE2b-256 f17de4d335e881963e068cac23d68c72a2b6847f7b0ac3eedf5b217598b883d7

See more details on using hashes here.

File details

Details for the file astro_scripts-0.1.0-py2.7.egg.

File metadata

File hashes

Hashes for astro_scripts-0.1.0-py2.7.egg
Algorithm Hash digest
SHA256 b6845ee2a4b11825b0fa70199a677c8e3328d99f840d718d15832c10f573bcd7
MD5 39d2741f438a60ea6861e6e4f910c189
BLAKE2b-256 802aa8ffed5322e90eae3be0dbbf5f939ba8093da3285487fa204028754a119e

See more details on using hashes here.

File details

Details for the file astro_scripts-0.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for astro_scripts-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 c7bfdf79413ed0db8dad5f761c422f042c7f67b576c20e11ad90ea5c28767121
MD5 4be55d384b4084f368898ad8baa90e40
BLAKE2b-256 125cdf36c9e1af13e616c45ac35fcc6cedaab70315a47067b95a8ee61b90815c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page