From 44849f5b66f8d1eb5ce487e83e3891a5ec23fdb9 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 29 Dec 2023 17:33:10 +0200 Subject: [PATCH] correct rust temperature code --- test_rust.py | 1 + thermaldecoder/src/lib.rs | 1 + 2 files changed, 2 insertions(+) mode change 100644 => 100755 test_rust.py diff --git a/test_rust.py b/test_rust.py old mode 100644 new mode 100755 index 34f4839..6e56382 --- a/test_rust.py +++ b/test_rust.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 from pathlib import Path from thermaldecoder import decode import numpy as np diff --git a/thermaldecoder/src/lib.rs b/thermaldecoder/src/lib.rs index 14a1ce9..de0a407 100644 --- a/thermaldecoder/src/lib.rs +++ b/thermaldecoder/src/lib.rs @@ -169,6 +169,7 @@ fn decode_raw(filename: &str, frames_root: &str) -> anyhow::Result> .copied() .map(|x| { let x: f64 = x.into(); + let x = x / 256.0; ((-1.665884e-08) * x.powf(4.) + (1.347094e-05) * x.powf(3.) + (-4.396264e-03) * x.powf(2.)