LogQuantity#
- class astropy.units.function.logarithmic.LogQuantity(value, unit=None, dtype=<class 'numpy.inexact'>, copy=True, order=None, subok=False, ndmin=0)[源代码]#
-
一个数与一个单位的(标度)对数的表示。
- 参数:
- value : number ,
Quantity
,LogQuantity
,或 sequence 就像数量一样。NUMBER、QUANTITY、LogQuantity或PYTHON:类量序列。 对数量的数值。如果一个数字或一个
Quantity
使用对数单位,它将转换为unit
物理单位可以从unit
. 如果AQuantity
如果只有一个物理单位,它将转换成对数单位,然后,如果必要的话,将它转换为从unit
.- unit :
str
,UnitBase
,或FunctionUnitBase
,可选Python:字符串、UnitBase或FunctionUnitBase,可选 对于一个
FunctionUnitBase
实例,则将从中获取物理单元;对于其他输入,将从value
。默认情况下,unit
由子类设置。- D型 :
dtype
可选可选类型 这个
dtype
将保存该值的结果Numpy数组或标量的。如果未提供,则根据输入值自动确定。- copy : bool ,可选可选的布尔
如果
True
(default), then the value is copied. Otherwise, a copy will only be made if_ _如果值是嵌套序列,或者需要副本来满足显式给定的 ``dtype
. (在False
选项主要用于内部使用,以便在已知已生成副本的情况下加快初始化。小心使用。)
- value : number ,
实例
通常,使用
FunctionQuantity
子类,如::>>> import astropy.units as u >>> u.Magnitude(-2.5) <Magnitude -2.5 mag> >>> u.Magnitude(10.*u.count/u.second) <Magnitude -2.5 mag(ct / s)> >>> u.Decibel(1.*u.W, u.DecibelUnit(u.mW)) <Decibel 30. dB(mW)>
方法总结
diff
([n, axis])ediff1d
([to_end, to_begin])ptp
([axis, out, keepdims])沿给定轴的峰间(最大-最小)值。
std
([axis, dtype, out, ddof, keepdims, where])返回数组元素沿给定轴的标准偏差。
var
([axis, dtype, out, ddof, keepdims, where])返回数组元素沿给定轴的方差。
方法文件