Skip to content

Commit 7bcc0c0

Browse files
authored
Merge pull request #617 from VChristiaens/master
Improvements to pca() and pca_annular() and possibility to calculate results for an input ncomp list
2 parents ffa79a7 + f693bed commit 7bcc0c0

24 files changed

+3491
-930
lines changed

README.rst

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ VIP - Vortex Image Processing package
2828

2929
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7499314.svg
3030
:target: https://doi.org/10.5281/zenodo.7499314
31-
31+
3232
.. image:: https://img.shields.io/badge/EMAC-2207--116-blue
3333
:target: https://emac.gsfc.nasa.gov/?cid=2207-116
3434

@@ -50,7 +50,7 @@ VIP - Vortex Image Processing package
5050
Introduction
5151
------------
5252

53-
VIP is a python package for high-contrast imaging of exoplanets and circumstellar disks.
53+
VIP is a python package for high-contrast imaging of exoplanets and circumstellar disks.
5454
VIP is compatible with Python 3.8, 3.9, 3.10 and 3.11 (Python 2 compatibility dropped with VIP 0.9.9, and Python 3.7 compatibility dropped with VIP 1.4.3).
5555

5656
The goal of VIP is to integrate open-source, efficient, easy-to-use and
@@ -74,15 +74,15 @@ The documentation for VIP can be found here: http://vip.readthedocs.io.
7474

7575
Jupyter notebook tutorial
7676
-------------------------
77-
Tutorials, in the form of Jupyter notebooks, showcasing VIP's usage and
78-
other resources such as test datasets are available in the
79-
``VIP-extras`` `repository <https://github.com/vortex-exoplanet/VIP_extras>`_.
77+
Tutorials, in the form of Jupyter notebooks, showcasing VIP's usage and
78+
other resources such as test datasets are available in the
79+
``VIP-extras`` `repository <https://github.com/vortex-exoplanet/VIP_extras>`_.
8080
**In order to execute the notebook tutorials, you will have to download or clone the VIP-extras repository, and open each tutorial locally with jupyter notebook.**
81-
Alternatively, you can execute the notebooks directly on
82-
`Binder <https://mybinder.org/v2/gh/vortex-exoplanet/VIP_extras/master>`_ (in
83-
the tutorials directory). The first (quick-start) notebook can be visualized
84-
online with `nbviewer
85-
<http://nbviewer.jupyter.org/github/vortex-exoplanet/VIP_extras/blob/master/tutorials/01_quickstart.ipynb>`_.
81+
Alternatively, you can execute the notebooks directly on
82+
`Binder <https://mybinder.org/v2/gh/vortex-exoplanet/VIP_extras/master>`_ (in
83+
the tutorials directory). The first (quick-start) notebook can be visualized
84+
online with `nbviewer
85+
<http://nbviewer.jupyter.org/github/vortex-exoplanet/VIP_extras/blob/master/tutorials/01_quickstart.ipynb>`_.
8686
If you are new to the Jupyter notebook application check out the `beginner's guide
8787
<https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html>`_.
8888

@@ -100,7 +100,7 @@ The benefits of using a Python package manager (distribution), such as
100100
(ana)conda, are many. Mainly, it brings easy and robust package
101101
management and avoids messing up with your system's default python. An
102102
alternative is to use package managers like apt-get for Ubuntu or
103-
Homebrew/MacPorts/Fink for macOS. We recommend using
103+
Homebrew/MacPorts/Fink for macOS. We recommend using
104104
`Miniconda <https://conda.io/miniconda>`_.
105105

106106
VIP depends on existing packages from the Python ecosystem, such as
@@ -109,7 +109,7 @@ VIP depends on existing packages from the Python ecosystem, such as
109109
installing VIP suitable for different scenarios.
110110

111111
Before installing the package, it is **highly recommended to create a dedicated
112-
conda environment** to not mess up with the package versions in your base
112+
conda environment** to not mess up with the package versions in your base
113113
environment. This can be done easily with (replace ``vipenv`` by the name you want
114114
for your environment):
115115

@@ -119,14 +119,14 @@ for your environment):
119119
120120
.. note::
121121
Installing ipython while creating the environment, as in the example above, will
122-
avoid a commonly reported issue which stems from trying to import VIP from
122+
avoid a commonly reported issue which stems from trying to import VIP from
123123
within a base python2.7 ipython console.
124124

125125

