yt.frontends.fits.data_structures.FITSDataset.get_smallest_appropriate_unit — The yt Project 3.2-dev documentation

# yt.frontends.fits.data_structures.FITSDataset.get_smallest_appropriate_unit

`FITSDataset.` `get_smallest_appropriate_unit`(v, quantity='distance', return_quantity=False)

  Returns the largest whole unit smaller than the YTQuantity passed to it as a string.

  The quantity keyword can be equal to distance or time. In the case of distance, the units are: ‘Mpc’, ‘kpc’, ‘pc’, ‘au’, ‘rsun’, ‘km’, etc. For time, the units are: ‘Myr’, ‘kyr’, ‘yr’, ‘day’, ‘hr’, ‘s’, ‘ms’, etc.

  If return_quantity is set to True, it finds the largest YTQuantity object with a whole unit and a power of ten as the coefficient, and it returns this YTQuantity.