validate_quantity

synphot.units.validate_quantity(input_value, output_unit, equivalencies=[])[source]

Validate quantity (value and unit).

Note

For flux conversion, use convert_flux() instead.

Parameters:
input_valuenumber, array-like, or Quantity

Quantity to validate. If not a Quantity, assumed to be already in output unit.

output_unitstr or Unit

Output quantity unit.

equivalencieslist of equivalence pairs, optional

See astropy.units.

Returns:
output_valueQuantity

Validated quantity in given unit.