From 09ccf0c3171e0c2a9c3b08d26fbf7faf36e5eaf6 Mon Sep 17 00:00:00 2001 From: Kasra Farmer Date: Tue, 15 Nov 2022 18:26:12 -0500 Subject: [PATCH 1/3] updating exactextractr dependency version as well as updating Graham's local cache files --- assets/renv.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/renv.lock b/assets/renv.lock index 31b071c..b68df67 100644 --- a/assets/renv.lock +++ b/assets/renv.lock @@ -110,15 +110,15 @@ }, "exactextractr": { "Package": "exactextractr", - "Version": "0.9.0", + "Version": "0.9.1", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "isciences", "RemoteRepo": "exactextractr", - "RemoteRef": "6d02446438991c3d6a8017474200aaf23fc7a695", - "RemoteSha": "6d02446438991c3d6a8017474200aaf23fc7a695", - "Hash": "c22e1f368bc1d3083f3ad82ee8134344", + "RemoteRef": "f875cea876f0f9746f741e5559fce0e044fae8b8", + "RemoteSha": "f875cea876f0f9746f741e5559fce0e044fae8b8", + "Hash": "dc114ab271000cfc3e72331d5212f2c2", "Requirements": [ "Rcpp", "raster", From 754ad958d84ee4a5804dce891c8ff9f231c618ad Mon Sep 17 00:00:00 2001 From: Kasra Farmer Date: Tue, 15 Nov 2022 18:26:32 -0500 Subject: [PATCH 2/3] correcting subsetting address file for the output tif --- landsat/landsat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/landsat/landsat.sh b/landsat/landsat.sh index 8856608..82beb9e 100755 --- a/landsat/landsat.sh +++ b/landsat/landsat.sh @@ -243,7 +243,7 @@ if [[ "$printGeotiff" == "true" ]]; then echo "$(logDate)$(basename $0): subsetting GeoTIFFs under $outputDir" for var in "${variables[@]}"; do # subset based on lat and lon values - subset_geotiff "${geotiffDir}/${var}.tif" "${outputDir}/${prefix}${var}.tif" + subset_geotiff "${cache}/${var}/${var}.tif" "${outputDir}/${prefix}${var}.tif" done fi From 1e37391c4b9d3c9a7a62683ce986892750aa9380 Mon Sep 17 00:00:00 2001 From: Kasra Farmer Date: Tue, 15 Nov 2022 18:27:01 -0500 Subject: [PATCH 3/3] correcting variables in GSDE's example --- example/gsde.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 example/gsde.sh diff --git a/example/gsde.sh b/example/gsde.sh new file mode 100755 index 0000000..e92cfb5 --- /dev/null +++ b/example/gsde.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Geospatial Dataset Processing Workflow +# Copyright (C) 2022, University of Saskatchewan +# +# This file is part of the Geospatial Dataset Processing Workflow +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This is a simple example to extract common statistics for the +# pfaf 71 - Saskatchewan-Nelson System Shapefiles of MERIT-Basins - +# from the GSDE rasters. + +# Always call the script in the root directory of this repository +cd .. +echo "The current directory is: $(pwd)" + +# first download a sample shapefile - could be any shapefile +wget -m -nd -nv -q -A "cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.*" \ + "http://hydrology.princeton.edu/data/mpan/MERIT_Basins/MERIT_Hydro_v07_Basins_v01_bugfix1/pfaf_level_02/"; + +# implement subsetting and zonal statistics +./extract-gis.sh --dataset="GSDE" \ + --dataset-dir="/project/rpp-kshook/Model_Output/GSDE/download/gsde-30sec/" \ + --variable="BD" \ + --shape-file="$(pwd)/cat_pfaf_71_MERIT_Hydro_v07_Basins_v01_bugfix1.shp" \ + --print-geotiff=true \ + --output-dir="$HOME/scratch/depth-to-bedrock-test/" \ + --prefix="dtb_" \ + --stat="mean,min,max" \ + --email="you@company.ca" \ + -j; +