forked from skandium/cyclorank
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_run_cyklorank_v2.sh
executable file
·99 lines (85 loc) · 3.86 KB
/
_run_cyklorank_v2.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env bash
set -eu
set -o pipefail
# default params
EXP_NAME="data/2024-07-22"
STAGE=1
LOGLEVEL="INFO"
# get shell params form command line
# parsing args
SHORT=e:,s:,c:,h
LONG=stage:,exp-name:,city-conf:,help
OPTS=$(getopt -a -n weather --options $SHORT --longoptions $LONG -- "$@")
eval set -- "$OPTS"
while :; do
case "$1" in
-s | --stage)
STAGE="$2"
shift 2
;;
-n | --exp-name)
EXP_NAME="$2"
shift 2
;;
-h | --help)
"This is a script for running the map analysis pipeline"
exit 2
;;
--)
shift
break
;;
*)
echo "Unexpected option: $1"
;;
esac
done
echo "STAGE = ${STAGE}"
echo "EXP_NAME = $EXP_NAME"
if [ $STAGE -le 1 ]; then
echo "Stage 1: Downloading and extracting maps"
python download_and_extract_maps_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL
python download_and_extract_maps_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL
fi
if [ $STAGE -le 2 ]; then
echo "Stage 2: Getting city polygons and sample coordinates"
# Get city polygons for Czechia
python get_city_polygons_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL
python routing/sample_coordinates.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL
# Get city polygons for Europe
python get_city_polygons_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL
python routing/sample_coordinates.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL
fi
if [ $STAGE -le 3 ]; then
echo "Stage 3: Getting distances for all cities"
python get_osmium_data_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL
python get_osmium_data_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL
fi
if [ $STAGE -le 4 ]; then
echo "Stage 4: Getting decay configs"
python get_decay_configs_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL
python get_decay_configs_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL
fi
if [ $STAGE -le 5 ]; then
echo "Stage 5: Final results"
python run_map_analysis_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" --log_level $LOGLEVEL --force-rewrite
python run_map_analysis_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" --log_level $LOGLEVEL --force-rewrite
fi
if [ $STAGE -le 6 ]; then
echo "Stage 6: Convert results to tables"
# all
python results_to_csv_cli.py --experiment_name "$EXP_NAME" --config_path config/city_conf_czechia.json config/city_conf_europe.json --log_level $LOGLEVEL
# only CZ
python results_to_csv_cli.py --experiment_name "$EXP_NAME" --config_path config/city_conf_czechia.json \
--output_path "$EXP_NAME/Czechia" --log_level $LOGLEVEL
# only Europe
python results_to_csv_cli.py --experiment_name "$EXP_NAME" --config_path config/city_conf_europe.json \
--output_path "$EXP_NAME/Europe" --log_level $LOGLEVEL
fi
if [ $STAGE -le 7 ]; then
echo "Stage 7: Draw and save maps"
python draw_maps_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_czechia.json" \
--output_path "$EXP_NAME/Czechia" --log_level $LOGLEVEL
python draw_maps_cli.py --experiment_name "$EXP_NAME" --config_path "config/city_conf_europe.json" \
--output_path "$EXP_NAME/Europe" --log_level $LOGLEVEL
fi