Home | Trees | Indices | Help |
|
---|
|
Definition and conversion of units in STC
For every physical quantity we deal with, there is a standard unit defined:
We keep dictionaries of conversion factors to those units. Since turning things around, these factors give "how many bases are in the unit", e.g. km -> 1000.
The main interface are functions returning converter functions. Pass a value in fromUnit to them and receive a value in toUnit. Simple factors unfortunately don't cut it here since conversion from wavelength to frequency needs division of the value.
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
toRad = 0.0174532925199
|
|
oneAU = 1.49597870691e+11
|
|
onePc = 3.0856775813e+16
|
|
lightspeed = 299792458.0
|
|
planckConstant = 4.13566733e-15
|
|
julianYear = 31557600.0
|
|
distFactors =
|
|
angleFactors =
|
|
timeFactors =
|
|
freqFactors =
|
|
wlFactors =
|
|
distUnits =
|
|
angleUnits =
|
|
timeUnits =
|
|
spectralUnits =
|
|
systems =
|
|
maxDistance = 10000000.0
|
|
__package__ =
|
Function Details |
returns a function converting fromUnit values to toUnit values.
|
returns a function converting distances to/from parallaxes.
|
returns a function converting redshifts in spaceUnit/timeUnit to toSpace/toTime. This will actually work for any unit of the form unit1/unit2 as long as unit2 is purely multiplicative.
|
returns a function converting from fromUnits to toUnits. fromUnits is a tuple, toUnits is a tuple of which only the first item is interpreted. This first item must be a tuple or a single string; in the latter case, all components are supposed to be of that unit. ToUnits may be shorter than fromUnits. In this case, the additional fromUnits are ignored. This is mainly for cases in which geometries go with SPHER3 positions. The resulting functions accepts sequences of len(toUnits) and returns tuples of the same length. As a special service for Geometries, these spatial converters have additional attributes fromUnit and toUnit giving what transformation they implement.
|
returns a function converting from fromSpaceUnits/fromTimeUnits to toSpace/toTime. fromXUnits is a tuple, toX may either be a tuple of length fromXUnits or a a single string like in getVectorUnits. The resulting functions accepts sequences of proper length and returns tuples.
|
returns a pair of unit info and a conversion function to take fromCoo to the units of toCoo. toCoo may be None, in which case the unit of fromCoo is returned together with an identity function. If the units already match, (None, None) is returned. The unit info is a dictionary suitable for change().
|
iterates over all keys that need to be changed to adapt units in baseSTC's attName facet to conform to what sysSTC gives. If something in baseSTC is not specified in sysSTC, it is ignored here (i.e., it will remain unchanged if the result is used in a change). Since units are only on coordinates, and areas inherit these units, they are transformed as well, and their name is given by dependentName. See also conform.conformUnits. |
Variables Details |
distFactors
|
angleFactors
|
timeFactors
|
freqFactors
|
wlFactors
|
distUnits
|
spectralUnits
|
systems
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |