#
# stub class definition file for docstring parsing
#
[docs]class quanta:
"""
quanta tool handles units and quantities
"""
[docs] def quanta(self):
"""
Construct quanta tool
Create a quanta tool on the specified host (or by default the
host you are running on).
"""
pass
[docs] def convertfreq(self, v='1.0', outunit='Hz'):
"""
convert a frequency quantity to another unit
convertfreq converts a frequency quantity to another unit.
.. rubric:: Parameters
- ``v (variant='1.0')`` - quantity to convert
- ``outunit (string='Hz')`` - unit to convert to
"""
pass
[docs] def convertdop(self, v='0.0', outunit='km/s'):
"""
convert a doppler velocity quantity to another unit
convertfreq converts a velocity quantity to another unit. Units are either
velocity or dimensionless.
.. rubric:: Parameters
- ``v (variant='0.0')`` - quantity to convert
- ``outunit (string='km/s')`` - unit to convert to
"""
pass
[docs] def quantity(self, v='', unitname=''):
"""
make a quantity from a string or from a numeric value
and a unit string
quantity makes a quantity from a string, or from a value and a
string. Note that a function unit exists which is a synonym for
quantity. If only a string is given, it can be a scalar string.
The result will be a scalar quantity.
If a numeric value and a unit string
are given, the numeric value can be any numeric type, and can also be
a vector of numeric values. print qa.map() to get a list of recognized units.
'd' is usually days, but can be degrees (see example).
.. rubric:: Parameters
- ``v (variant='')`` - quantity or numeric or string to convert to quantity
- ``unitname (string='')`` - unit string if v numeric
"""
pass
[docs] def getvalue(self, v=''):
"""
get the internal value of a quantity
getvalue returns the internal value of a quantity. It also can handle an array
of quantities.
.. rubric:: Parameters
- ``v (variant='')`` - quantity
"""
pass
[docs] def getunit(self, v=''):
"""
get the internal unit of a quantity
getunit returns the internal unit string of a quantity
.. rubric:: Parameters
- ``v (variant='')`` - quantity
"""
pass
[docs] def canonical(self, v='1.0'):
"""
get canonical value of quantity
canonical (with alias canon) gets the canonical value of a quantity
.. rubric:: Parameters
- ``v (variant='1.0')`` - value to convert
"""
pass
[docs] def canon(self, v=''):
"""
get canonical value of quantity
canon gets the canonical value of a quantity
.. rubric:: Parameters
- ``v (variant='')`` - value to convert
"""
pass
[docs] def convert(self, v='', outunit=''):
"""
convert a quantity to another unit
convert converts a quantity to another unit. If no output unit given,
conversion is to canonical units
.. rubric:: Parameters
- ``v (variant='')`` - quantity to convert
- ``outunit (variant='')`` - unit to convert to
"""
pass
[docs] def define(self, name='', v='1'):
"""
define a new unit name
define defines the name and value of a user defined unit
.. rubric:: Parameters
- ``name (string='')`` - name of unit to define
- ``v (variant='1')`` - quantity value of new unit
"""
pass
[docs] def map(self, v='all'):
"""
list known unit names and constants
map lists the known mapping of units and constants. It has a single argument,
which can be a coded string (no-case, minimax match):
\begin{description}
\item[all] all of the following units (not constants): also the default
\item[Prefix] known decimal prefixes
\item[SI] known SI units
\item[Customary] a set of customary units known to programs
\item[User] units defined by the user
\item[Constants] known constants (note: only 'const', 'Const', 'constants'
and 'Constants' recognised).
\end{description}
.. rubric:: Parameters
- ``v (string='all')`` - type of information to list - coded string
"""
pass
[docs] def maprec(self, v='all'):
"""
create record containing list of known unit names and
constants
maprec returns a record with the known mapping of units and constants. It has a single argument,
which can be a coded string (no-case, minimax match):
\begin{description}
\item[all] all of the following units (not constants): also the default
\item[Prefix] known decimal prefixes
\item[SI] known SI units
\item[Customary] a set of customary units known to programs
\item[User] units defined by the user
\end{description}
.. rubric:: Parameters
- ``v (string='all')`` - type of information to list - coded string
"""
pass
[docs] def fits(self):
"""
define some FITS units
fits defines some unit names used in reading and writing FITS files.
"""
pass
[docs] def angle(self, v='', prec=0, form=[''], showform=False):
"""
show an angle as a formatted string
angle converts an angle quantity to a formatted string. The formatting
information is a precision (0 is default, 6 includes +-ddd.mm.ss) and a
string array of codes (no-case, minimax match):
Codes include:
\begin{description}
\item[clean] delete leading/trailing superfluous separators
\item[no\_d] do not show degrees part
\item[no\_dm] do not show degrees and minutes part
\item[dig2] show only 2 digits of degrees in angle format
\item[time] show as time (hh:mm:ss.ttt) rather than as angle
\end{description}
If a multi-dimensional value is given for the value $v$, the returned value
is a string vector of a length equal to last dimension. Each string has a
number of fields equal to the number of elements in all earlier
dimensions. If the {\em showform} is $T$, each vector element is surrounded
by a pair of square brackets if there is more than one entry, and fields are
separated by a ','.
.. rubric:: Parameters
- ``v (variant='')`` - angle quantity value to output
- ``prec (int=0)`` - number of digits shown
- ``form (stringArray=[''])`` - formatting information in coded string array
- ``showform (bool=False)`` - show square brackets and separating ,
"""
pass
[docs] def time(self, v='', prec=0, form=[''], showform=False):
"""
show a time (or date) as a formatted string
time converts a time quantity to a formatted string. The formatting
information is a precision (0 is default, 6 includes hh.mm.ss) and a
string array of codes (no-case, minimax match):
Codes include:
\begin{description}
\item[clean] delete leading/trailing superfluous separators
\item[no\_d] do not show hours part
\item[no\_dm] do not show hours and minutes part
\item[ymd] include a date as yyyy/mm/dd (date is by default not shown)
\item[dmy] include a date as ddMMMyyyy (date is by default not shown)
\item[mjd] include a date as Modified Julian Day (date is by default not shown)
\item[fits] include a date and show time in FITS format: le from OS
\item[angle] show in angle (dd.mm.ss.ttt) rather than time format
\item[day] prefix day-of-week to output
\item[local] show local time rather than UTC (add timezone offset)
\item[no\_time] suppress printing of time part
\end{description}
If a multi-dimensional value is given for the value $v$, the returned value
is a string vector of a length equal to last dimension. Each string has a
number of fields equal to the number of elements in all earlier
dimensions. If the {\em showform} is $T$, each vector element is surrounded
by a pair of square brackets if there is more than one entry, and fields are
separated by a ','.
.. rubric:: Parameters
- ``v (variant='')`` - time quantity value to output
- ``prec (int=0)`` - number of digits shown
- ``form (stringArray=[''])`` - formatting information in coded string array
- ``showform (bool=False)`` - show square brackets and separating ,
"""
pass
[docs] def add(self, v='', a='0'):
"""
add quantities
add adds two quantities
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def sub(self, v='', a='0'):
"""
subtract quantities
sub subtracts two quantities
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def mul(self, v='', a='1'):
"""
multiply quantities
mul multiplies two quantities
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='1')`` - value
"""
pass
[docs] def div(self, v='', a='1'):
"""
divides quantities
div divides two quantities
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='1')`` - value
"""
pass
[docs] def neg(self, v='1'):
"""
negate quantities
neg negates a quantity
.. rubric:: Parameters
- ``v (variant='1')`` - value
"""
pass
[docs] def norm(self, v='', a=-0.5):
"""
normalise angle
norm normalise angles in interval of $2\pi$ radians. The default interval is
from -0.5 to +0.5 of a full interval (i.e. from -180 to +180 degrees). The
lower end of the interval can be set as a fraction of $2\pi$
.. rubric:: Parameters
- ``v (variant='')`` - angle quantity
- ``a (double=-0.5)`` - lower interval boundary
"""
pass
[docs] def le(self, v='', a='0'):
"""
compare quantities
le compares two quantities for less than or equal.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def lt(self, v='', a='0'):
"""
compare quantities
lt compares two quantities for less than.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def eq(self, v='', a='0'):
"""
compare quantities
eq compares two quantities for equality.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def ne(self, v='', a='0'):
"""
compare quantities
ne compares two quantities for non equality.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def gt(self, v='', a='0'):
"""
compare quantities
gt compares two quantities for greater than.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def ge(self, v='', a='0'):
"""
compare quantities
ge compares two quantities for greater than or equal.
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='0')`` - value
"""
pass
[docs] def sin(self, v=''):
"""
sine of quantity
sin gives sine of angle quantity
.. rubric:: Parameters
- ``v (variant='')`` - angle quantity
"""
pass
[docs] def cos(self, v=''):
"""
cosine of quantity
cos gives cosine of angle quantity
.. rubric:: Parameters
- ``v (variant='')`` - angle quantity
"""
pass
[docs] def tan(self, v=''):
"""
tangent of quantity
tan gives tangent of angle quantity
.. rubric:: Parameters
- ``v (variant='')`` - angle quantity
"""
pass
[docs] def asin(self, v=''):
"""
arcsine of quantity
asin gives arcsine of non-dimensioned quantity
.. rubric:: Parameters
- ``v (variant='')`` - non-dimensioned quantity
"""
pass
[docs] def acos(self, v=''):
"""
arccosine of quantity
acos gives arccosine of non-dimensioned quantity
.. rubric:: Parameters
- ``v (variant='')`` - non-dimensioned quantity
"""
pass
[docs] def atan(self, v=''):
"""
arctangent of quantity
atan gives arctangent of non-dimensioned quantity
.. rubric:: Parameters
- ``v (variant='')`` - non-dimensioned quantity
"""
pass
[docs] def atan2(self, v='', a=''):
"""
arctangent of two quantity
atan gives arctangent of two non-dimensioned quantity
.. rubric:: Parameters
- ``v (variant='')`` - non-dimensioned quantity
- ``a (variant='')`` - non-dimensioned quantity
"""
pass
[docs] def abs(self, v=''):
"""
absolute value of quantity
abs gives absolute value of quantity
.. rubric:: Parameters
- ``v (variant='')`` - value
"""
pass
[docs] def ceil(self, v=''):
"""
ceil value of quantity
ceil gives ceiling value of quantity
.. rubric:: Parameters
- ``v (variant='')`` - value
"""
pass
[docs] def floor(self, v=''):
"""
floor value of quantity
floor gives flooring value of quantity
.. rubric:: Parameters
- ``v (variant='')`` - value
"""
pass
[docs] def log(self, v=''):
"""
logarithm of quantity
log gives natural logarithm of dimensionless quantity
.. rubric:: Parameters
- ``v (variant='')`` - dimensionless quantity
"""
pass
[docs] def log10(self, v=''):
"""
logarithm of quantity
log10 gives logarithm of dimensionless quantity
.. rubric:: Parameters
- ``v (variant='')`` - dimensionless quantity
"""
pass
[docs] def exp(self, v=''):
"""
exponential of quantity
exp gives exponential value of dimensionless quantity
.. rubric:: Parameters
- ``v (variant='')`` - dimensionless quantity
"""
pass
[docs] def sqrt(self, v=''):
"""
square root of quantity
sqrt gives square root of quantity with only even powered dimensions
.. rubric:: Parameters
- ``v (variant='')`` - dimensionless quantity
"""
pass
[docs] def compare(self, v='', a=''):
"""
compare dimensionality of units
compare compares the dimensionality of units of two qauntities
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (variant='')`` - value
"""
pass
[docs] def check(self, v=''):
"""
check for proper unit string
check checks if the argument has a properly defined unit string
.. rubric:: Parameters
- ``v (string='')`` - value
"""
pass
[docs] def checkfreq(self, cm=''):
"""
check for proper frequency unit
checkfreq checks if the argument has a properly defined frequency interpretable
unit string
.. rubric:: Parameters
- ``cm (variant='')`` - value
"""
pass
[docs] def pow(self, v='', a=1):
"""
raise quantity to power
pow raises a quantity to an integer power
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``a (int=1)`` - power
"""
pass
[docs] def constants(self, v='pi'):
"""
get a constant
constants gets a named constant quantity. Names (no-case, minimax) are:
pi 3.14.. 3.14159
ee 2.71.. 2.71828
c light vel. 2.99792e+08 m/s
G grav. const 6.67259e-11 N.m2/kg2
h Planck const 6.62608e-34 J.s
HI HI line 1420.41 MHz
R gas const 8.31451 J/K/mol
NA Avogadro number 6.02214e+23 mol-1
e electron charge 1.60218e-19 C
mp proton mass 1.67262e-27 kg
mp\_me mp/me 1836.15
mu0 permeability vac. 1.25664e-06 H/m
eps0 permittivity vac. 1.60218e-19 C
k Boltzmann const 1.38066e-23 J/K
F Faraday const 96485.3 C/mol
me electron mass 9.10939e-31 kg
re electron radius 2.8179e-15 m
a0 Bohr's radius 5.2918e-11 m
R0 solar radius 6.9599e+08 m
k2 IAU grav. const\^2 0.000295912 AU3/d2/S0
.. rubric:: Parameters
- ``v (string='pi')`` - name
"""
pass
[docs] def isangle(self, v=''):
"""
check if valid angle or time quantity
isangle checks if the argument is a valid angle/time quantity.
.. rubric:: Parameters
- ``v (variant='')`` - angle/time quantity
"""
pass
[docs] def totime(self, v=''):
"""
convert an angle (or a time) to a time
totime converts an angle quantity (or a time) to a time quantity
.. rubric:: Parameters
- ``v (variant='')`` - angle/time quantity
"""
pass
[docs] def toangle(self, v=''):
"""
convert a time (or an angle) to an angle
toangle converts a time quantity (or an angle) to an angle quantity
.. rubric:: Parameters
- ``v (variant='')`` - angle/time quantity
"""
pass
[docs] def splitdate(self, v=''):
"""
split a date/time into a record
splitdate splits a date/time quantity into a record with constituent fields
like year, yearday, month etc. All fields will be integer (to enable use as
index and easy personal formatting), with the exception of the {\em s} field
which is a double float. See the example for the fields returned.
.. rubric:: Parameters
- ``v (variant='')`` - angle/time quantity
"""
pass
[docs] def tos(self, v='', prec=9):
"""
convert quantity to string
tos converts a quantity to a string with the precision defined with
the {\em setformat('prec')} (which defaults to 9). If the optional
{\em prec} argument is set to an integer value greater than 1, that
precision is used in the conversion
.. rubric:: Parameters
- ``v (variant='')`` - value
- ``prec (int=9)`` - convert precision of value
"""
pass
[docs] def type(self):
"""
type of tool
type will return the tool name.
"""
pass
[docs] def done(self, kill=False):
"""
Free resources used by tool. Current implementation
ignores input parameter, does nothing and returns true
Currently, this method is an NOP.
.. rubric:: Parameters
- ``kill (bool=False)`` - force kill of the default tool (ignored)
"""
pass
[docs] def unit(self, v='', unitname=''):
"""
quantity from value v and unit string
unit makes a quantity from a string, or from a value and a string.
Note that unit is a synonym for quantity (see example there).
.. rubric:: Parameters
- ``v (variant='')``
- ``unitname (string='')``
"""
pass
[docs] def isquantity(self, v=''):
"""
Check if quantity
Checks if the operand is a correct quantity
.. rubric:: Parameters
- ``v (variant='')`` - value to be tested
"""
pass