Units functions#

rocketpy.units.conversion_factor(from_unit, to_unit)[source]#

Returns the conversion factor from one unit to another.

rocketpy.units.convert_units_Functions(variable, from_unit, to_unit, axis=1)[source]#

See units.convert_units() for documentation.

rocketpy.units.convert_temperature(variable, from_unit, to_unit)[source]#

See units.convert_units() for documentation.

rocketpy.units.convert_units(variable, from_unit, to_unit, axis=1)[source]#

Convert units of variable to preferred units.

  • variable (int, float, numpy.array, rocketpy.Function) – Variable to be converted. If Function, specify axis that should be converted.

  • from_unit (string) – Unit of incoming data.

  • to_unit (string) – Unit of returned data.

  • axis (int, optional) – Axis that should be converted. 0 for x axis, 1 for y axis. Only applies if variable is an instance of the Function class. Default is 1, for the y axis.


variable – Variable converted from “from_unit” to “to_unit”.

Return type:

int, float, numpy.array, rocketpy.Function