radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
95 stars 61 forks source link

Broken comparison operator? #851

Open keflavich opened 1 year ago

keflavich commented 1 year ago

I encountered the strangest situation with a slice of a PSF where the PSF was all zero (which shouldn't occur to begin with, but...)

ipdb> print(psf.max() <= 0)
True
ipdb> print(psf.max() == 0)
False
ipdb> print(psf.max() < 0)
False
ipdb> psf.max()
<Slice 0.>

this is thoroughly impossible and implies that the comparison operators attached to Slice (and other LDO?) objects are broken somehow.