From 002d189b2d16a32f9d8b9b0858c3e21417b77170 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 31 Jul 2023 18:11:45 +0200 Subject: fix skewt double p values --- skewt.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'skewt.py') diff --git a/skewt.py b/skewt.py index 52aeed6..9646fed 100755 --- a/skewt.py +++ b/skewt.py @@ -23,9 +23,9 @@ TIME='23:00:00' URL=f'http://weather.uwyo.edu/cgi-bin/bufrraob.py?datetime={DATE}%20{TIME}&id={STATION}&type=TEXT:CSV' print(URL) -#result = requests.get(URL) -#RAW_DATA_LINES=result.content.decode('UTF-8').splitlines() -RAW_DATA_LINES= open('data.csv').readlines() +result = requests.get(URL) +RAW_DATA_LINES=result.content.decode('UTF-8').splitlines() +#RAW_DATA_LINES= open('data.csv').readlines() p = [] T = [] @@ -40,6 +40,9 @@ for row in csvreader: # skip any line with empty values continue + if float(row[3]) in p: # Skip double p entries + continue + p.append(float(row[3])) T.append(float(row[5])) Td.append(float(row[6])) -- cgit v1.2.3