126126
For users not planning to contribute:
127127
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128-
Once within your new environment, the easiest way to install VIP is
129-
through the Python Package Index, aka `PyPI <https://pypi.org/>`_, with
128+
Once within your new environment, the easiest way to install VIP is
129+
through the Python Package Index, aka `PyPI <https://pypi.org/>`_, with
130130
the ``pip`` package manager. Simply run:
131131

132132
.. code-block:: bash
@@ -143,8 +143,8 @@ VIP. For upgrading the package, run:
143143
144144
For potential contributors:
145145
^^^^^^^^^^^^^^^^^^^^^^^^^^^
146-
If you plan to contribute or experiment with the code you need to make a
147-
fork of the repository (click on the fork button in the top right corner) and
146+
If you plan to contribute or experiment with the code you need to make a
147+
fork of the repository (click on the fork button in the top right corner) and
148148
clone it:
149149

150150
.. code-block:: bash
@@ -159,22 +159,22 @@ functionalities by cloning the repository (but will not be able to contribute):
159159
$ git clone https://github.com/vortex-exoplanet/VIP.git
160160
161161
162-
To install VIP, then simply cd into your local VIP directory and run the installation in editable mode:
162+
To install VIP, then simply cd into your local VIP directory, and run the installation in editable mode pointing to developer requirements:
163163

164164
.. code-block:: bash
165165
166166
$ cd VIP
167-
$ pip install -e .
167+
$ pip install -e . -r requirements-dev.txt
168168
169-
If cloned from your fork, make sure to link your VIP directory to the upstream
170-
source, to be able to easily update your local copy when a new version comes
169+
If cloned from your fork, make sure to link your VIP directory to the upstream
170+
source, to be able to easily update your local copy when a new version comes
171171
out or a bug is fixed:
172172

173173
.. code-block:: bash
174174
175175
$ git add remote upstream https://github.com/vortex-exoplanet/VIP.git
176176
177-
If you plan to develop VIP or use it intensively, it is highly recommended to
177+
If you plan to develop VIP or use it intensively, it is highly recommended to
178178
also install the optional dependencies listed below.
179179

180180

@@ -186,7 +186,8 @@ The following dependencies are not automatically installed upon installation of
186186
- VIP image operations (e.g. shifts, rotations, scaling) can be performed using ``OpenCV`` instead of the default FFT-based methods. While flux are less well preserved, ``OpenCV`` offers a significant speed improvement (up to a factor 50x), in particular for image rotations, which can be useful to get quick results. Installation: ``pip install opencv-python``.
187187
- Also, you can install the Intel Math Kernel Library (``mkl``) optimizations (provided that you have a recent version of ``conda``) or ``openblas`` libraries. Either of them can be installed with ``conda install``.
188188
- VIP offers the possibility of computing SVDs on GPU by using ``CuPy`` (starting from version 0.8.0) or ``PyTorch`` (from version 0.9.2). These remain as optional requirements, to be installed by the user, as well as a proper CUDA environment (and a decent GPU card).
189-
- Finally, bad pixel correction routines can be optimised with ``Numba``, which converts some Python code, particularly ``NumPy``, into fast machine code. A factor up to ~50x times speed improvement can be obtained on large images compared to NumPy. Numba can be installed with ``conda install numba``.
189+
- Bad pixel correction routines can be optimised with ``Numba``, which converts some Python code, particularly ``NumPy``, into fast machine code. A factor up to ~50x times speed improvement can be obtained on large images compared to NumPy. Numba can be installed with ``conda install numba``.
190+
- Finally, robust contrast curves and contrast grids can be calculated with `applefy`. Example usage is provided in `VIP tutorial 4 <https://vip.readthedocs.io/en/latest/tutorials/04_metrics.html>`_. See more details in `Bonse et al. (2023) <https://ui.adsabs.harvard.edu/abs/2023AJ....166...71B/abstract>`_.
190191

191192

192193
Loading VIP
@@ -206,7 +207,7 @@ Image conventions
206207

207208
By default, VIP routines are compatible with either even- or odd-dimension input frames. For VIP routines that require the star to be centered in the input images (e.g. post-processing routines involving (de)rotation or scaling), the code will assume that it is placed on (zero-based indexing):
208209

209-
- size/2-0.5 for odd-size input images;
210+
- size/2-0.5 for odd-size input images;
210211
- size/2 for even-size input images;
211212

