Skip to content

Commit

Permalink
Merge pull request #52 from carlgogo/master
Browse files Browse the repository at this point in the history
VIP version 0.5.2 changes:
  • Loading branch information
carlos-gg authored Sep 22, 2016
2 parents 174d723 + 23b066a commit 3d24b58
Show file tree
Hide file tree
Showing 12 changed files with 475 additions and 298 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.5.2
125 changes: 72 additions & 53 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
@@ -1,68 +1,87 @@

FAQ
----
- The VIP setup doesn't finish the job, it seems to be stuck. What do I do?
We have experienced a few times that the setup script hangs while installing
photutils. The reason why it crashes when compiling its own modules is unknown.
We recommend to kill the process (Ctrl + C) and restart it again by re-running
the setup command. A workaround is to install photutils before executing VIP
setup:
First things first. Please make sure you have the latest version of ``VIP``.
Please go and check the repository now!


On linux, why do I get a matplotlib related error when importing ``VIP``?
*ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5,
or PySide package to be installed, but it was not found.*
You may need to change the matplotlib backend. Find your matplotlibrc
configuration file and change the backend from WXAgg to TkAgg. More info here:
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend. On linux the
matplotlibrc file is located in:

.. code-block:: bash
$HOME/.config/matplotlib/matplotlibrc
Why do I get, in OSX, the following RuntimeError?
*Python is not installed as a framework. The Mac OS X backend will not be able
to function correctly if Python is not installed as a framework. See the
Python documentation for more information on installing Python as a framework
on Mac OS X. Please either reinstall Python as a framework, or try one of the
other backends.*
Again, this is a matplotlib-backend related issue. Read the link in the previous
answer. It can be solved setting the backend to WXAgg or TkAgg.


The ``VIP`` setup.py script doesn't finish the job, it seems to be stuck.
What do I do?
This is very unlikely to happen with the latest versions of pip, setuptools
and ``VIP``'s setup script. Anyway, if this happens kill the process
(Ctrl + C) and start it again by re-running the setup command. A workaround
is to install the problematic dependency before executing ``VIP`` setup:

.. code-block:: bash
$ conda install --channel https://conda.anaconda.org/astropy photutils
$ pip install <problematic_dependency>
- Why the setup fails complaining about the lack of a Fortran compiler?
Fortran compilers are apparently needed for compiling Scipy from source. Make
sure there is a Fortran compiler in your system. A workaround is to install
Scipy through conda before running the setup script:
Why the setup fails complaining about the lack of a Fortran compiler?
Fortran compilers are apparently needed for compiling ``Scipy`` from source. Make
sure there is a Fortran compiler in your system. A workaround is to install
``Scipy`` through conda before running the setup script:

.. code-block:: bash
$ conda install scipy
- Why do I get and error related to importing cv2 package when importing VIP?
cv2 is the name of opencv bindings for python. This library is needed for
fast image transformations. You have to install by following the
aforementioned instructions.

- Why do I get a warning related to DS9/XPA when importing VIP?
Please make sure you have DS9 and XPA in your system path. Try installing it
with your system package management tool.

- Why Python crashes when using some of the parallel functions, e.g.
*pca_adi_annular_quad* and *run_mcmc_astrometry*?
These functions require running SVD on several processes and this can be
problematic depending on the linear algebra libraries on your machine. We've
encountered this problem on OSX systems that use the ACCELERATE library for
linear algebra calculations (default in every OSX system). For this library
the multiprocessing is broken. A workaround is to compile Python against other
linear algebra library (e.g. OPENBLAS). An quick-n-easy fix is to install the
latest ANACONDA (2.5 or later) distribution which ships MKL library and
effectively replaces ACCELERATE on OSX systems. On linux with the default
LAPACK/BLAS libraries VIP successfully distributes the SVDs among all
the existing cores.

- Why do I get, in linux, a matplotlib related error when importing VIP?
(Matplotlib backend_wx and backend_wxagg require wxPython >=2.8)
If you use Canopy python distro then this is caused by the combination
linux/Canopy. Nothing to do with the VIP pipeline. You may need to change the
matplotlib backend. Find your matplotlibrc configuration file and change the
backend from WXAgg to Qt4Agg. More info here:
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend

- Why do I get, in OSX, the RuntimeError shown below?
(Python is not installed as a framework. The Mac OS X backend will not be able
to function correctly if Python is not installed as a framework. See the
Python documentation for more information on installing Python as a framework
on Mac OS X. Please either reinstall Python as a framework, or try one of the
other backends.)
Again, this is a matplotlib-backend issue (not VIP related). Read the link in
the previous question. It can be solved setting the backend to WXAgg or TkAgg.

