-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunia.sh
executable file
·50 lines (36 loc) · 1.25 KB
/
runia.sh
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
#!/bin/bash
# if the first argument is undefined, set it to a default value
masterjson=${1:-"/Volumes/SandCat/tdata/master.json.gz"}
trimTracksOut=${2:-"output/output.json.gz"}
components=${3:-"2"}
# if the trimTracksOut file does not exist, create it
if [ ! -f "$trimTracksOut" ]; then
# cat $masterjson \
# |zcat \
# |go run main.go -names "rye,ia" \
# |gzip > $trimTracksOut
mkdir -p $(dirname $trimTracksOut)
set -x
# https://github.com/tidwall/gjson/blob/master/SYNTAX.md
zcat $masterjson \
|catnames-cli modify --name-attribute 'properties.Name' --sanitize true \
|go run main.go \
--match-all '#(properties.Accuracy<10),#(properties.Activity!=""),#(properties.Activity!="unknown")' \
--match-any '#(properties.Name="ia"),#(properties.Name="rye")' \
filter \
|gzip > $trimTracksOut
# --match-none '#(properties.Activity="unknown")' \
# |tail -500
# exit 0
else
echo "File $trimTracksOut already exists"
fi
# run main.py on the trimTracksOut file
metrics=("euclidean" "haversine")
for metric in "${metrics[@]}"
do
echo "Metric: $metric"
cat $trimTracksOut \
|zcat \
|.venv/bin/python main.py --metric $metric --output output/$metric.$components.umap.gz --components $components
done