[AstroPy] why the warning about Converting Quantity?

Jonathan Slavin jslavin@cfa.harvard....
Thu Mar 21 13:20:37 CDT 2013


Hi,

I have just used the constants module in astropy for the first time and
got 6 warnings from my code as a result:

import astropy.constants as const
AU = const.au.to('km')

leads to 
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]
WARNING: Converting Quantity object in units 'km' to a Numpy array
[astropy.units.quantity]

It seems that I get the warning every place I use the value of AU.  Do I
have to turn off warnings  to prevent this?  Is there some other way to
deal with this?

Jon
-- 
______________________________________________________________
Jonathan D. Slavin              Harvard-Smithsonian CfA
jslavin@cfa.harvard.edu         60 Garden Street, MS 83
phone: (617) 496-7981           Cambridge, MA 02138-1516
 cell: (781) 363-0035           USA
______________________________________________________________



More information about the AstroPy mailing list