- I get an error: ValueError: "unknown locale: UTF-8" when importing VIP.
It's not a VIP related problem. The problem must be solved if you add these
lines in your ~/.bash_profile:
Why do I get and error related to importing ``cv2`` package when importing ``VIP``?
``cv2`` is the name of ``Opencv`` bindings for python. This library is needed for
fast image transformations, it is the default library used although it is optional.
You can install it with conda:

.. code-block:: bash
$ conda install opencv
Why do I get a warning related to ``DS9/XPA`` when importing ``VIP``?
Please make sure you have ``DS9`` and ``XPA`` in your system path. Try installing
them using your system's package management tool.


Why Python crashes when using some of the parallel functions, e.g.
``pca_adi_annular`` and ``run_mcmc_astrometry``?
These functions require running SVD on several processes and this can be
problematic depending on the linear algebra libraries on your machine. We've
encountered this problem on OSX systems that use the ACCELERATE library for
linear algebra calculations (default in every OSX system). For this library
the multiprocessing is broken. A workaround is to compile Python against other
linear algebra library (e.g. OPENBLAS). An quick-n-easy fix is to install the
latest ANACONDA (2.5 or later) distribution which ships MKL library and
effectively replaces ACCELERATE on OSX systems. On linux with the default
LAPACK/BLAS libraries ``VIP`` successfully distributes the SVDs among all
the existing cores.


I get an error: ValueError: "unknown locale: UTF-8" when importing ``VIP``.
It's not ``VIP``'s fault. The problem must be solved if you add these lines in
your ~/.bash_profile:

.. code-block:: bash
Expand Down
51 changes: 16 additions & 35 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ the github repository.

The goal of ``VIP`` is to incorporate robust, efficient, easy-to-use, well-documented
and open source implementations of high-contrast image processing algorithms to
the interested scientific community. The main repository of ``VIP`` resides on Github,
the standard for scientific open source code distribution, using Git as a
the interested scientific community. The main repository of ``VIP`` resides on
Github, the standard for scientific open source code distribution, using Git as a
version control system. Github is a repository hosting service with an amazing
web front-end for source-code management and collaboration. It provides features
such as access control, bug tracking, feature requests, task management, and
Expand All @@ -48,11 +48,12 @@ wikis for every project.
``VIP`` is being developed in Python 2.7, a modern open source high-level programming
language, able to express a large amount of functionality per line of code.
Python has a vast ecosystem of scientific open source libraries/packages (e.g.
numpy, scipy, astropy, scikit-learn, scikit-image) and many well-known libraries
have python bindings as well (e.g. opencv). On top of that exist a great tool,
the Jupyter (né IPython) notebook. A notebook file is simple a JSON document,
containing text, source code, rich media output, and metadata. It allows to
combine data analysis and visualization into an easily sharable format.
``numpy``, ``scipy``, ``astropy``, ``scikit-learn``, ``scikit-image``) and many
well-known libraries have python bindings as well (e.g. ``opencv``). On top of
that exist a great tool, the ``Jupyter`` (né ``IPython``) notebook. A notebook
file is simple a JSON document, containing text, source code, rich media output,
and metadata. It allows to combine data analysis and visualization into an
easily sharable format.


Jupyter notebook tutorial
Expand All @@ -65,38 +66,18 @@ Jupyter notebook tutorial
Quick Setup Guide
------------------

Get the code from github by downloading it as a zip file or by cloning the
repository (make sure your system has git installed):
Run:

.. code-block:: bash
$ git clone https://github.com/vortex-exoplanet/VIP.git
Install opencv. If you use Anaconda run:

.. code-block:: bash
$ conda install opencv
From the root of the ``VIP`` package:

.. code-block:: bash
$ python setup.py develop
Start Python (IPython or Jupyter notebook) and check if the setup worked fine by
importing ``VIP``:

.. code-block:: python
import vip
$ pip install git+https://github.com/vortex-exoplanet/VIP.git
Installation and dependencies
------------------------------

You can find a more detailed description of ``VIP``'s dependencies here.
Here you can find a more detailed description of ``VIP``'s dependencies, how to
clone the repository and install ``Opencv`` (optional).

.. toctree::
:maxdepth: 2
Expand All @@ -106,8 +87,8 @@ You can find a more detailed description of ``VIP``'s dependencies here.
Frequently asked questions
---------------------------

Check out this questions if you find problems when installing or running ``VIP`` for
the first time.
Check out this questions if you find problems when installing or running ``VIP``
for the first time.

.. toctree::
:maxdepth: 2
Expand All @@ -126,14 +107,14 @@ image rotation, pixel temporal and spatial subsampling. On top of that several
pre-processing functions are available such as re-centering and bad frame
detection.

