Skip to content

Commit 87056ca

Browse files
authored
Merge pull request #686 from VChristiaens/master
Minor bug fix for PCA-RSDI
2 parents 2189495 + 25265a9 commit 87056ca

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ help:
1010

1111
pypi:
1212
rm dist/*
13+
rm -rf build/*
14+
rm -r vip_hci.egg-info
15+
pip install --upgrade pip setuptools wheel build twine
1316
python -m build
1417
twine upload dist/*
1518

1619
pypi-test:
20+
rm dist/*
21+
rm -rf build/*
22+
rm -r vip_hci.egg-info
23+
pip install --upgrade pip setuptools wheel build twine
1724
python -m build
1825
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
1926

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["flit_core >=3.11,<4"]
3-
build-backend = "flit_core.buildapi"
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "vip_hci"

src/vip_hci/metrics/snr_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def _snr_approx(array, source_xy, fwhm, centery, centerx):
226226
def indep_ap_centers(array, source_xy, fwhm, exclude_negative_lobes=False,
227227
exclude_theta_range=None, no_gap=False):
228228
"""
229-
Define independent aperture centers at a given radial separation, starting
229+
Define independent aperture centers at a given radial separation, starting\
230230
from a test location provided with source_xy.
231231
232232
Parameters

src/vip_hci/psfsub/pca_fullfr.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,15 @@ def pca(*all_args: List, **all_kwargs: dict):
301301
and boat regions, respectively, following the denominations in [REN23]_.
302302
If only one mask is provided, it will be used as the anchor, and the
303303
boat images will not be masked (i.e., full frames used).
304-
ref_strategy: str, opt {'RDI', 'ARDI'}
304+
ref_strategy: str, opt {'RDI', 'ARDI', 'RSDI', 'ARSDI'}
305305
[cube_ref is not None] Indicates the strategy to be adopted when a
306-
reference cube is provided. By default, RDI is done - i.e. the science
307-
images are not used in the PCA library. If set to 'ARDI', the PCA
308-
library is made of both the science and reference images.
306+
reference cube is provided. By default, RDI is done for a 3D input cube,
307+
while RSDI is done for a 4D input cube if a ``scale_list`` is provided
308+
(otherwise RDI is done channel per channel). RSDI rescales all channels
309+
to build a larger reference library available for each channel. If
310+
``ref_strategy`` is set to 'ARDI' or 'ARSDI', the PCA library is made of
311+
both the science and reference images. In the case of 'ARSDI', all
312+
channels (science and reference) are rescaled for a larger library.
309313
check_memory : bool, optional
310314
If True, it checks that the input cube is smaller than the available
311315
system memory.
@@ -1155,7 +1159,7 @@ def _adimsdi_singlepca(
11551159
idx_ini = ifs_collapse_range[0]
11561160
idx_fin = ifs_collapse_range[1]
11571161

1158-
cube_desc_residuals = np.zeros_like(cube)
1162+
cube_desc_residuals = np.zeros_like(cube[idx_ini:idx_fin])
11591163

11601164
for i in Progressbar(range(n), verbose=verbose):
11611165
res_i = scwave(

0 commit comments

Comments
 (0)