thermal_cam_converters.py

The thermal_cam_converters.py module consists of two temperature converters, one for Celsius to Fahrenheit and the other for Fahrenheit to Celsius. The value to be converted is passed as an argument to the appropriate helper.  Because the Thermal Camera's sensor has limited accuracy, a rounded integer value is returned.

# thermal_cam_converters.py

def celsius_to_fahrenheit(deg_c=None):  # convert C to F; round to 1 degree C
    return round(((9 / 5) * deg_c) + 32)

def fahrenheit_to_celsius(deg_f=None):  # convert F to C; round to 1 degree F
    return round((deg_f - 32) * (5 / 9))

This guide was first published on Jan 29, 2020. It was last updated on May 31, 2021.

This page (Details: Converter Helpers) was last updated on Jan 23, 2020.

Text editor powered by tinymce.