From 7b21727285e50b0b050c4ddd70d07542229c5366 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:03 -0700 Subject: init --- python/atms-310/homework/homework1.py | 22 ++ python/atms-310/homework/homework1.txt | 33 +++ python/atms-310/homework/homework2.py | 13 + python/atms-310/homework/hw3/color.txt | 344 +++++++++++++++++++++++++++ python/atms-310/homework/hw3/homework3.py | 54 +++++ python/atms-310/homework/hw3/hw3.py | 17 ++ python/atms-310/homework/hw3/hw3_01srh1.txt | 9 + python/atms-310/homework/hw3/hw3_01srh2.txt | 10 + python/atms-310/homework/hw3/hw3_06shr1.txt | 9 + python/atms-310/homework/hw3/hw3_06shr2.txt | 10 + python/atms-310/homework/hw3/hw3_mlcape1.txt | 9 + python/atms-310/homework/hw3/hw3_mlcape2.txt | 10 + 12 files changed, 540 insertions(+) create mode 100755 python/atms-310/homework/homework1.py create mode 100755 python/atms-310/homework/homework1.txt create mode 100755 python/atms-310/homework/homework2.py create mode 100755 python/atms-310/homework/hw3/color.txt create mode 100755 python/atms-310/homework/hw3/homework3.py create mode 100755 python/atms-310/homework/hw3/hw3.py create mode 100755 python/atms-310/homework/hw3/hw3_01srh1.txt create mode 100755 python/atms-310/homework/hw3/hw3_01srh2.txt create mode 100755 python/atms-310/homework/hw3/hw3_06shr1.txt create mode 100755 python/atms-310/homework/hw3/hw3_06shr2.txt create mode 100755 python/atms-310/homework/hw3/hw3_mlcape1.txt create mode 100755 python/atms-310/homework/hw3/hw3_mlcape2.txt (limited to 'python/atms-310/homework') 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 @@ + + + + + Ansi 0 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Ansi 1 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.66666668653488159 + + Ansi 10 Color + + Alpha Component + 1 + Blue Component + 0.3333333432674408 + Color Space + sRGB + Green Component + 1 + Red Component + 0.3333333432674408 + + Ansi 11 Color + + Alpha Component + 1 + Blue Component + 0.3333333432674408 + Color Space + sRGB + Green Component + 1 + Red Component + 1 + + Ansi 12 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 0.3333333432674408 + + Ansi 13 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 1 + + Ansi 14 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 0.3333333432674408 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 0.99999600648880005 + + Ansi 2 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.66666668653488159 + Red Component + 0.0 + + Ansi 3 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 0.66666668653488159 + + Ansi 4 Color + + Alpha Component + 1 + Blue Component + 0.66666668653488159 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Ansi 5 Color + + Alpha Component + 1 + Blue Component + 0.66666668653488159 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.66666668653488159 + + Ansi 6 Color + + Alpha Component + 1 + Blue Component + 0.66666668653488159 + Color Space + sRGB + Green Component + 0.66666668653488159 + Red Component + 0.0 + + Ansi 7 Color + + Alpha Component + 1 + Blue Component + 0.66666668653488159 + Color Space + sRGB + Green Component + 0.66666668653488159 + Red Component + 0.66666668653488159 + + Ansi 8 Color + + Alpha Component + 1 + Blue Component + 0.3333333432674408 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 0.3333333432674408 + + Ansi 9 Color + + Alpha Component + 1 + Blue Component + 0.3333333432674408 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 1 + + Background Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.1491314172744751 + Red Component + 1 + + Bold Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 0.99999600648880005 + + Cursor Color + + Alpha Component + 1 + Blue Component + 0.72337132692337036 + Color Space + sRGB + Green Component + 0.72338062524795532 + Red Component + 0.72336345911026001 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.9268307089805603 + Red Component + 0.70213186740875244 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 0.99999600648880005 + + Foreground Color + + Alpha Component + 1 + Blue Component + 0.66666668653488159 + Color Space + sRGB + Green Component + 0.66666668653488159 + Red Component + 0.66666668653488159 + + Link Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.3333333432674408 + Red Component + 0.3333333432674408 + + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Selection Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.86970102787017822 + Red Component + 0.75813239812850952 + + + 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 -- cgit v1.2.3