212213
i.e. exactly on a pixel in either cases. The VIP recentering routines will place the star centroid at one of these locations accordingly.
@@ -234,6 +235,6 @@ Maintenance and current development is now led by `Valentin Christiaens <https:/
234235
VIP benefitted from contributions made by collaborators from several teams, including: Ralf Farkas, Julien Milli, Olivier Wertz, Henry Ngo, Alan Rainot, Gary Ruane, Corentin Doco, Miles Lucas, Gilles Orban de Xivry, Lewis Picker, Faustine Cantalloube, Iain Hammond, Christian Delacroix, Arthur Vigan, Dimitri Mawet and Olivier Absil.
235236
More details about the respective contributions are available `here <https://github.com/vortex-exoplanet/VIP/graphs/contributors?from=2015-07-26&to=2022-03-29&type=a>`_.
236237

237-
Please cite `Gomez Gonzalez et al. (2017) <https://ui.adsabs.harvard.edu/abs/2017AJ....154....7G/abstract>`_ and `Christiaens et al. (2023) <https://ui.adsabs.harvard.edu/abs/2023JOSS....8.4774C/abstract>`_ whenever
238+
Please cite `Gomez Gonzalez et al. (2017) <https://ui.adsabs.harvard.edu/abs/2017AJ....154....7G/abstract>`_ and `Christiaens et al. (2023) <https://ui.adsabs.harvard.edu/abs/2023JOSS....8.4774C/abstract>`_ whenever
238239
you publish data reduced with VIP (Astrophysics Source Code Library reference `ascl:1603.003`).
239240
In addition, please cite the relevant publication(s) for the algorithms you use within VIP (usually mentioned in the documentation, e.g. `Marois et al. 2006 <https://ui.adsabs.harvard.edu/abs/2006ApJ...641..556M/abstract>`_ for median-ADI).

docs/source/Installation-and-dependencies.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The benefits of using a Python package manager (distribution), such as
44
(ana)conda, are many. Mainly, it brings easy and robust package
55
management and avoids messing up with your system's default python. An
66
alternative is to use package managers like apt-get for Ubuntu or
7-
Homebrew/MacPorts/Fink for macOS. We recommend using
7+
Homebrew/MacPorts/Fink for macOS. We recommend using
88
`Miniconda <https://conda.io/miniconda>`_.
99

1010
VIP depends on existing packages from the Python ecosystem, such as
@@ -13,7 +13,7 @@ VIP depends on existing packages from the Python ecosystem, such as
1313
installing VIP suitable for different scenarios.
1414

1515
Before installing the package, it is **highly recommended to create a dedicated
16-
conda environment** to not mess up with the package versions in your base
16+
conda environment** to not mess up with the package versions in your base
1717
environment. This can be done easily with (replace ``vipenv`` by the name you want
1818
for your environment):
1919

@@ -23,14 +23,14 @@ for your environment):
2323
2424
.. note::
2525
Installing ipython while creating the environment, as in the example above, will
26-
avoid a commonly reported issue which stems from trying to import VIP from
26+
avoid a commonly reported issue which stems from trying to import VIP from
2727
within a base python2.7 ipython console.
2828

2929

3030
For users not planning to contribute:
3131
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32-
Once within your new environment, the easiest way to install VIP is
33-
through the Python Package Index, aka `PyPI <https://pypi.org/>`_, with
32+
Once within your new environment, the easiest way to install VIP is
33+
through the Python Package Index, aka `PyPI <https://pypi.org/>`_, with
3434
the ``pip`` package manager. Simply run:
3535

3636
.. code-block:: bash
@@ -47,8 +47,8 @@ VIP. For upgrading the package, run:
4747
4848
For potential contributors:
4949
^^^^^^^^^^^^^^^^^^^^^^^^^^^
50-
If you plan to contribute or experiment with the code you need to make a
51-
fork of the repository (click on the fork button in the top right corner) and
50+
If you plan to contribute or experiment with the code you need to make a
51+
fork of the repository (click on the fork button in the top right corner) and
5252
clone it:
5353

5454
.. code-block:: bash
@@ -63,22 +63,22 @@ functionalities by cloning the repository (but will not be able to contribute):
6363
$ git clone https://github.com/vortex-exoplanet/VIP.git
6464
6565
66-
To install VIP, then simply cd into your local VIP directory and run the installation in editable mode:
66+
To install VIP, then simply cd into your local VIP directory, and run the installation in editable mode pointing to developer requirements:
6767

