Skip to content

Commit

Permalink
Merge f7672a4 into 21902eb
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-neal committed Mar 25, 2019
2 parents 21902eb + f7672a4 commit 9857e7a
Show file tree
Hide file tree
Showing 63 changed files with 2,866 additions and 2,475 deletions.
21 changes: 21 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Read the Docs Configuration File

# Build PDF aswell as HTML and JSON
formats:
- pdf

# Requirements file
requirements_file:
requirements_dev.txt

build:
image: latest

python:
version: 3.6
setup_py_install: true
# From extras_require in setup.py
extra_requirements:
- dev
- tests
- docs
3 changes: 2 additions & 1 deletion .shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ build:

cache_dir_list:
- $HOME/.cache/pip
- $HOME/data/test_data
- $HOME/tests/data
- $HOME/data

ci:
- pip install --upgrade pip
Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ python:
cache:
directories:
- $HOME/.cache/pip
- $HOME/data/test_data
- $HOME/tests/data
- $HOME/data

install:
- pip install --upgrade pip
Expand All @@ -29,12 +30,14 @@ before_script:
# Prepare atmosphere models
- make atmos V=1
# - python scripts/split_atmmodel.py -b K H J Y Z TEST
# - python scripts/bary_shift_atmmodel.py -b K H J Y Z TEST
# - python scripts/barycenter_broaden_atmmodel.py -b K H J Y Z TEST

script:
- pytest --cov=eniric --cov-report term-missing --durations 5
- coverage xml -i

- rstcheck -r docs

after_success:
- coveralls
- codeclimate-test-reporter
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ To get a list of commit messages since last version to help write change log try
- Example Notebooks.
- Add `Contributing.md` and `Contributors.md`.
- Zip required testing data, Delete unneeded data.
- Refactor `eniric.Qcalculator` module to `eniric.precision`.

Other:
- `Blacken` source code.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ clean-data:

atmos:
split_atmmodel.py -b ALL
bary_shift_atmmodel.py -b ALL
barycenter_broaden_atmmodel.py -b ALL

clean-build:
rm --force --recursive build/
Expand Down
61 changes: 26 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# [ENIRIC](https://github.com/jason-neal/eniric) - Extended Near InfraRed Information Content

