summaryrefslogtreecommitdiff
path: root/python/atms-310/homework
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
commit7b21727285e50b0b050c4ddd70d07542229c5366 (patch)
tree5d369153c5df5b41f3750d25479a68f20169c8ff /python/atms-310/homework
init
Diffstat (limited to 'python/atms-310/homework')
-rwxr-xr-xpython/atms-310/homework/homework1.py22
-rwxr-xr-xpython/atms-310/homework/homework1.txt33
-rwxr-xr-xpython/atms-310/homework/homework2.py13
-rwxr-xr-xpython/atms-310/homework/hw3/color.txt344
-rwxr-xr-xpython/atms-310/homework/hw3/homework3.py54
-rwxr-xr-xpython/atms-310/homework/hw3/hw3.py17
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_01srh1.txt9
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_01srh2.txt10
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_06shr1.txt9
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_06shr2.txt10
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_mlcape1.txt9
-rwxr-xr-xpython/atms-310/homework/hw3/hw3_mlcape2.txt10
12 files changed, 540 insertions, 0 deletions
diff --git a/python/atms-310/homework/homework1.py b/python/atms-310/homework/homework1.py
new file mode 100755
index 0000000..82d7d9e
--- /dev/null
+++ b/python/atms-310/homework/homework1.py
@@ -0,0 +1,22 @@
+a = 3.0 <= 3.1
+b = 22 + 11.0
+c = 11 + int(13)
+d = 4 != 4
+e = (3 <= 5) or (5<=4)
+f = (3 <= 5) and (5 <= 4)
+
+print(a)
+print(b)
+print(c)
+print(d)
+print(e)
+print(f)
+
+c = {'building number': '7725',
+ 'street name': '188th Ave NE',
+ 'city': 'Redmond',
+ 'state': 'Washington',
+ 'zip code' : 98052}
+
+print('redmond costco is located at:')
+print(c['building number'], c['street name'], c['city'],',', c['state'],',', c['zip code']) \ No newline at end of file
diff --git a/python/atms-310/homework/homework1.txt b/python/atms-310/homework/homework1.txt
new file mode 100755
index 0000000..a59656d
--- /dev/null
+++ b/python/atms-310/homework/homework1.txt
@@ -0,0 +1,33 @@
+1. input:
+ keyboard, mouse, other HID's, cameras, joysticks, game controllers
+output:
+ any kind of display, headphones, speakers, vibration motors, a teletype terminal
+
+2. outputs of operations as stated:
+ True
+ 33.0
+ 24
+ False
+ True
+ False
+operations of opposite result for a,d,e,f:
+ 3.0 == 3.1
+ 4 == 4
+ (6 <= 5) or (5 <= 4)
+ (3 <= 5) and (3 <= 4)
+
+3. address dict
+
+redmond costco (no i dont live in redmond)
+c = {'building number': '7725',
+ 'street name': '188th Ave NE',
+ 'city': 'Redmond',
+ 'state': 'Washington',
+ 'zip code' : 98052}
+
+print('redmond costco is located at:')
+print(c['building number'], c['street name'], c['city'],',', c['state'],',', c['zip code'])
+
+# the above code outputs this:
+ redmond costco is located at:
+ 7725 188th Ave NE Redmond , Washington , 98052
diff --git a/python/atms-310/homework/homework2.py b/python/atms-310/homework/homework2.py
new file mode 100755
index 0000000..5590979
--- /dev/null
+++ b/python/atms-310/homework/homework2.py
@@ -0,0 +1,13 @@
+import numpy
+rainfall = [0.0, 0.1, 0.6, 0.7, 0.4, 0.3]
+
+for n in range(len(rainfall)):
+ x = rainfall[n]*25.4
+ if x < 0:
+ raise ValueError(
+ 'make sure no one is drinking out of the rainfall meter')
+ elif x >= 10:
+ print(x)
+
+z = numpy.max(rainfall)
+print(z*25.4)
diff --git a/python/atms-310/homework/hw3/color.txt b/python/atms-310/homework/hw3/color.txt
new file mode 100755
index 0000000..282966c
--- /dev/null
+++ b/python/atms-310/homework/hw3/color.txt
@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Ansi 0 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Ansi 1 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.66666668653488159</real>
+ </dict>
+ <key>Ansi 10 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.3333333432674408</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>0.3333333432674408</real>
+ </dict>
+ <key>Ansi 11 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.3333333432674408</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>1</real>
+ </dict>
+ <key>Ansi 12 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>0.3333333432674408</real>
+ </dict>
+ <key>Ansi 13 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>1</real>
+ </dict>
+ <key>Ansi 14 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>0.3333333432674408</real>
+ </dict>
+ <key>Ansi 15 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>0.99999600648880005</real>
+ </dict>
+ <key>Ansi 2 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.66666668653488159</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Ansi 3 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>0.66666668653488159</real>
+ </dict>
+ <key>Ansi 4 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.66666668653488159</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Ansi 5 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.66666668653488159</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.66666668653488159</real>
+ </dict>
+ <key>Ansi 6 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.66666668653488159</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.66666668653488159</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Ansi 7 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.66666668653488159</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.66666668653488159</real>
+ <key>Red Component</key>
+ <real>0.66666668653488159</real>
+ </dict>
+ <key>Ansi 8 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.3333333432674408</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>0.3333333432674408</real>
+ </dict>
+ <key>Ansi 9 Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.3333333432674408</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>1</real>
+ </dict>
+ <key>Background Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Badge Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>0.5</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.1491314172744751</real>
+ <key>Red Component</key>
+ <real>1</real>
+ </dict>
+ <key>Bold Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>0.99999600648880005</real>
+ </dict>
+ <key>Cursor Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.72337132692337036</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.72338062524795532</real>
+ <key>Red Component</key>
+ <real>0.72336345911026001</real>
+ </dict>
+ <key>Cursor Guide Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>0.25</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.9268307089805603</real>
+ <key>Red Component</key>
+ <real>0.70213186740875244</real>
+ </dict>
+ <key>Cursor Text Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>1</real>
+ <key>Red Component</key>
+ <real>0.99999600648880005</real>
+ </dict>
+ <key>Foreground Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.66666668653488159</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.66666668653488159</real>
+ <key>Red Component</key>
+ <real>0.66666668653488159</real>
+ </dict>
+ <key>Link Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.3333333432674408</real>
+ <key>Red Component</key>
+ <real>0.3333333432674408</real>
+ </dict>
+ <key>Selected Text Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>0.0</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.0</real>
+ <key>Red Component</key>
+ <real>0.0</real>
+ </dict>
+ <key>Selection Color</key>
+ <dict>
+ <key>Alpha Component</key>
+ <real>1</real>
+ <key>Blue Component</key>
+ <real>1</real>
+ <key>Color Space</key>
+ <string>sRGB</string>
+ <key>Green Component</key>
+ <real>0.86970102787017822</real>
+ <key>Red Component</key>
+ <real>0.75813239812850952</real>
+ </dict>
+</dict>
+</plist>
diff --git a/python/atms-310/homework/hw3/homework3.py b/python/atms-310/homework/hw3/homework3.py
new file mode 100755
index 0000000..8f5f615
--- /dev/null
+++ b/python/atms-310/homework/hw3/homework3.py
@@ -0,0 +1,54 @@
+import numpy as np
+import scipy.stats as s
+import glob as glob # glob
+import pandas as pd
+
+filelist = glob.glob("hw3_*.txt")
+filelist.sort()
+
+def read(file):
+ fileobj = open(file, "r")
+ outputstr = fileobj.readlines()
+ fileobj.close()
+ outputarray = np.zeros(len(outputstr))
+ for i in np.arange(len(outputstr)):
+ outputarray[i] = float(outputstr[i])
+ return outputarray
+
+parameters = ["mean", "median", "std", "iqr", "skew", "kurtosis"]
+
+for i in range(len(filelist)):
+ print(filelist[i])
+ data = np.array(read(filelist[i]))
+ for n in range (len(parameters)):
+ operation = parameters[n]
+ print(str(operation) + " " + np.operation(data))
+
+
+#for n in range(len(filelist)):
+# print(filelist[n])
+# mean = np.mean(read(filelist[n]))
+# print("mean: " + str(mean))
+# median = np.median(read(filelist[n]))
+# print("median: " + str(median))
+# stddev = np.std(read(filelist[n]))
+# print("stddev: " + str(stddev))
+# iqr = s.iqr(read(filelist[n]))
+# print("iqr: " + str(iqr))
+# skew = s.skew(read(filelist[n]))
+# print("skew: " + str(skew))
+# kurtosis = s.kurtosis(read(filelist[n]))
+# print("kurtosis: " + str(kurtosis)+"\n")
+
+# the mean and median are similar for all files, indicating solid, outlier free data.
+# standard deviation is quite high for everything except wind shear, indicating either \
+# inconsistent readings for everything but wind shear, or more likely, smaller units and \
+# higher rates of change.
+# the difference between shr1's iqr and stddev is larger than that of shr2's (shr2's is \
+# quite close to its stddev), possibility of one minor outlier
+# none of the data is very skewed, the largest (absolute value) being 0.54896, and \
+# all of the data has negative kurtosis, meaning when distibuted, it will have a shallower \
+# peak than the bell curve (e^x^2)
+# the february and may datasets are similar in that their wind shears are similar, though \
+# mays is still larger. they are different in that mays SRH and CAPE are both much higher, \
+# so mays tornadoes are much stronger.
diff --git a/python/atms-310/homework/hw3/hw3.py b/python/atms-310/homework/hw3/hw3.py
new file mode 100755
index 0000000..981bb05
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3.py
@@ -0,0 +1,17 @@
+import numpy as np
+import scipy.stats as s
+import glob as glob
+
+calc = {"mean":np.std, "median":np.median, "std":np.std, "iqr":s.iqr,\
+ "skew":s.skew, "kurtosis":s.kurtosis}
+
+print(calc["kurtosis"])
+def read(file):
+ fileobj = open(file, "r")
+ outputstr = fileobj.readlines()
+ fileobj.close()
+ outputarray = np.zeros(len(outputstr))
+ for i in np.arange(len(outputstr)):
+ outputarray[i] = float(outputstr[i])
+ return outputarray
+
diff --git a/python/atms-310/homework/hw3/hw3_01srh1.txt b/python/atms-310/homework/hw3/hw3_01srh1.txt
new file mode 100755
index 0000000..aba7c93
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_01srh1.txt
@@ -0,0 +1,9 @@
+2.5
+140.01
+127.19
+116.8
+211.31
+115.35
+220.38
+250.54
+248.61 \ No newline at end of file
diff --git a/python/atms-310/homework/hw3/hw3_01srh2.txt b/python/atms-310/homework/hw3/hw3_01srh2.txt
new file mode 100755
index 0000000..167d2b9
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_01srh2.txt
@@ -0,0 +1,10 @@
+383.79
+364.37
+364.37
+517.94
+517.94
+630.18
+240.08
+203.42
+184.33
+211.19 \ No newline at end of file
diff --git a/python/atms-310/homework/hw3/hw3_06shr1.txt b/python/atms-310/homework/hw3/hw3_06shr1.txt
new file mode 100755
index 0000000..557c5f6
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_06shr1.txt
@@ -0,0 +1,9 @@
+67.4134
+63.5197
+61.7
+55.6912
+56.6491
+48.4201
+46.6137
+41.388
+43.7989 \ No newline at end of file
diff --git a/python/atms-310/homework/hw3/hw3_06shr2.txt b/python/atms-310/homework/hw3/hw3_06shr2.txt
new file mode 100755
index 0000000..6c2578d
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_06shr2.txt
@@ -0,0 +1,10 @@
+62.3392
+60.4778
+60.4778
+68.9632
+68.9632
+72.1033
+63.5346
+63.4428
+63.272
+52.7143 \ No newline at end of file
diff --git a/python/atms-310/homework/hw3/hw3_mlcape1.txt b/python/atms-310/homework/hw3/hw3_mlcape1.txt
new file mode 100755
index 0000000..dee447b
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_mlcape1.txt
@@ -0,0 +1,9 @@
+205.47
+656.44
+691.44
+446.69
+448.34
+1069.41
+808.91
+983
+307.58 \ No newline at end of file
diff --git a/python/atms-310/homework/hw3/hw3_mlcape2.txt b/python/atms-310/homework/hw3/hw3_mlcape2.txt
new file mode 100755
index 0000000..97e3042
--- /dev/null
+++ b/python/atms-310/homework/hw3/hw3_mlcape2.txt
@@ -0,0 +1,10 @@
+3167.88
+2844.88
+2844.88
+2146.88
+2146.88
+1820.75
+741.62
+1042.75
+810.12
+1314.88 \ No newline at end of file