Skip to content

Commit

Permalink
feat(dataset): add water vapour (#1054)
Browse files Browse the repository at this point in the history
* feat(datasets): add water vapour

* chore(scripts): add layers list download task

* feat(datasets): add water vapour

* chore(scripts): add layers list download task

* feat(water-vapour): new colors

* feat(WV): update colors

* feat(water vapour): update color scale

Co-authored-by: Patrick Mast <mast@ubilabs.net>
Co-authored-by: KatvonRivia <katvonrivia@gmail.com>
  • Loading branch information
3 people committed Mar 18, 2022
1 parent 2a00be7 commit 6ffd06e
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 1 deletion.
Binary file added assets/layer-icons/water_vapour.tcwv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions data/downloads/odp-ftp-water-vapour.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash

BASE_URL="ftp://anon-ftp.ceda.ac.uk//neodc/esacci/water_vapour/data/TCWV-land/L3/v3.2/0.05deg/monthly/"
START_DATE=2002-07-01
OUTPUT_FOLDER=./download/water_vapour

mkdir -p $OUTPUT_FOLDER

for i in {0..101}
do
NEXT_DATE=$(date +%Y%m -d "$START_DATE + $i month")
NEXT_YEAR=$(date +%Y -d "$START_DATE + $i month")
FILENAME=$OUTPUT_FOLDER/$(date +%Y%m%d -d "$START_DATE + $i month").nc
FTP_URL=$BASE_URL$NEXT_YEAR/"ESACCI-WATERVAPOUR-L3C-TCWV-meris-005deg-"$NEXT_DATE"-fv3.2.nc"
echo $FTP_URL

curl $FTP_URL > $FILENAME
done

START_DATE=2011-01-01
for i in {0..14}
do
NEXT_DATE=$(date +%Y%m -d "$START_DATE + $i month")
NEXT_YEAR=$(date +%Y -d "$START_DATE + $i month")
FILENAME=$OUTPUT_FOLDER/$(date +%Y%m%d -d "$START_DATE + $i month").nc
FTP_URL=$BASE_URL$NEXT_YEAR/"ESACCI-WATERVAPOUR-L3C-TCWV-meris_modis_terra-005deg-"$NEXT_DATE"-fv3.2.nc"
echo $FTP_URL

curl $FTP_URL > $FILENAME
done


START_DATE=2012-04-01
for i in {0..47}
do
NEXT_DATE=$(date +%Y%m -d "$START_DATE + $i month")
NEXT_YEAR=$(date +%Y -d "$START_DATE + $i month")
FILENAME=$OUTPUT_FOLDER/$(date +%Y%m%d -d "$START_DATE + $i month").nc
FTP_URL=$BASE_URL$NEXT_YEAR/"ESACCI-WATERVAPOUR-L3C-TCWV-modis_terra-005deg-"$NEXT_DATE"-fv3.2.nc"
echo $FTP_URL

curl $FTP_URL > $FILENAME
done

START_DATE=2016-04-01
for i in {0..8}
do
NEXT_DATE=$(date +%Y%m -d "$START_DATE + $i month")
NEXT_YEAR=$(date +%Y -d "$START_DATE + $i month")
FILENAME=$OUTPUT_FOLDER/$(date +%Y%m%d -d "$START_DATE + $i month").nc
FTP_URL=$BASE_URL$NEXT_YEAR/"ESACCI-WATERVAPOUR-L3C-TCWV-olci_modis_terra-005deg-"$NEXT_DATE"-fv3.2.nc"
echo $FTP_URL

curl $FTP_URL > $FILENAME
done



START_DATE=2017-01-01
for i in {0..11}
do
NEXT_DATE=$(date +%Y%m -d "$START_DATE + $i month")
NEXT_YEAR=$(date +%Y -d "$START_DATE + $i month")
FILENAME=$OUTPUT_FOLDER/$(date +%Y%m%d -d "$START_DATE + $i month").nc
FTP_URL=$BASE_URL$NEXT_YEAR/"ESACCI-WATERVAPOUR-L3C-TCWV-olci-005deg-"$NEXT_DATE"-fv3.2.nc"
echo $FTP_URL

curl $FTP_URL > $FILENAME
done

4 changes: 4 additions & 0 deletions data/gdal-colors/colors-tcwv.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
60 11 131 209 255
10 10 179 145 80
0 10 179 145 0
nv 0 0 0 0
3 changes: 2 additions & 1 deletion data/layers-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@
},
"water_vapour.tcwv": {
"colorMap": "custom",
"basemap": "blue",
"basemap": "land",
"units": "kg/m²",
"timeFormat": {
"year": "numeric",
"month": "long",
Expand Down
29 changes: 29 additions & 0 deletions data/triggers/water_vapor_tcwv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

TIMEOUT=24000
LAYER_ID="water_vapour.tcwv"
VARIABLE_ID="tcwv"
VERSION="1.4.1"
LAYER_TYPE="image"
LON_RES="2048"
LAT_RES="1024"
ZOOM_LEVELS="0-3"
MIN_LON="-180"
MAX_LON="180"
MIN_LAT="-90"
MAX_LAT="90"
MIN="0"
MAX="60"
MACHINE_TYPE="N1_HIGHCPU_8"

if [ ! -f ./package.json ]; then
echo "You have to be in the root folder of the project to run this script!"
exit 1
fi

gcloud --project esa-climate-from-space builds submit \
--config ./ci/cloudbuild-tiles-reproject.yaml \
--machine-type=$MACHINE_TYPE \
--timeout=$TIMEOUT \
--substitutions _LAYER_ID=$LAYER_ID,_VARIABLE_ID=$VARIABLE_ID,_ZOOM_LEVELS=$ZOOM_LEVELS,_LAYER_TYPE=$LAYER_TYPE,_LON_RES=$LON_RES,_LAT_RES=$LAT_RES,_VERSION=$VERSION,_MIN=$MIN,_MAX=$MAX,_MIN_LON=$MIN_LON,_MAX_LON=$MAX_LON,_MIN_LAT=$MIN_LAT,_MAX_LAT=$MAX_LAT \
.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"download-stories": "gsutil -m rsync -x \".*stories-.*\\.json$\" -r gs://esa-cfs-storage/$npm_package_version/stories ./storage/stories/ && npm run clean:story-packages",
"upload-stories": "./scripts/confirm-storage-upload.sh && npm run story-packages && find ./storage/stories -type f -name \".DS_Store\" -delete && gsutil -m cp -r ./storage/stories/* gs://esa-cfs-storage/$npm_package_version/stories/ && npm run clean:story-packages",
"upload-layers": "find ./storage -type f -name \".DS_Store\" -delete && gsutil -m cp -r ./storage/layers/* gs://esa-cfs-storage/$npm_package_version/layers",
"download-layers": "gsutil -m cp gs://esa-cfs-storage/$npm_package_version/layers/layers-*.json ./storage/layers/",
"optimize-story-images": "./scripts/optimize-story-images.sh"
},
"repository": {
Expand Down

0 comments on commit 6ffd06e

Please sign in to comment.