Skip to content

Commit f4383b9

Browse files
committed
fixup
1 parent 755ef3f commit f4383b9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

scripts/download_etopo_15s.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ mkdir -p "$OUTPUT_DIR"
2525

2626
echo "Downloading ETOPO 2022 15 arc-second data to: $OUTPUT_DIR"
2727
echo "Data type: $DATA_TYPE (files will end with _${FILE_SUFFIX}.nc)"
28+
echo "Note: Already downloaded files will be skipped automatically"
2829
echo "=========================================================="
2930

3031
# Option 1: Download ALL tiles (WARNING: This is a LOT of data - 288 tiles!)
@@ -40,20 +41,21 @@ download_all_tiles() {
4041
# N60 tiles
4142
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 \
4243
E000 E015 E030 E045 E060 E075 E090 E105 E120 E135 E150 E165; do
43-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
44+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
4445
done
4546
;;
4647
N75)
4748
# N75 tiles
4849
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 \
4950
E000 E015 E030 E045 E060 E075 E090 E105 E120 E135 E150 E165; do
50-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
51+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
5152
done
5253
;;
5354
N90)
54-
# N90 tiles (polar cap - fewer tiles)
55-
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 E000; do
56-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
55+
# N90 tiles (polar cap - all longitudes)
56+
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 \
57+
E000 E015 E030 E045 E060 E075 E090 E105 E120 E135 E150 E165; do
58+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
5759
done
5860
;;
5961
esac
@@ -63,15 +65,15 @@ download_all_tiles() {
6365
for lat in N45 N30 N15 N00; do
6466
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 \
6567
E000 E015 E030 E045 E060 E075 E090 E105 E120 E135 E150 E165; do
66-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
68+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
6769
done
6870
done
6971

7072
# Southern Hemisphere (S15, S30, S45, S60, S75)
7173
for lat in S15 S30 S45 S60 S75; do
7274
for lon in W180 W165 W150 W135 W120 W105 W090 W075 W060 W045 W030 W015 \
7375
E000 E015 E030 E045 E060 E075 E090 E105 E120 E135 E150 E165; do
74-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
76+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
7577
done
7678
done
7779
}
@@ -88,7 +90,7 @@ download_specific_region() {
8890
for lat in N45 N60 N75; do
8991
for lon in W015 E000 E015 E030 E045; do
9092
echo "Downloading tile: ${lat}${lon}"
91-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc"
93+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${lat}${lon}_${FILE_SUFFIX}.nc" || true
9294
done
9395
done
9496
}
@@ -106,7 +108,7 @@ download_specific_tiles() {
106108
echo "Downloading ${#tiles[@]} specific tiles..."
107109
for tile in "${tiles[@]}"; do
108110
echo "Downloading tile: $tile"
109-
wget -c -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${tile}_${FILE_SUFFIX}.nc"
111+
wget -c -nc -P "$OUTPUT_DIR" "${BASE_URL}/ETOPO_2022_v1_15s_${tile}_${FILE_SUFFIX}.nc" || true
110112
done
111113
}
112114

0 commit comments

Comments
 (0)