astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Units and Quantities (`astropy.units`) »
- DexUnit

# DexUnit

class astropy.units.function.logarithmic.DexUnit(physical_unit=None, function_unit=None)

  Bases: `LogUnit`

  Logarithmic physical units expressed in magnitudes

  Parameters:
    physical_unit `Unit` or `string`

      Unit that is encapsulated within the magnitude function unit. If not given, dimensionless.

    function_unit `Unit` or `string`

      By default, this is `dex`, but this allows one to use an equivalent unit such as `0.5 dex`.

  Methods Summary

  `to_string`([format]) | Output the unit in the given format as a string.

  Methods Documentation

  to_string(format='generic')

    Output the unit in the given format as a string.

    The physical unit is appended, within parentheses, to the function unit, as in “dB(mW)”, with both units set using the given format

    Parameters:
      format `astropy.units.format.Base` instance or `python:str`

        The name of a format or a formatter object. If not provided, defaults to the generic format.