Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError when running ADI contrast curve in HEEPS with VIP #649

Closed
ChrisDelaX opened this issue Oct 28, 2024 · 1 comment
Closed

IndexError when running ADI contrast curve in HEEPS with VIP #649

ChrisDelaX opened this issue Oct 28, 2024 · 1 comment

Comments

@ChrisDelaX
Copy link
Contributor

While running the demo in the HEEPS environment, we encountered an IndexError related to rad_samp when attempting to generate the ADI contrast curve. Despite extending the COMPASS wavefront file to include 1000 screens and modifying some configuration code, the same error persists. In particular, as you can see in the HEEPS output, the value of the FWHM is a reasonable float (20.75) and the full detector size is 421x421 pixels.

Could you please take a look and see if this might be connected to the recent bugfix you mentioned?

Code Snippet

sep1, adi1 = heeps.contrast.cc_adi(savepsf=True, savefits=True, verbose=True, **conf)

HEEPS Simulation Output

Apply ADI technique: add_bckg=False
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
   mode=CVC, band=N2, pscale=19 mas
   ncube=1000, ndet=421
   duration=3600, dit=0.3 s
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Starting time: 2024-10-27 23:34:51
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
ALGO : median_sub, FWHM = 20.75390589200986, # BRANCHES = 1, SIGMA = 5, STARPHOT = 100000000000.0
Finished the throughput calculation
Running time: 0:01:04.316576
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Full Error Traceback:

IndexError: index 0 is out of bounds for axis 0 with size 0
Traceback (most recent call last):
  File "Cell In[13]", line 3, in <module>
    sep1, adi1 = heeps.contrast.cc_adi(savepsf=True, savefits=True, verbose=True, **conf)
  File "~/Github/HEEPS/heeps/contrast/cc_adi.py", line 129, in cc_adi
    cc_pp = vip_hci.metrics.contrast_curve(psf_ON, pa, psf_OFF_crop,
            fwhm, pscale/1e3, starphot, algo=algo, nbranch=1, sigma=5,
            debug=False, plot=False, transmission=OAT, imlib='opencv',
            verbose=verbose, **algo_dict)
  File "~/Github/VIP-master/vip_hci/metrics/contrcurve.py", line 313, in contrast_curve
    radmax_fwhm = ((cube.shape[-1]-1)//2)-fwhm_med/2
    radmax = min(vector_radd.astype(int).max(), radmax_fwhm)
    cutin2 = np.where(rad_samp.astype(int) == radmax)[0][0]
IndexError: index 0 is out of bounds for axis 0 with size 0
@VChristiaens
Copy link
Contributor

Thanks for pointing this out. This should hopefully be solved with PR #650.
I'll leave the issue open for a few more days just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants