NEANIAS Gitlab
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Carlos H. Brandt
DM
Commits
d4337bee
Commit
d4337bee
authored
Apr 16, 2020
by
Carlos H. Brandt
Browse files
Update script to download from NASA also
parent
7270b71d
Changes
1
Hide whitespace changes
Inline
Side-by-side
datasets/MEX/HRSC/download_sample.sh
View file @
d4337bee
#!/bin/bash
#!/bin/bash
set
-ue
#
set -ue
DRY_RUN
=
${
DRY_RUN
:-
""
}
DRY_RUN
=
${
DRY_RUN
:-
""
}
...
@@ -33,12 +33,20 @@ function usage() {
...
@@ -33,12 +33,20 @@ function usage() {
echo
""
echo
""
echo
" Print (wget) commands for downloading Data for Orbit I957:"
echo
" Print (wget) commands for downloading Data for Orbit I957:"
echo
""
echo
""
echo
"
$
DRY_RUN=y ORBIT=
I975
./download_sample.sh data"
echo
"
$
DRY_RUN=y ORBIT=
0103
./download_sample.sh data"
echo
""
echo
""
}
}
server
=
'ftp://psa.esac.esa.int'
SRV
=
${
SRV
:-
ESA
}
path
=
'pub/mirror/MARS-EXPRESS/HRSC/MEX-M-HRSC-5-REFDR-DTM-V1.0'
if
[
"
$SRV
"
=
'ESA'
]
;
then
SERVER
=
'ftp://psa.esac.esa.int'
PDSATH
=
'pub/mirror/MARS-EXPRESS/HRSC/MEX-M-HRSC-5-REFDR-DTM-V1.0'
else
[
"
$SRV
"
=
'NASA'
]
||
{
echo
'$SRV should be either ESA or NASA'
;
exit
;
}
SERVER
=
'ftp://pds-geosciences.wustl.edu'
PDSATH
=
'mex/mex-m-hrsc-5-refdr-dtm-v1/mexhrs_2001'
fi
docs
=(
AAREADME.TXT CATALOG/CATINFO.TXT DOCUMENT EXTRAS/EXTRINFO.TXT INDEX/INDXINFO.TXT VOLDESC.CAT
)
docs
=(
AAREADME.TXT CATALOG/CATINFO.TXT DOCUMENT EXTRAS/EXTRINFO.TXT INDEX/INDXINFO.TXT VOLDESC.CAT
)
meta
=(
INDEX
)
meta
=(
INDEX
)
...
@@ -49,15 +57,14 @@ function do_wget() {
...
@@ -49,15 +57,14 @@ function do_wget() {
#
#
content
=
$@
content
=
$@
for
c
in
${
content
[@]
}
;
do
for
c
in
${
content
[@]
}
;
do
# REMOVE 'echo' to actually download the content
data
=
"
${
SERVER
}
/
${
PDSATH
}
/
${
c
}
"
#
[
"
$SRV
"
=
'NASA'
]
&&
data
=
$(
echo
"
$data
"
|
tr
'[:upper:]'
'[:lower:]'
)
if
[
!
-n
"
$DRY_RUN
"
]
;
then
if
[
!
-n
"
$DRY_RUN
"
]
;
then
# download
# download
echo
"Remove this 'echo'"
wget
-r
-nH
--cut-dirs
=
4
--directory-prefix
=
${
SRV
}
${
data
}
echo
wget
-r
-nH
--cut-dirs
=
4
--directory-prefix
=
ESA
${
server
}
/
${
path
}
/
${
c
}
else
else
# dry-run
# dry-run
echo
wget
-r
-nH
--cut-dirs
=
4
--directory-prefix
=
ESA
${
server
}
/
${
p
at
h
}
/
${
c
}
echo
"
wget -r -nH --cut-dirs=4 --directory-prefix=
${
SRV
}
${
d
at
a
}
"
fi
fi
done
done
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment