Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release-v0.10.x' into stable
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.rst
#	doc/conf.py
#	megaradrp/__init__.py
#	megaradrp/recipes/auxiliary/acquisitionlcb.py
#	megaradrp/recipes/calibration/lcbstdstar.py
#	megaradrp/recipes/calibration/mosstdstar.py
#	setup.py
  • Loading branch information
sergiopasra committed Jun 30, 2020
2 parents b98711b + 7a16e04 commit bee4e04
Show file tree
Hide file tree
Showing 98 changed files with 5,691 additions and 1,405 deletions.
25 changes: 25 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- htmlzip

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc/requirements.txt

17 changes: 10 additions & 7 deletions .travis.yml
Expand Up @@ -4,11 +4,15 @@ sudo: false
matrix:
include:
- python: "2.7"
env: DEPS="numpy scipy astropy==2.0 enum34"
env: DEPS="numpy scipy astropy==2.0.16 enum34"
- python: "3.5"
env: DEPS="numpy scipy astropy==3.0" COVERAGE=true
env: DEPS="numpy scipy astropy==3.2.3"
- python: "3.6"
env: DEPS="numpy scipy astropy==3.0"
env: DEPS="numpy scipy astropy==4.0.1"
- python: "3.7"
env: DEPS="numpy scipy astropy==4.0.1" COVERAGE=true
- python: "3.8"
env: DEPS="numpy scipy astropy==4.0.1"

cache:
pip: true
Expand All @@ -19,15 +23,14 @@ install:
- pip install Cython
- pip install "numpy>=1.16"
- pip install git+git://github.com/guaix-ucm/numina.git#egg=numina
- pip install $DEPS scikit-image pip pytest setuptools Cython six>=1.7
- pip install pytest-benchmark pytest-cov
- pip install $DEPS scikit-image pytest setuptools six>=1.7 jsonschema
- pip install pytest-remotedata
- if [[ $COVERAGE == true ]]; then pip install coveralls; fi
- if [[ $COVERAGE == true ]]; then pip install codeclimate-test-reporter; fi

script:
- py.test -s -v megaradrp
- if [[ $COVERAGE == true ]]; then py.test megaradrp --cov=megaradrp; fi
- pytest megaradrp
- if [[ $COVERAGE == true ]]; then coverage run --source megaradrp -m pytest; fi

after_success:
- if [[ $COVERAGE == true ]]; then coveralls; fi
Expand Down
50 changes: 32 additions & 18 deletions README.rst
Expand Up @@ -3,37 +3,51 @@
MEGARA DRP
==========

|zenodo|
|zenodo| |docs| |pypi| |travis| |coveralls|

.. image:: https://readthedocs.org/projects/megara-drp/badge/?version=latest
:target: https://readthedocs.org/projects/megara-drp/?badge=latest
:alt: Documentation Status

.. image:: https://travis-ci.org/guaix-ucm/megaradrp.svg?branch=master
:target: https://travis-ci.org/guaix-ucm/megaradrp
This is Megara DRP, the data reduction pipeline for MEGARA,
the optical Integral-Field Unit and Multi-Object Spectrograph
designed for the Gran telescopio Canarias (GTC).


.. image:: https://coveralls.io/repos/guaix-ucm/megaradrp/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/guaix-ucm/megaradrp?branch=master
You can install `megaradrp` using
the `released code in PyPI <https://pypi.org/project/megaradrp/>`_ or
the `development version in Github <https://github.com/guaix-ucm/megaradrp>`_.

The installation instructions are available in the
`online documentation <https://megaradrp.readthedocs.io/en/latest/installation.html>`_
or `doc/installation.rst <doc/installation.rst>`_ in the source distribution.

This is Megara DRP, the data reduction pipeline for MEGARA

Licensing
---------

Megara DRP is distributed under GNU GPL, either version 3 of the License,
or (at your option) any later version. See the file LICENSE.txt for details.

Python 2.7 or 3.4 (or greater) is required. Megara DRP requires the following packages
installed in order to be able to be installed and work properly:

