org.das2.datum.UnitsConverter

Units Converter object performs scale/offset conversions, but can also be used any double-to-double conversion, and contains an implementation to chain multiple conversions together.


IDENTITY

No conversion, where convert trivially returns the value.


LOOSE_IDENTITY

Allow conversion, but this is a flag that indicates the result should be dimensionless because the Ratiometric units were not convertible.


TERA


GIGA


MEGA


KILO


MILLI


CENTI


MICRO


NANO


PICO


append

append( org.das2.datum.UnitsConverter that ) → org.das2.datum.UnitsConverter

Parameters

that - an UnitsConverter

Returns:

org.das2.datum.UnitsConverter

[search for examples] [view on GitHub] [view on old javadoc] [view source]


convert

convert( double value ) → double

convert the value in the source units to the target units.

Parameters

value - value in source units.

Returns:

value in target units.

[search for examples] [view on GitHub] [view on old javadoc] [view source]

convert( Number number ) → Number

getConverter

getConverter( Units fromUnits, Units toUnits ) → org.das2.datum.UnitsConverter

lookup the UnitsConverter object that takes numbers from fromUnits to toUnits. This will chain together UnitsConverters registered via units.registerConverter.

Parameters

fromUnits - an Units
toUnits - an Units

Returns:

UnitsConverter object

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getInverse

getInverse( ) → org.das2.datum.UnitsConverter

Returns:

org.das2.datum.UnitsConverter

[search for examples] [view on GitHub] [view on old javadoc] [view source]