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

Failure mode: cannot convert float NaN to integer #36

Open
laldoroty opened this issue Oct 22, 2024 · 3 comments
Open

Failure mode: cannot convert float NaN to integer #36

laldoroty opened this issue Oct 22, 2024 · 3 comments

Comments

@laldoroty
Copy link
Collaborator

sn="20000104"
ra="8.167274983711236"
dec="-43.08698868442529"
band="Y106"

After ~40 min.

Traceback (most recent call last):
  File "/global/cfs/cdirs/m4385/users/lauren/phrosty/phrosty/pipeline.py", line 559, in <module>
    main()
  File "/global/cfs/cdirs/m4385/users/lauren/phrosty/phrosty/pipeline.py", line 555, in main
    pipeline( args.through_step )
  File "/global/cfs/cdirs/m4385/users/lauren/phrosty/phrosty/pipeline.py", line 465, in __call__
    sfftifier = self.align_and_pre_convolve( templ_image, sci_image )
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m4385/users/lauren/phrosty/phrosty/pipeline.py", line 206, in align_and_pre_convolve
    sfftifier.resampling_image_mask_psf()
  File "/global/cfs/cdirs/m4385/users/lauren/sfft/sfft/SpaceSFFTCupyFlow.py", line 132, in resampling_image_mask_psf
    PixA_Eobj_GPU, EProjDict = CR.frame_extension(XX_proj_GPU=XX_proj_GPU,
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m4385/users/lauren/sfft/sfft/utils/ResampKits.py", line 344, in frame_extension
    RMIN = (math.floor(XX_proj_GPU.min().item()) - 1) - KERHW[0]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer
@laldoroty
Copy link
Collaborator Author

Have to verify this, but it seems like if it fails like this for one SN in one band, it fails like this for all the other bands as well.

@laldoroty
Copy link
Collaborator Author

This happens when the template and science image are the same image, which sometimes happens for the modified NN2 method that Bastien and I are working on.

@wmwv
Copy link
Collaborator

wmwv commented Nov 12, 2024

If it's an easy fix, sure, do it. But in general subtraction of two identical images is not a use case that most subtraction algorithms have as a test case. It's very easy to have divides by 0, lack of gradients in solutions, etc.

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