For Angular differential imaging (ADI) data several point spread gunction
For Angular differential imaging (ADI) data several point spread function
subtraction techniques are available, from a simple median subtraction to
different low-rank approximations. Principal Component Analysis (PCA) methods
are implemented in different flavours. Also PCA can process RDI and multiple
channel SDI (IFS) data. ``VIP`` contains a first version of the Local Low-rank plus
Sparse plus Gaussian-noise decomposition (LLSG, Gomez Gonzalez et al. 2016).

Functions for Signal-to-noise ratio (S/R) estimation, S/R map generation are
Functions for Signal-to-noise ratio (S/N) estimation and S/N map generation are
included.

Flux and position of point-like sources are estimated using the Negative Fake
Expand Down
56 changes: 33 additions & 23 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,49 @@ Homebrew/MacPorts/Fink for OSX. I personally recommend using Anaconda which you
can find here: https://www.continuum.io/downloads.

A setup.py file (Setuptools Python package) is included in the root folder of
VIP. It takes care of installing most of the requirements for you. VIP depends on
existing packages from the Python ecosystem, such as numpy, scipy, matplotlib,
pandas, astropy, scikit-learn, scikit-image, photutils, emcee, etc.

VIP ships a stripped-down version of RO.DS9 (Russell Owen) for convenient
xpaset/xpaget based interaction with DS9. VIP contains a class vipDS9 that works
on top of RO.DS9 containing several useful methods for DS9 control such as
displaying arrays, manipulating regions, controlling the display options, etc.
VipDS9 functionality will only be available if you have DS9 and XPA installed
on your system PATH.

Opencv (Open source Computer Vision) provides fast c++ image processing
operations and is used by VIP (whenever it's possible) instead of python based
libraries such as ndimage or scikit-image. This dependency is tricky to get
install/compile, but having Anaconda python distribution the process takes just
a command provided that you have a C compiler installed in your system, like g++.
We'll use conda (core component of Anaconda) in this shell/terminal command:
VIP. It takes care of installing most of the requirements for you. ``VIP`` depends
on existing packages from the Python ecosystem, such as ``numpy``, ``scipy``,
``matplotlib``, ``pandas``, ``astropy``, ``scikit-learn``, ``scikit-image``,
``photutils``, ``emcee``, etc.

``VIP`` ships a stripped-down version of ``RO.DS9`` (by Russell Owen) for convenient
``xpaset/xpaget`` based interaction with ``DS9``. ``VIP`` contains a class
``vipDS9`` that works on top of ``RO.DS9`` containing several useful methods for
``DS9`` control such as displaying arrays, manipulating regions, controlling the
display options, etc. ``VipDS9`` functionality will only be available if you have
``DS9`` and ``XPA`` installed on your system PATH.

First, get the code from github by downloading it as a zip file or by cloning the
repository (make sure your system has git installed):

.. code-block:: bash
$ git clone https://github.com/vortex-exoplanet/VIP.git
``Opencv`` (Open source Computer Vision) provides fast c++ image processing
operations and is used by ``VIP`` for basic image transformations. Starting from
version 0.5.2 of ``VIP`` the dependency on ``opencv`` is optional. If you don't
have/want the ``opencv`` python bindings, ``VIP`` will use the much slower
``ndimage/scikit-image`` libraries transparently. Installing ``opencv`` library
is tricky, but having Anaconda python distribution (``conda`` package manager)
the process takes just a command (this is an optional step):

.. code-block:: bash
$ conda install opencv
For installing VIP in your system run setup.py:
For installing ``VIP`` in your system run setup.py:

.. code-block:: bash
$ python setup.py install
The code is in continuous development and will be changing often. It's preferred
to 'install' with the develop flag:
Wait a minute until all the requirements are satisfied. Finally start Python
(or IPython/Jupyter notebook if you prefer) and check that you are able to
import ``VIP``:

.. code-block:: bash
.. code-block:: python
$ python setup.py develop
import vip
In any case wait a couple of minutes until all the requirements are satisfied.
Hopefully you will see the welcome message of ``VIP``.
12 changes: 4 additions & 8 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ Documentation can be found in http://vip.readthedocs.io/.

Quick Setup Guide
------------------
Install opencv. If you use Anaconda run:
Run:

.. code-block:: bash
$ conda install opencv
From the root of the VIP package:

.. code-block:: bash
$ python setup.py develop
$ pip install git+https://github.com/vortex-exoplanet/VIP.git
Read the documentation for a detailed installation procedure (and optionally,
how to install ``Opencv``).
17 changes: 17 additions & 0 deletions requirements
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cython
numpy >= 1.8
scipy >= 0.17
astropy >= 1.0.2
photutils >= 0.2.2
scikit-learn >= 0.17
scikit-image >= 0.11
emcee >= 2.1
corner >= 1.0.2
pandas >= 0.18
matplotlib >= 1.4.3
psutil
pytest
image_registration
FITS_tools
pywavelets
pyprind
Loading

0 comments on commit 3d24b58

Please sign in to comment.