LogQuantity¶
- class astropy.units.function.LogQuantity(value, unit=None, dtype=None, copy=True, order=None, subok=False, ndmin=0)[源代码]¶
-
用单位表示一个数的(标度的)对数
- 参数
- 价值 :编号,
Quantity
,LogQuantity
,或类似数量的序列。数, 对数量的数值。如果一个数字或一个
Quantity
使用对数单位,它将转换为unit
物理单位可以从unit
. 如果AQuantity
如果只有一个物理单位,它将转换成对数单位,然后,如果必要的话,将它转换为从unit
.- unit STR,
UnitBase
或FunctionUnitBase
可选结构, 对于一个
FunctionUnitBase
实例中,将从中获取物理单元;对于其他输入,将从value
. 默认情况下,unit
由子类设置。- D型 :
dtype
可选可选类型 这个
dtype
将保存该值的结果Numpy数组或标量的。如果未提供,则根据输入值自动确定。- copy可选的布尔
如果
True
(default), then the value is copied. Otherwise, a copy will only be made if_ _如果值是嵌套序列,或者需要副本来满足显式给定的 ``dtype
. (在False
选项主要用于内部使用,以便在已知已生成副本的情况下加快初始化。小心使用。)
- 价值 :编号,
实例
通常,使用
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])返回数组元素沿给定轴的方差。
方法文件