This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from emanuelegiona/main
ns-3.37 + WOSS 1.12.4 release
- Loading branch information
Showing
7 changed files
with
649 additions
and
44 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
# MIT License | ||
|
||
# Copyright (c) 2021 Emanuele Giona <[email protected]> (SENSES Lab, | ||
# Copyright (c) 2023 Emanuele Giona <[email protected]> (SENSES Lab, | ||
# Sapienza University of Rome) | ||
|
||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -23,17 +23,93 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
cd $1 | ||
USAGE="Usage: ./$(basename "$0") </path/to/download_dir> </path/to/dbs_dir> | ||
where: | ||
- </path/to/download_dir> is the absolute path to the directory for downloading databases | ||
- </path/to/dbs_dir> is the absolute path to the directory for storing databases" | ||
|
||
echo "Downloading databases" | ||
if [[ "$#" -ne 2 ]]; then | ||
echo "Invalid argument number." | ||
echo "${USAGE}" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "${1}" ]; then | ||
echo "Download directory does not exist." | ||
echo "${USAGE}" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "${2}" ]; then | ||
echo "Databse directory does not exist." | ||
echo "${USAGE}" | ||
exit 1 | ||
fi | ||
|
||
CURR_DIR=`pwd` | ||
WOSS_DBS=0 | ||
GEBCO_2020=0 | ||
GEBCO_2022=0 | ||
|
||
echo "Entering ${1}" | ||
cd ${1} | ||
|
||
echo "1/3: Downloading WOSS databases..." | ||
wget http://telecom.dei.unipd.it/ns/woss/files/WOSS-dbs-v1.6.0.tar.gz && \ | ||
tar -xf WOSS-dbs-v1.6.0.tar.gz && \ | ||
rm WOSS-dbs-v1.6.0.tar.gz && \ | ||
let WOSS_DBS=1 | ||
|
||
if [ ${WOSS_DBS} -ne 1 ]; then | ||
echo "FAILED: exiting" | ||
exit 1 | ||
fi | ||
|
||
echo "2/3: Downloading GEBCO 2020 database..." | ||
curl -L -o gebco_2020_netcdf.zip https://www.bodc.ac.uk/data/open_download/gebco/gebco_2020/zip/ && \ | ||
unzip gebco_2020_netcdf.zip && \ | ||
rm gebco_2020_netcdf.zip && \ | ||
mv GEBCO_2020.nc dbs/bathymetry/ | ||
let GEBCO_2020=1 | ||
|
||
if [ ${GEBCO_2020} -ne 1 ]; then | ||
echo "FAILED: exiting" | ||
exit 1 | ||
fi | ||
|
||
echo "3/3: Downloading GEBCO 2022 database..." | ||
curl -L -o gebco_2022_netcdf.zip https://www.bodc.ac.uk/data/open_download/gebco/gebco_2022/zip/ && \ | ||
unzip gebco_2022_netcdf.zip && \ | ||
rm gebco_2022_netcdf.zip && \ | ||
let GEBCO_2022=1 | ||
|
||
if [ ${GEBCO_2022} -ne 1 ]; then | ||
echo "FAILED: exiting" | ||
exit 1 | ||
fi | ||
|
||
echo "All databases downloaded" | ||
echo "Moving WOSS databases to ${2}..." | ||
|
||
cp -r --parents dbs/* ${2}/ | ||
|
||
if [ ! -d "${2}/dbs" ]; then | ||
echo "FAILED: exiting ('dbs' directory missing)" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "${2}/dbs/bathymetry" ]; then | ||
echo "FAILED: exiting ('dbs/bathymetry' directory missing)." | ||
exit 1 | ||
fi | ||
|
||
echo "Moving GEBCO 2020 database..." | ||
mv GEBCO_2020.nc ${2}/dbs/bathymetry/ | ||
|
||
echo "Moving GEBCO 2022 database..." | ||
mv GEBCO_2022.nc ${2}/dbs/bathymetry/ | ||
|
||
cd ${CURR_DIR} | ||
|
||
echo "Databases downloaded at directory: $1/dbs/" | ||
echo "Done" | ||
echo "All databases moved to: ${2}/dbs/" | ||
exit 0 |
Oops, something went wrong.