Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 17, 2023
1 parent b1a6fd5 commit 8b60710
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions socs/agents/vantagepro2/drivers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import array as arr
import struct
import time
import numpy as np

import numpy as np
from serial import Serial

# some commands require a CRC code (cyclic redundancy check) -
Expand Down Expand Up @@ -52,11 +52,13 @@ def calc_crc(data):
crc = crc % 65536
return crc


def F_to_C(temp):
"""Function to convert fahrenheit measurement to celsius"""

return (temp - 32) * (5 / 9)


def wind_chill(temp, wind):
"""Function to calculate wind chill temperature. Only valid if temp < 50F.
Taken from https://www.calculator.net/wind-chill-calculator.html
Expand All @@ -66,9 +68,10 @@ def wind_chill(temp, wind):
wind: Speed in miles per hour
"""

chill = 35.75 + 0.6215*temp - 35.75*np.power(wind,0.16) + 0.4275*temp*np.power(wind,0.16)
chill = 35.75 + 0.6215 * temp - 35.75 * np.power(wind, 0.16) + 0.4275 * temp * np.power(wind, 0.16)
return chill


class VantagePro2:
"""Allows communication to Vantage Pro 2 Weather Monitor Module.
Contains commands to be issued and member variables that store
Expand Down

0 comments on commit 8b60710

Please sign in to comment.