aboutsummaryrefslogtreecommitdiff
path: root/skewt.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-31 18:11:45 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-31 18:11:45 +0200
commit002d189b2d16a32f9d8b9b0858c3e21417b77170 (patch)
tree633739dbe67e6455b42bcf4029ce4c48181b8706 /skewt.py
parent6882197f35fe5310c7f78f54435c989c85a4d898 (diff)
downloadmeteo_toolbox-002d189b2d16a32f9d8b9b0858c3e21417b77170.tar.gz
fix skewt double p values
Diffstat (limited to 'skewt.py')
-rwxr-xr-xskewt.py9
1 files changed, 6 insertions, 3 deletions
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]))