From 3813621611945a0be23384c0c4d395b4c4a614ad Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:15 -0700 Subject: init --- python/atms-310/homework/hw3/color.txt | 344 +++++++++++++++++++++++++++ python/atms-310/homework/hw3/homework3.py | 53 +++++ 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 + 9 files changed, 471 insertions(+) create mode 100644 python/atms-310/homework/hw3/color.txt create mode 100644 python/atms-310/homework/hw3/homework3.py create mode 100644 python/atms-310/homework/hw3/hw3.py create mode 100644 python/atms-310/homework/hw3/hw3_01srh1.txt create mode 100644 python/atms-310/homework/hw3/hw3_01srh2.txt create mode 100644 python/atms-310/homework/hw3/hw3_06shr1.txt create mode 100644 python/atms-310/homework/hw3/hw3_06shr2.txt create mode 100644 python/atms-310/homework/hw3/hw3_mlcape1.txt create mode 100644 python/atms-310/homework/hw3/hw3_mlcape2.txt (limited to 'python/atms-310/homework/hw3') diff --git a/python/atms-310/homework/hw3/color.txt b/python/atms-310/homework/hw3/color.txt new file mode 100644 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 100644 index 0000000..31db6de --- /dev/null +++ b/python/atms-310/homework/hw3/homework3.py @@ -0,0 +1,53 @@ +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]) +# for n, param in enumerate(parameters): +# np_function = getattr(np, param) +# result = np_function(read(filelist[n])) +# print(result) + +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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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