-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10fed6b
commit 171196e
Showing
20 changed files
with
92 additions
and
348 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
REPO_TOP=$(git rev-parse --show-toplevel) | ||
results_dir="${REPO_TOP}/max-temp/results" | ||
|
||
echo "Cleaning up outputs..." | ||
rm -rf $results_dir | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
REPO_TOP=$(git rev-parse --show-toplevel) | ||
|
||
eval_dir="${REPO_TOP}/max-temp" | ||
results_dir="${eval_dir}/results" | ||
scripts_dir="${eval_dir}/scripts" | ||
input_dir="${eval_dir}/input" | ||
|
||
FROM=${FROM:-2015} | ||
TO=${TO:-2015} | ||
URL='https://www1.ncdc.noaa.gov/pub/data/noaa/' | ||
|
||
## Downloading and extracting | ||
seq $FROM $TO | | ||
sed "s;^;$URL;" | | ||
sed 's;$;/;' | | ||
xargs -r -n1 --insecure | | ||
grep gz | | ||
tr -s ' \n' | | ||
cut -d ' ' -f9 | | ||
sed 's;^\(.*\)\(20[0-9][0-9]\).gz;\2/\1\2\.gz;' | | ||
sed "s;^;$URL;" | | ||
xargs -n1 curl --insecure | | ||
gunzip > "$input_dir/temperatures2015.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
REPO_TOP=$(git rev-parse --show-toplevel) | ||
|
||
eval_dir="${REPO_TOP}/max-temp" | ||
results_dir="${eval_dir}/results" | ||
scripts_dir="${eval_dir}/scripts" | ||
input_dir="${eval_dir}/input" | ||
|
||
shell="/bin/bash" | ||
|
||
mkdir -p $results_dir | ||
|
||
export input_file=${input_dir}/temperatures2015.txt | ||
export results_dir | ||
script="${scripts_dir}/temp-analytics.sh" | ||
|
||
echo "Executing $(basename "$script")" | ||
$shell "$script" > "$results_dir/$(basename "$script").out" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
[[ -n "$input_file" ]] || echo "script was not provided with \$input_file" | ||
[[ -n "$results_dir" ]] || echo "script was not provided with \$results_dir" | ||
|
||
cat "${input_file}" | | ||
cut -c 88-92 | | ||
grep -v 999 | | ||
sort -rn | | ||
head -n1 > ${results_dir}/max.txt | ||
|
||
cat "${input_file}" | | ||
cut -c 88-92 | | ||
grep -v 999 | | ||
sort -n | | ||
head -n1 > ${results_dir}/min.txt | ||
|
||
cat "${input_file}" | | ||
cut -c 88-92 | | ||
grep -v 999 | | ||
awk "{ total += \$1; count++ } END { print total/count }" > ${results_dir}/average.txt |
Oops, something went wrong.