6868
.. code-block:: bash
6969
7070
$ cd VIP
71-
$ pip install -e .
71+
$ pip install -e . -r requirements-dev.txt
7272
73-
If cloned from your fork, make sure to link your VIP directory to the upstream
74-
source, to be able to easily update your local copy when a new version comes
73+
If cloned from your fork, make sure to link your VIP directory to the upstream
74+
source, to be able to easily update your local copy when a new version comes
7575
out or a bug is fixed:
7676

7777
.. code-block:: bash
7878
7979
$ git add remote upstream https://github.com/vortex-exoplanet/VIP.git
8080
81-
If you plan to develop VIP or use it intensively, it is highly recommended to
81+
If you plan to develop VIP or use it intensively, it is highly recommended to
8282
also install the optional dependencies listed below.
8383

8484

@@ -90,7 +90,8 @@ The following dependencies are not automatically installed upon installation of
9090
- VIP image operations (e.g. shifts, rotations, scaling) can be performed using ``OpenCV`` instead of the default FFT-based methods. While flux are less well preserved, ``OpenCV`` offers a significant speed improvement (up to a factor 50x), in particular for image rotations, which can be useful to get quick results. Installation: ``pip install opencv-python``.
9191
- Also, you can install the Intel Math Kernel Library (``mkl``) optimizations (provided that you have a recent version of ``conda``) or ``openblas`` libraries. Either of them can be installed with ``conda install``.
9292
- VIP offers the possibility of computing SVDs on GPU by using ``CuPy`` (starting from version 0.8.0) or ``PyTorch`` (from version 0.9.2). These remain as optional requirements, to be installed by the user, as well as a proper CUDA environment (and a decent GPU card).
93-
- Finally, bad pixel correction routines can be optimised with ``Numba``, which converts some Python code, particularly ``NumPy``, into fast machine code. A factor up to ~50x times speed improvement can be obtained on large images compared to NumPy. Numba can be installed with ``conda install numba``.
93+
- Bad pixel correction routines can be optimised with ``Numba``, which converts some Python code, particularly ``NumPy``, into fast machine code. A factor up to ~50x times speed improvement can be obtained on large images compared to NumPy. Numba can be installed with ``conda install numba``.
94+
- Finally, robust contrast curves and contrast grids can be calculated with `applefy`. Example usage is provided in `VIP tutorial 4 <https://vip.readthedocs.io/en/latest/tutorials/04_metrics.html>`_. See more details in `Bonse et al. (2023) <https://ui.adsabs.harvard.edu/abs/2023AJ....166...71B/abstract>`_.
9495

9596

9697
Loading VIP
@@ -103,4 +104,3 @@ that you are able to import VIP:
103104
import vip_hci as vip
104105
105106
If everything went fine with the installation, you should not get any error message upon importation, and you can start finding exoplanets!
106-

docs/source/tutorials/01A_quickstart.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@
16511651
"You're now ready for more advanced tutorials. If you wish to know more about:\n",
16521652
"\n",
16531653
"- pre-processing functionalities available in VIP (star centering, bad frame trimming, bad pixel correction...) --> go to **Tutorial 2**;\n",
1654-
"- more advanced post-processing algorithms --> go to **Tutorial 3**;\n",
1654+
"- more advanced post-processing algorithms --> go to **Tutorial 3A** or **3B** (the latter for OO example usage);\n",
16551655
"- metrics to evaluate the significance of a detection or the achieved contrast in your image --> go to **Tutorial 4**;\n",
16561656
"- how to characterize a directly imaged companion --> go to **Tutorial 5**;\n",
16571657
"- how to characterize a circumstellar disk --> go to **Tutorial 6**;\n",

docs/source/tutorials/01B_quickstart_with_objects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@
14731473
"You're now ready for more advanced tutorials. If you wish to know more about:\n",
14741474
"\n",
14751475
"- pre-processing functionalities available in VIP (star centering, bad frame trimming, bad pixel correction...) --> go to **Tutorial 2**;\n",
1476-
"- more advanced post-processing algorithms --> go to **Tutorial 3**;\n",
1476+
"- more advanced post-processing algorithms --> go to **Tutorial 3A** or **3B** (the latter for OO example usage);\n",
14771477
"- metrics to evaluate the significance of a detection or the achieved contrast in your image --> go to **Tutorial 4**;\n",
14781478
"- how to characterize a directly imaged companion --> go to **Tutorial 5**;\n",
14791479
"- how to characterize a circumstellar disk --> go to **Tutorial 6**;\n",

0 commit comments

Comments
 (0)