unit_handler#

class arte.dataelab.unit_handler.UnitHandler(wanted_unit)#

Bases: object

Methods

actual_unit()

Data unit as an astropy unit, or None

actual_unit_name()

Data unit string, or None if not set

apply_unit(data)

Appy to data our wanted unit, if any, converting if necessary

set_force(force_flag)

Set unit coercion flag

actual_unit()#

Data unit as an astropy unit, or None

actual_unit_name()#

Data unit string, or None if not set

apply_unit(data)#

Appy to data our wanted unit, if any, converting if necessary

If the force flag is not set, unit will be converted, throwing an exception is conversion if impossible. If the force flag is set, the old unit is stripped and the new one set.

If no wanted unit has been set, data is unchanged, including its unit, if any.

set_force(force_flag)#

Set unit coercion flag