astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- Units and Quantities (`astropy.units`) »
- LogQuantity

# LogQuantity

class `astropy.units.function.``LogQuantity`

  Bases: `astropy.units.function.FunctionQuantity`

  A representation of a (scaled) logarithm of a number with a unit

  Parameters:

  value : number, `Quantity`, `LogQuantity`, or sequence of convertible items.

  > The numerical value of the logarithmic quantity. If a number or a `Quantity` with a logarithmic unit, it will be converted to `unit` and the physical unit will be inferred from `unit`. If a `Quantity` with just a physical unit, it will converted to the logarithmic unit, after, if necessary, converting it to the physical unit inferred from `unit`.

  unit : string, `UnitBase` or `FunctionUnitBase` instance, optional

  > For an `FunctionUnitBase` instance, the physical unit will be taken from it; for other input, it will be inferred from `value`. By default, `unit` is set by the subclass.

  dtype : `dtype`, optional

  > The `dtype` of the resulting Numpy array or scalar that will hold the value. If not provided, is is determined automatically from the input value.

  copy : bool, optional

  > If `True` (default), then the value is copied. Otherwise, a copy will only be made if `__array__` returns a copy, if value is a nested sequence, or if a copy is needed to satisfy an explicitly given `dtype`. (The `False` option is intended mostly for internal use, to speed up initialization where a copy is known to have been made. Use with care.)

  Examples

  Typically, use is made of an `FunctionQuantity` subclasses, as in:

      >>> import astropy.units as u
      >>> u.Magnitude(15.)
      <Magnitude 15.0 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.0 dB(mW)>

  Methods Summary

  `diff`([n, axis]) |
  `ediff1d`([to_end, to_begin]) |
  `ptp`([axis, out]) | Peak to peak (maximum - minimum) value along a given axis.
  `std`([axis, dtype, out, ddof, keepdims]) | Returns the standard deviation of the array elements along given axis.
  `var`([axis, dtype, out, ddof, keepdims]) | Returns the variance of the array elements, along given axis.

  Methods Documentation

  `diff`(n=1, axis=-1)
  `ediff1d`(to_end=None, to_begin=None)
  `ptp`(axis=None, out=None)

    Peak to peak (maximum - minimum) value along a given axis.

    Refer to `numpy.ptp` for full documentation.

    See also

    `numpy.ptp`
      equivalent function
  `std`(axis=None, dtype=None, out=None, ddof=0, keepdims=False)

    Returns the standard deviation of the array elements along given axis.

    Refer to `numpy.std` for full documentation.

    See also

    `numpy.std`
      equivalent function
  `var`(axis=None, dtype=None, out=None, ddof=0, keepdims=False)

    Returns the variance of the array elements, along given axis.

    Refer to `numpy.var` for full documentation.

    See also

    `numpy.var`
      equivalent function