Skip to content

Commit

Permalink
Merge pull request #457 from VChristiaens/readme_update
Browse files Browse the repository at this point in the history
Major v1.0.0 update
  • Loading branch information
VChristiaens authored Sep 11, 2021
2 parents f74d1cb + 1666737 commit 30ad391
Show file tree
Hide file tree
Showing 36 changed files with 2,648 additions and 645 deletions.
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ also install the optional dependencies listed below.

Optional dependencies
^^^^^^^^^^^^^^^^^^^^^

The following dependencies are not automatically installed upon installation of
``VIP`` but may significantly improve your experience:
``VIP`` but may significantly improve your experience:

``VIP`` contains a class ``vip_hci.fits.ds9`` that enables, through ``pyds9``,
the interaction with a DS9 window (displaying numpy arrays, controlling the
Expand Down Expand Up @@ -254,4 +253,4 @@ In addition, if you use one of the following modules, please also cite:
- negfc: `Wertz et al. (2017) <https://ui.adsabs.harvard.edu/abs/2017A%26A...598A..83W/abstract>`_;
- nmf: `Ren et al. (2018) <https://ui.adsabs.harvard.edu/abs/2018ApJ...852..104R/abstract>`_;
- pca: `Amara and Quanz (2012) <https://ui.adsabs.harvard.edu/abs/2012MNRAS.427..948A/abstract>`_ and `Soummer et al. (2012) <https://ui.adsabs.harvard.edu/abs/2012ApJ...755L..28S/abstract>`_;
- specfit: `Christiaens et al. (2021) <https://ui.adsabs.harvard.edu/abs/2021arXiv210210288C/abstract>`_;
- specfit: `Christiaens et al. (2021) <https://ui.adsabs.harvard.edu/abs/2021arXiv210210288C/abstract>`_;
1 change: 1 addition & 0 deletions docs/source/vip_hci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Subpackages
vip_hci.nmf
vip_hci.pca
vip_hci.preproc
vip_hci.specfit
vip_hci.stats
vip_hci.var

Expand Down
52 changes: 52 additions & 0 deletions docs/source/vip_hci.specfit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
vip\_hci.specfit package
====================

.. automodule:: vip_hci.specfit
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

vip\_hci.specfit.chi module
---------------------------

.. automodule:: vip_hci.specfit.chi
:members:
:undoc-members:
:show-inheritance:

vip\_hci.specfit.mcmc\_sampling\_spec module
--------------------------------------------

.. automodule:: vip_hci.specfit.mcmc_samling_spec
:members:
:undoc-members:
:show-inheritance:

vip\_hci.specfit.model\_resampling module
-----------------------------------------

.. automodule:: vip_hci.specfit.model_resampling
:members:
:undoc-members:
:show-inheritance:

vip\_hci.specfit.template\_lib module
------------------------------------

.. automodule:: vip_hci.specfit.template_lib
:members:
:undoc-members:
:show-inheritance:

vip\_hci.specfit.utils\_spec module
------------------------------

.. automodule:: vip_hci.specfit.utils_spec
:members:
:undoc-members:
:show-inheritance:


199 changes: 182 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,182 @@
numpy ~= 1.18
scipy ~= 1.1.0
astropy ~= 3.2
photutils ~= 0.6
scikit-learn ~= 0.17
scikit-image ~= 0.11
emcee ~= 2.1
nestle == 0.2.0
corner ~= 1.0.2
pandas ~= 0.18
matplotlib>=2.2,<=3.3
psutil
pyprind ~= 2.11
munch
opencv-python >= 3.4
pytest
hciplot ~= 0.1.3
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
#
# pip-compile requirements.in
#
astropy==3.2.3
# via
# -r requirements.in
# photutils
attrs==21.2.0
# via pytest
bleach==4.1.0
# via panel
bokeh==2.3.3
# via
# hciplot
# panel
certifi==2021.5.30
# via requests
charset-normalizer==2.0.4
# via requests
colorcet==2.0.6
# via holoviews
corner==1.0.3
# via -r requirements.in
cycler==0.10.0
# via matplotlib
emcee==2.2.1
# via -r requirements.in
hciplot==0.1.9
# via -r requirements.in
holoviews==1.14.5
# via hciplot
idna==3.2
# via requests
imageio==2.9.0
# via scikit-image
importlib-metadata==4.8.1
# via
# markdown
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
jinja2==3.0.1
# via bokeh
joblib==1.0.1
# via scikit-learn
kiwisolver==1.3.2
# via matplotlib
markdown==3.3.4
# via panel
markupsafe==2.0.1
# via jinja2
matplotlib==3.3.0
# via
# -r requirements.in
# hciplot
# scikit-image
munch==2.5.0
# via -r requirements.in
nestle==0.2.0
# via -r requirements.in
networkx==2.6.3
# via scikit-image
numpy==1.21.2
# via
# -r requirements.in
# astropy
# bokeh
# emcee
# hciplot
# holoviews
# imageio
# matplotlib
# opencv-python
# pandas
# photutils
# pywavelets
# scikit-image
# scikit-learn
# scipy
# tifffile
opencv-python==4.5.3.56
# via -r requirements.in
packaging==21.0
# via
# bleach
# bokeh
# pytest
pandas==0.25.3
# via
# -r requirements.in
# holoviews
panel==0.12.1
# via holoviews
param==1.11.1
# via
# colorcet
# holoviews
# panel
# pyct
# pyviz-comms
photutils==0.7.2
# via -r requirements.in
pillow==8.3.2
# via
# bokeh
# imageio
# matplotlib
# scikit-image
pluggy==1.0.0
# via pytest
psutil==5.8.0
# via -r requirements.in
py==1.10.0
# via pytest
pyct==0.4.8
# via
# colorcet
# panel
pyparsing==2.4.7
# via
# matplotlib
# packaging
pyprind==2.11.3
# via -r requirements.in
pytest==6.2.5
# via -r requirements.in
python-dateutil==2.8.2
# via
# bokeh
# matplotlib
# pandas
pytz==2021.1
# via pandas
pyviz-comms==2.1.0
# via
# holoviews
# panel
pywavelets==1.1.1
# via scikit-image
pyyaml==5.4.1
# via bokeh
requests==2.26.0
# via panel
scikit-image==0.18.3
# via -r requirements.in
scikit-learn==0.24.2
# via -r requirements.in
scipy==1.1.0
# via
# -r requirements.in
# scikit-image
# scikit-learn
six==1.16.0
# via
# bleach
# cycler
# munch
# python-dateutil
threadpoolctl==2.2.0
# via scikit-learn
tifffile==2021.8.30
# via scikit-image
toml==0.10.2
# via pytest
tornado==6.1
# via bokeh
tqdm==4.62.2
# via panel
typing-extensions==3.10.0.2
# via
# bokeh
# importlib-metadata
urllib3==1.26.6
# via requests
webencodings==0.5.1
# via bleach
zipp==3.5.0
# via importlib-metadata
3 changes: 2 additions & 1 deletion vip_hci/andromeda/andromeda.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,8 @@ def normalize_snr(snr, nsmooth_snr=1, iwa=None, owa=None, oversampling=None,
if prof_snr[i] != 0:
k = i
if k is None: # error handling not present in IDL version.
set_trace()
import pdb
pdb.set_trace()
raise RuntimeError("prof_snr is zero!")

for i in range(j - nsmooth_snr, k):
Expand Down
18 changes: 10 additions & 8 deletions vip_hci/frdiff/framediff.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

def frame_diff(cube, angle_list, fwhm=4, metric='manhattan', dist_threshold=50,
n_similar=None, delta_rot=0.5, radius_int=2, asize=4, ncomp=None,
nproc=1, verbose=True, debug=False):
imlib='opencv', interpolation='lanczos4', nproc=1, verbose=True,
debug=False):
""" Frame differencing algorithm. It uses vector distance (depending on
``metric``), using separately the pixels from different annuli of ``asize``
width, to create pairs of most similar images. Then it performs pair-wise
Expand All @@ -42,7 +43,7 @@ def frame_diff(cube, angle_list, fwhm=4, metric='manhattan', dist_threshold=50,
function ``sklearn.metrics.pairwise.pairwise_distances`` (check its
documentation).
dist_threshold : int
Indices with a distance larger thatn ``dist_threshold`` percentile will
Indices with a distance larger than ``dist_threshold`` percentile will
initially discarded.
n_similar : None or int, optional
If a postive integer value is given, then a median combination of
Expand Down Expand Up @@ -99,8 +100,8 @@ def frame_diff(cube, angle_list, fwhm=4, metric='manhattan', dist_threshold=50,

res = pool_map(nproc, _pairwise_ann, iterable(range(n_annuli)),
n_annuli, fwhm, angle_list, delta_rot, metric,
dist_threshold, n_similar, radius_int, asize, ncomp,
verbose, debug)
dist_threshold, n_similar, radius_int, asize, ncomp, imlib,
interpolation, verbose, debug)

final_frame = np.sum(res, axis=0)

Expand All @@ -111,9 +112,9 @@ def frame_diff(cube, angle_list, fwhm=4, metric='manhattan', dist_threshold=50,
return final_frame


def _pairwise_ann(ann, n_annuli, fwhm, angles, delta_rot, metric,
dist_threshold, n_similar, radius_int, asize, ncomp, verbose,
debug=False):
def _pairwise_ann(ann, n_annuli, fwhm, angles, delta_rot, metric,
dist_threshold, n_similar, radius_int, asize, ncomp, imlib,
interpolation, verbose, debug=False):
"""
Helper functions for pair-wise subtraction for a single annulus.
"""
Expand Down Expand Up @@ -219,7 +220,8 @@ def _pairwise_ann(ann, n_annuli, fwhm, angles, delta_rot, metric,

cube_out = np.zeros((cube_res.shape[0], array.shape[1], array.shape[2]))
cube_out[:, yy, xx] = cube_res
cube_der = cube_derotate(cube_out, angles_list)
cube_der = cube_derotate(cube_out, angles_list, imlib=imlib,
interpolation=interpolation)
frame_der_median = cube_collapse(cube_der, 'median')

return frame_der_median
Expand Down
2 changes: 1 addition & 1 deletion vip_hci/llsg/llsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _patch_rlrps(array, array_ref, rank, low_rank_ref, low_rank_mode,
PC = get_eigenvectors(rank, L, svdlib, mode=auto_rank_mode,
cevr=cevr, noise_error=residuals_tol,
data_ref=L_ref, debug=debug,
collapse=True)
collapse=True, scaling='temp-standard')
rank = PC.shape[0] # so we can use the optimized rank
if low_rank_ref:
Lnew = np.dot(np.dot(PC, L).T, PC).T
Expand Down
4 changes: 2 additions & 2 deletions vip_hci/medsub/medsub_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def median_sub(cube, angle_list, scale_list=None, fwhm=4, radius_int=0, asize=4,
verbose=verbose, msg='Processing annuli:',
progressbar_single=True)

res = np.array(res)
res = np.array(res, dtype=object)
mres = res[:, 0]
yy = res[:, 1]
xx = res[:, 2]
Expand Down Expand Up @@ -225,7 +225,7 @@ def median_sub(cube, angle_list, scale_list=None, fwhm=4, radius_int=0, asize=4,
angle_list, n_annuli, fwhm, radius_int, asize,
delta_rot, nframes)

res = np.array(res)
res = np.array(res, dtype=object)
mres = res[:, 0]
yy = res[:, 1]
xx = res[:, 2]
Expand Down
Loading

0 comments on commit 30ad391

Please sign in to comment.