[SciPy-user] module with physical constants
Travis Oliphant
oliphant.travis at ieee.org
Wed May 31 00:15:52 EDT 2006
Robert Kern wrote:
> Travis Oliphant wrote:
>
>> weg werp wrote:
>>
>
>
>>> http://physics.nist.gov/cuu/Constants/
>>>
>>> combined with some other constans like conversion factors between
>>> imperial and SI, lightyears, arcminutes etc. If everything is defined
>>> in SI units, you could do tricks like
>>>
>>>
>> >from constants import *
>>
>>> speed = 23454 * parsec / week # in m/s
>>> print 'your are going',speed/Mach,'times the speed of sound.'
>>> p = 18 * torr # in Pascal
>>> print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per
>>> square inch'.
>>>
>> I like this style for doing unit conversions. I think keeping it
>> simple as a module of float constants is a great idea.
>>
>
> I would prefer that the underlying database of constants and units is that
> dictionary full of "ugly" names provided by Chuck so long ago. Among other
> things, it's programmatically accessible. A more convenient set of variable
> names can be glommed into a neighboring module that indexes into that dictionary.
>
> And yes, I want the full set of CODATA Recommended Values.
>
> I do have reservations about such a thing becoming *the* scipy module for doing
> unit conversions, though.
>
Let's check PhysicalConstants.py into the sandbox along with a "simpler"
constants module and start playing...
-Travis
More information about the SciPy-User
mailing list