[![Documentation Status](https://readthedocs.org/projects/eniric/badge/?version=latest)](https://eniric.readthedocs.io/en/latest/?badge=latest)
[![Python 3.6+](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/24d3d525a79d4ae493de8c527540edef)](https://www.codacy.com/app/jason-neal/eniric?utm_source=github.com&utm_medium=referral&utm_content=jason-neal/eniric&utm_campaign=badger)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/24d3d525a79d4ae493de8c527540edef)](https://www.codacy.com/app/jason-neal/eniric?utm_source=github.com&utm_medium=referral&utm_content=jason-neal/eniric&utm_campaign=Badge_Coverage)
Expand All @@ -13,7 +14,7 @@
`Eniric` is an overhaul and extension to the code used in [Figueria et al. 2016](http://dx.doi.org/10.1051/0004-6361/201526900) to analysis the precision of M-dwarf stars.
Extending the performance and usability, it is able to be used on any synthetic spectra from the [PHOENIX-ACES](http://phoenix.astro.physik.uni-goettingen.de) and [BT-Settl](https://phoenix.ens-lyon.fr/Grids/BT-Settl/CIFIST2011_2015/FITS/) (CIFIST2001-2015) libraries.

Checkout the [wiki here](https://github.com/jason-neal/eniric/wiki)!
Checkout the documentation on [Read the Docs](https://eniric.readthedocs.io/en/latest/)!

## Features:
`Eniric` contains a number of features to transform and prepare the spectra (observed and synthetic).
Expand All @@ -36,52 +37,42 @@ Checkout the [wiki here](https://github.com/jason-neal/eniric/wiki)!


# [Installation](https://github.com/jason-neal/eniric/wiki/Installation)
Currently to install `Eniric` you need to clone the repo:
```
git clone https://github.com/jason-neal/eniric
cd eniric
pip install -r requirements.txt
python setup.py develop
```

A pip installable version is in the works...
You can install ``Eniric`` by cloning the current ``master`` branch.

It is recommended to use a ``conda`` or ``virtualenv`` environment.
To use the most up-to-date packages install the pinned requirements from the ``requirements_dev.txt`` file

git clone https://github.com/jason-neal/eniric
cd eniric
pip install -r requirements_dev.txt
python setup.py develop

You also need to manually install [Starfish](https://github.com/iancze/Starfish)

Installation from the github repository should also be possible with `pip`.

```
git clone git@github.com:iancze/Starfish.git
cd Starfish
python setup.py build_ext --inplace
python setup.py develop
cd ..
pip install https://github.com/jason-neal/eniric/archive/develop.zip#egg=eniric
```
see [here](https://github.com/iancze/Starfish) for more information about installing Starfish.
For **windows** installation of `Starfish` also see [starfish#87](see https://github.com/iancze/Starfish/issues/87).


If there are issues with installing Starfish see [https://github.com/iancze/Starfish](https://github.com/iancze/Starfish)

If you are not going to use `eniric` to analyze PHOENIX-ACES or BT-Settl synthetic spectral models then you may
get away with not installing it (some tests will just xfail).

##### Requirements for `Eniric` :
These should be automatically installed (if not present) when installing `eniric`.
- astropy
- joblib>=0.12.3
- matplotlib
- numpy
- numpy>=0.15.4
- pandas
- pyyaml
- scipy
- Starfish
- tqdm

If want to use known working pinned versions they can be found in `requirements_dev.txt`.
To install these run `pip install -r requirements_dev.txt`.

##### Extra requirements for Starfish:
- corner
- cython
- h5py
- scikit-learn

If you are not going to use `eniric` to analyze PHOENIX-ACES or BT-Settl synthetic spectral models then you may
get away with not installing it (some tests will just xfail).


## Preparation
#### Data download
To download the data for eniric, an atmopsheric transmission spectra and some test Spectra run the
Expand Down Expand Up @@ -127,12 +118,12 @@ To perform telluric masking and account for the transmission of Earth's atmosphe
`Eniric` includes the telluric spectra uses in Figueira et al. 2016, averaged over 2014.
To automatically prepare the telluric masks, splitting into bands and applying the barycentric expansion run the following scripts:
- `split_atmmodel.py`
- `bary_shift_atmmodel.py`
- `barycenter_broaden_atmmodel.py`

These will split the large telluirc spectra into the bands specified in the `config.yaml` so that the
opening and slicing of the large telluric spectrum is not performed continually.

To change the telluric line cutoff depth you to 4% can pass (default = 2%) you can pass it like this
The default depth is 2%. To change the telluric line cutoff depth to 4% you can pass it like this

`split_atmmodel.py --cutoff-depth 4`

Expand Down Expand Up @@ -160,7 +151,7 @@ You will need to configure the path to the phoenix models in ´config.yaml´

e.g.

phoenix_precision.py -t 3900 -l 4.5, -m 0.5 -r 100000 -v 1.0 -b J K
phoenix_precision.py -t 3900 -l 4.5 -m 0.5 -r 100000 -v 1.0 -b J K

Will calculate the RV precision in the `J` and `K`-band of the PHOENIX-ACES spectra with parameters \[Teff=3900K, logg=4.5, \[Fe/H\]=0.5\] observed at a resolution of 100,000 and rotating with 1.0 km/s.
For more details on the command line arguments to use see the [wiki](https://github.com/jason-neal/eniric/wiki) or type
Expand Down Expand Up @@ -223,4 +214,4 @@ It had a number of efficiency issues with convolution which were improved upon

To reproduce the updated results for [Figueira et al. 2016](http://dx.doi.org/10.1051/0004-6361/201526900) run

phoenix_precision.py -t 3900 3500 2800 2600 -l 4.5, -m 0.5 -r 60000 80000 100000 -v 1.0 5.0 10.0 -b Z Y J H K
phoenix_precision.py -t 3900 3500 2800 2600 -l 4.5 -m 0.5 -r 60000 80000 100000 -v 1.0 5.0 10.0 -b Z Y J H K
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ environment:
# For Python versions available on Appveyor, see
# http://www.appveyor.com/docs/installed-software#python
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37-x64"

cache:
- "%LOCALAPPDATA%\\pip\\Cache -> appveyor.yml" # Use cache unless appveyor.yml changes.
- "data\\test_data -> appveyor.yml" # Use cache unless appveyor.yml changes.
- "tests\\data -> appveyor.yml"
- "data\\ -> appveyor.yml"
- "tests\\data -> appveyor.yml"

install:
- SET PATH=%PYTHON%;%PYTHON%\Scripts\;%path%
Expand All @@ -32,7 +32,7 @@ install:

# Prepare atmosphere models
- cmd: "%PYTHON%\\python.exe scripts\\split_atmmodel.py -b ALL"
- cmd: "%PYTHON%\\python.exe scripts\\bary_shift_atmmodel.py -b ALL"
- cmd: "%PYTHON%\\python.exe scripts\\barycenter_broaden_atmmodel.py -b ALL"

build: off

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def model_parameters(request):
return request.param


# Define some fixtures for Qcalculator.
# Define some fixtures for eniric.precision.
per_s_cm2 = (1 / u.second) / (u.centimeter ** 2)


Expand Down
5 changes: 5 additions & 0 deletions docs/.rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[rstcheck]
ignore_directives=
ignore_roles=
ignore_messages=(Unknown directive type "autoclass".|No directive entry for "autoclass" in module "docutils.parsers.rst.languages.en".|Unknown directive type "automodule".|Unknown directive type "autofunction".|No directive entry for "autofunction" in module "docutils.parsers.rst.languages.en".|No directive entry for "automodule" in module "docutils.parsers.rst.languages.en".)
report=warning
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 comments on commit 9857e7a

Please sign in to comment.