LogQuantity

class astropy.units.function.LogQuantity(value, unit=None, dtype=None, copy=True, order=None, subok=False, ndmin=0)[源代码]

基类:FunctionQuantity

用单位表示一个数的(标度的)对数

参数
价值 :编号, QuantityLogQuantity ,或类似数量的序列。数,

对数量的数值。如果一个数字或一个 Quantity 使用对数单位,它将转换为 unit 物理单位可以从 unit . 如果A Quantity 如果只有一个物理单位,它将转换成对数单位,然后,如果必要的话,将它转换为从 unit .

unit STR, UnitBaseFunctionUnitBase 可选结构,

对于一个 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])

返回数组元素沿给定轴的方差。

方法文件

diff(n=1, axis=-1)[源代码]
ediff1d(to_end=None, to_begin=None)[源代码]
ptp(axis=None, out=None, keepdims=False)[源代码]

沿给定轴的峰间(最大-最小)值。

参照 numpy.ptp 完整文件。

参见

numpy.ptp

等效函数

std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)[源代码]

返回数组元素沿给定轴的标准偏差。

参照 numpy.std 完整文件。

参见

numpy.std

等效函数

var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)[源代码]

返回数组元素沿给定轴的方差。

参照 numpy.var 完整文件。

参见

numpy.var

等效函数