- setuptools (http://peak.telecommunity.com/DevCenter/setuptools)
- numpy >= 1.7 (http://www.numpy.org/)
- scipy (http://www.scipy.org)
- astropy >= 2.0 (http://www.astropy.org/)
- numina >= 0.21 (http://guaix.fis.ucm.es/projects/numina/)
- scikit-image (http://scikit-image.org/)
Authors
-------

Webpage: https://guaix.fis.ucm.es/megara

Maintainers: Sergio Pacual sergiopr@fis.ucm.es, Nicolás Cardiel cardiel@ucm.es

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.593647.svg
:target: https://zenodo.org/record/593647

.. |docs| image:: https://readthedocs.org/projects/megaradrp/badge/?version=latest
:target: https://readthedocs.org/projects/megaradrp/?badge=latest
:alt: Documentation Status

.. |pypi| image:: https://badge.fury.io/py/megaradrp.svg
:target: https://badge.fury.io/py/megaradrp

.. |travis| image:: https://img.shields.io/travis/guaix-ucm/megaradrp/master?logo=travis%20ci&logoColor=white&label=Travis%20CI
:target: https://travis-ci.org/guaix-ucm/megaradrp
:alt: megaradrp's Travis CI Status

.. |coveralls| image:: https://coveralls.io/repos/guaix-ucm/megaradrp/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/guaix-ucm/megaradrp?branch=master
:alt: megaradrp's Coverall Status

1 change: 0 additions & 1 deletion doc/calibration/index.rst
Expand Up @@ -78,6 +78,5 @@ MEGARA team.
fiberflat
twilight
bpm
linearity
lcbstd
mosstd
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/conf.py
Expand Up @@ -27,8 +27,8 @@

project = u'MEGARA Data Reduction Pipeline'
copyright = u'2013-2020, Universidad Complutense de Madrid'
version = '0.9'
release = '0.9.3'
version = '0.10'
release = '0.10.1'
show_authors = True

numpydoc_show_class_members = False
Expand Down
159 changes: 24 additions & 135 deletions doc/installation.rst
Expand Up @@ -9,13 +9,14 @@ Requirements
The MEGARA Pipeline package requires the following packages installed in order to
be able to be installed and work properly:

- `python <https://www.python.org>`_ either 2.7 or >= 3.4
- `python <https://www.python.org>`_ either 2.7 or >= 3.5
- `setuptools <http://peak.telecommunity.com/DevCenter/setuptools>`_
- `numpy <http://www.numpy.org/>`_ >= 1.7
- `scipy <http://www.scipy.org/>`_
- `astropy <http://www.astropy.org/>`_ >= 2.0
- `numpy <https://www.numpy.org/>`_ >= 1.7
- `scipy <https://www.scipy.org/>`_
- `astropy <https://www.astropy.org/>`_ >= 2.0
- `numina <https://pypi.python.org/pypi/numina/>`_ >= 0.17
- `scikit-image <http://scikit-image.org/>`_
- `scikit-image <https://scikit-image.org/>`_
- `jsonschema <https://python-jsonschema.readthedocs.io/en/stable/>`_

Additional packages are optionally required:

Expand All @@ -27,16 +28,6 @@ Additional packages are optionally required:
Installing MEGARA DRP
*********************

Using Conda
===========

`megaradrp` can be installed with conda using a custom channel.

From the shell, execute:::

conda install -c conda-forge megaradrp


Using pip
=========
To install with pip, simply run:::
Expand All @@ -50,6 +41,14 @@ To install with pip, simply run:::
your Numpy installation, which may not always be desired.


Using Conda
===========

`megaradrp` can be installed with conda using a custom channel.

From the shell, execute:::

conda install -c conda-forge megaradrp


Building from source
Expand Down Expand Up @@ -119,148 +118,38 @@ It's a great way to quickly test new libraries without cluttering your
global site-packages or run multiple projects on the same machine which
depend on a particular library but not the same version of the library.

Install virtualenv
------------------
I install it with the package system of my OS, so that it ends in my
global site-packages.

With Fedora/EL is just::

$ sudo yum install python-virtualenv

Since Python version 3.3, there is also a module in the standard library
called `venv` with roughly the same functionality.

Create virtual environment
--------------------------
Create the virtual environment enabling the packages already installed
in the global site-packages via the OS package system. Some requirements
(in particullar numpy and scipy) are difficult to build: they require
compiling and external C and FORTRAN libraries to be installed.

So the command is::

$ virtualenv --system-site-packages myenv
In order to create a virtual environment called e.g. megara using `venv`:

If you need to create the virtualenv without global packages, drop the
system-site-packages flag.
$ python3 -m venv megara

Activate the environment
------------------------
Once the environment is created, you need to activate it. Just change
directory into it and load with your command line interpreter the
script bin/activate.
directory into it and source the script `bin/activate`.

With bash::

$ cd myenv
$ cd megara
$ . bin/activate
(myenv) $
(megara) $

With csh/tcsh::

$ cd myenv
$ cd megara
$ source bin/activate
(myenv) $
(megara) $

Notice that the prompt changes once you are activate the environment. To
deactivate it just type deactivate::

(myenv) $ deactivate
(megara) $ deactivate
$

*********************
Installing MEGARA DFP
*********************

This section described how to install the MEGARA Pipeline inside
the GTC Control system.

In the following we assume that we are installing with user `gcsop`.

Login in the `gcsop` account and activate the GTC environment::

$ /opt/gcs/tools/nrp -p linux -s bash

Change working directory to ``/work/gcsop/src_python/gtc``::

$ cd /work/gcsop/src_python/gtc
$ ls
AL DSL SSL

We have to install `numina` under `DSL` and `megaradrp` under `AL`.


Please refer to :ref:`Numina manual <numina:solaris10>` to install Numina
and its dependences under Solaris 10.

Install numina
==============

First, install all the dependencies:

- setuptools
- six
- numpy >= 1.7
- scipy
- astropy >= 1.0
- PyYaml
- singledispatch

If you are installing a development version, Cython is also required.

Most are available as precompiled packages in Linux.
Please refer to :ref:`Numina manual <numina:solaris10>` to install Numina
and its dependences under Solaris 10.

Then, download the source code, either from PyPI or github::

$ pwd
/work/gcsop/src_python/gtc/DSL/
$ git clone https://github.com/guaix-ucm/numina.git
$ cd numina

Create a file `numina.mod` with the following content::

NAME=numina
TYPE=device

l:numina:python:y

And then build and install using `nmk`::

$ nmk -t module.rebuild
$ nmk -t module.install

Install megaradrp
=================

Change directory to `/work/gcsop/src_python/gtc/AL/` and download the source code
of `megaradrp`, either from `PyPI <https://pypi.python.org/pypi/megaradrp>`_
or from `github <https://github.com/guaix-ucm/megaradrp>`_::

$ pwd
/work/gcsop/src_python/gtc/AL/
$ git clone https://github.com/guaix-ucm/megaradrp.git
$ cd megaradrp

Create a file `megaradrp.mod` with the following content::

NAME=megaradrp
TYPE=device

l:megaradrp:python:y

And then build and install using `nmk`::

$ nmk -t module.rebuild
$ nmk -t module.install

You can check that everything works by running the `numina` command line tool::

$ numina show-instruments
Instrument: MEGARA
has configuration 'default'
has pipeline 'default', version 1

.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _sphinx: http://sphinx.pocoo.org

9 changes: 9 additions & 0 deletions doc/reference/datatype.rst
@@ -0,0 +1,9 @@
==================================================================
:mod:`megaradrp.datatype` --- MEGARA types of data
==================================================================


.. automodule:: megaradrp.datatype
:members:
:undoc-members:

3 changes: 2 additions & 1 deletion doc/reference/index.rst
Expand Up @@ -26,8 +26,9 @@ Reference
processing
products
recipes
types
ntypes
datamodel
datatype
utils
validators
visualization
Expand Down
8 changes: 7 additions & 1 deletion doc/reference/instrument.rst
Expand Up @@ -7,5 +7,11 @@
:synopsis: Static configuration


.. autoclass:: megaradrp.instrument.loader.Loader
.. automodule:: megaradrp.instrument.components
:members:

.. automodule:: megaradrp.instrument.configs
:members:

.. automodule:: megaradrp.instrument.focalplane
:members:

0 comments on commit bee4e04

Please sign in to comment.