-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(data-pipeline): improve tiles (#339)
* feat(data-pipeline): hide gsutil upload logs * feat(data-pipeline): use nearest neighbor filtering for gdalwarp * feat(data-pipeline): use dataset bounds from netcdf * feat(data-pipeline): add script to optionally mask values * feat(data-pipeline): add snow layer
- Loading branch information
Showing
12 changed files
with
92 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ steps: | |
id: 'upload-to-storage' | ||
args: | ||
- "-m" | ||
- "-q" | ||
- "cp" | ||
- "-r" | ||
- "/data/upload/${_LAYER_ID}/*" | ||
|
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 |
---|---|---|
|
@@ -45,6 +45,7 @@ steps: | |
id: 'upload-to-storage' | ||
args: | ||
- "-m" | ||
- "-q" | ||
- "cp" | ||
- "-r" | ||
- "/data/upload/${_LAYER_ID}/*" | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import xarray as xr | ||
from argparse import ArgumentParser | ||
|
||
parser = ArgumentParser() | ||
parser.add_argument("-f", "--file", dest="file") | ||
parser.add_argument("-v", "--variable", dest="variable") | ||
parser.add_argument("--min", dest="min") | ||
parser.add_argument("--max", dest="max") | ||
args = parser.parse_args() | ||
|
||
ds = xr.open_dataset(args.file, decode_coords=False, decode_cf=False) | ||
|
||
if args.min != None: | ||
da = ds[args.variable] | ||
ds[args.variable] = da.where(da > float(args.min)) | ||
|
||
if args.max != None: | ||
da = ds[args.variable] | ||
ds[args.variable] = da.where(da < float(args.max)) | ||
|
||
os.remove(args.file) | ||
ds.to_netcdf(args.file, format='NETCDF4_CLASSIC', mode='w') |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
TIMEOUT=8000 | ||
LAYER_ID="snow.swe" | ||
VARIABLE_ID="swe" | ||
VERSION="0.4.1" | ||
ZOOM_LEVELS="0-3" | ||
MIN="auto" | ||
MAX="auto" | ||
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 | ||
|
||
# --machine-type=$MACHINE_TYPE \ | ||
gcloud builds submit --config ./ci/cloudbuild-tiles.yaml \ | ||
--timeout=$TIMEOUT \ | ||
--substitutions _LAYER_ID=$LAYER_ID,_VARIABLE_ID=$VARIABLE_ID,_ZOOM_LEVELS=$ZOOM_LEVELS,_VERSION=$VERSION,_MIN=$MIN,_MAX=$MAX \ | ||
. |
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
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