-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·52 lines (42 loc) · 1.67 KB
/
run.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# if the first argument is undefined, set it to a default value
masterjson=${1:-"$HOME/tdata/master.json.gz"}
trimTracksOut=${2:-"output/output.json.gz"}
components=${3:-"2"}
n_neighbors=${4:-"50"}
n_epochs=${5:-"200"}
# if catnames-cli is on the PATH, use it otherwise use the full path
# if the trimTracksOut file does not exist, create it
if [ ! -f "$trimTracksOut" ]; then
# 👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍
# https://github.com/tidwall/gjson/blob/master/SYNTAX.md 👍 👍 👍 👍 👍 👍
# 👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍👍 👍 👍 👍 👍 👍
# catnames-cli: https://github.com/rotblauer/cattracks-names
# mac not like zcat zcat, need cat zcat
cat $masterjson|zcat \
|catnames-cli modify --name-attribute 'properties.Name' --sanitize true \
|go run main.go \
--match-all '#(properties.Speed<50),#(properties.Accuracy<10),#(properties.Activity!="")' \
--match-any '#(properties.Name=="ia"),#(properties.Name=="rye")' \
filter \
|gzip > $trimTracksOut
# ,#(properties.Activity!="unknown")
else
echo "File $trimTracksOut already exists"
fi
# run main.py on the trimTracksOut file
# use awk to select every 10th line
# | awk 'NR % 10 == 0' \
# --metrics "euclidean" "haversine" \
cat $trimTracksOut \
|zcat \
| awk 'NR % 10 == 0' \
|.venv/bin/python main.py \
--n_neighbors $n_neighbors \
--metrics "none" \
--output "output/$n_neighbors.$components.umap.tsv.gz" \
--components $components \
--outputRaw "output/raw.tsv.gz" \
--n_epochs $n_epochs \
--n_neighbors $n_neighbors \
--standardize