pyspeckit / pyspeckit

Python Spectroscopic Toolkit
MIT License
103 stars 83 forks source link

xarr comparison does not convert units #153

Open keflavich opened 8 years ago

keflavich commented 8 years ago

This is new behavior sometime in the last few weeks, which unfortunately implicates #150 even though there can't possibly be any link:

In [4]: spectra.xarr
Out[4]: SpectroscopicAxis([218136000000.0,...,234914500000.0], unit=Unit("Hz"), refX=None, refX_unit=None, frame=None, redshift=None, xtype=Unit("Hz"), velocity convention='radio')

In [5]: spectra.xarr > 219*u.GHz
Out[5]: SpectroscopicAxis([1.0,...,1.0], unit=Unit("Hz"), refX=None, refX_unit=None, frame=None, redshift=None, xtype=Unit("Hz"), velocity convention='radio')

Clearly, at least the 0'th element should be 0.0 (False).

vlas-sokolov commented 8 years ago

Could be older than #150. Getting same behavior for 0.1.19.dev2200, which should be from 14 days ago:

In [27]: spc.xarr
Out[27]: SpectroscopicAxis([99998198753.88593,...,100001501038.4284], unit=Unit("Hz"), refX=<Quantity 100.0 GHz>, refX_unit=Unit("GHz"), frame=None, redshift=None, xtype=None, velocity convention='radio')

In [28]: spc.xarr > 100*u.GHz
Out[28]: SpectroscopicAxis([1.0,...,1.0], unit=Unit("Hz"), refX=<Quantity 100.0 GHz>, refX_unit=Unit("GHz"), frame=None, redshift=None, xtype=None, velocity convention='radio')
keflavich commented 8 years ago

Thanks vlas, that helps. I think this is a good time for me to (1) write a test and (2) learn to use git bisect with a new test