From e3cd68ff4370ecfbdc2153f6fe8ea7a648a5404f Mon Sep 17 00:00:00 2001 From: tkerr1 <theodoremkerr@gmail.com> Date: Mon, 1 Nov 2021 15:23:30 +0000 Subject: [PATCH] Working on NCEO cell error --- .../forest_biomass_summary_DRC_output.ipynb | 86 ++++++++----------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/country_outputs/forest_biomass_summary_DRC_output.ipynb b/country_outputs/forest_biomass_summary_DRC_output.ipynb index 7bdc970..0732493 100644 --- a/country_outputs/forest_biomass_summary_DRC_output.ipynb +++ b/country_outputs/forest_biomass_summary_DRC_output.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "domestic-poverty", + "id": "understood-error", "metadata": {}, "source": [ "# ESA Biomass Climate Change Initiative global forest aboveground biomass dataset v2.0 2010, 2017, 2018\n", @@ -18,7 +18,7 @@ }, { "cell_type": "markdown", - "id": "unlimited-minnesota", + "id": "imperial-navigation", "metadata": {}, "source": [ "#### Install these R packages first, and load them into the R session. Source R script with support functions." @@ -27,13 +27,8 @@ { "cell_type": "code", "execution_count": 1, - "id": "exterior-nightmare", - "metadata": { - "collapsed": true, - "jupyter": { - "outputs_hidden": true - } - }, + "id": "published-basin", + "metadata": {}, "outputs": [ { "name": "stderr", @@ -119,7 +114,7 @@ "\n", "Attaching package ff\n", "\n", - "- getOption(\"fftempdir\")==\"/tmp/RtmpPRaI0t/ff\"\n", + "- getOption(\"fftempdir\")==\"/tmp/RtmpO8dWrM/ff\"\n", "\n", "\n", "- getOption(\"ffextension\")==\"ff\"\n", @@ -168,13 +163,9 @@ "\n", "Warning message in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :\n", "“there is no package called ‘snow’â€\n", - "Warning message:\n", - "“dependency ‘nws’ is not availableâ€\n", - "also installing the dependencies ‘Rmpi’, ‘rlecuyer’\n", + "also installing the dependency ‘rlecuyer’\n", "\n", "\n", - "Warning message in install.packages(x, dependencies = TRUE):\n", - "“installation of package ‘Rmpi’ had non-zero exit statusâ€\n", "Updating HTML index of packages in '.Library'\n", "\n", "Making 'packages.html' ...\n", @@ -209,7 +200,7 @@ }, { "cell_type": "markdown", - "id": "united-district", + "id": "amino-hometown", "metadata": {}, "source": [ "#### Set the path to the CCI Biomass data folder & read in world countries shapefile" @@ -218,7 +209,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "searching-deployment", + "id": "frank-wings", "metadata": {}, "outputs": [ { @@ -261,7 +252,7 @@ }, { "cell_type": "markdown", - "id": "fifteen-wedding", + "id": "contained-status", "metadata": {}, "source": [ "#### Generate 10x10 degree WGS84 grid that the CCI Biomass and Hansen Forest Cover products are tiled on" @@ -270,7 +261,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "sacred-rings", + "id": "synthetic-tucson", "metadata": {}, "outputs": [ { @@ -292,7 +283,7 @@ }, { "cell_type": "markdown", - "id": "german-device", + "id": "formal-language", "metadata": {}, "source": [ "#### Print out country names in Africa to select from" @@ -300,8 +291,8 @@ }, { "cell_type": "code", - "execution_count": 6, - "id": "developmental-aruba", + "execution_count": 4, + "id": "harmful-covering", "metadata": {}, "outputs": [ { @@ -609,7 +600,7 @@ }, { "cell_type": "markdown", - "id": "bigger-racing", + "id": "passing-aircraft", "metadata": {}, "source": [ "#### Select a country in Africa to plot with corresponding data tiles" @@ -617,8 +608,8 @@ }, { "cell_type": "code", - "execution_count": 7, - "id": "chronic-packing", + "execution_count": 5, + "id": "behavioral-antique", "metadata": {}, "outputs": [ { @@ -677,8 +668,8 @@ }, { "cell_type": "code", - "execution_count": 8, - "id": "likely-reflection", + "execution_count": 6, + "id": "ideal-transfer", "metadata": {}, "outputs": [], "source": [ @@ -688,7 +679,7 @@ }, { "cell_type": "markdown", - "id": "emotional-consistency", + "id": "amateur-glenn", "metadata": {}, "source": [ "#### Read in the CCI Biomass data for this AOI from the downloaded CCI Biomass tiles, mosaicing multiple tiles as necessary" @@ -696,8 +687,8 @@ }, { "cell_type": "code", - "execution_count": 9, - "id": "honey-stewart", + "execution_count": 7, + "id": "interesting-adrian", "metadata": {}, "outputs": [ { @@ -708,7 +699,7 @@ "resolution : 0.0008888889, 0.0008888889 (x, y)\n", "extent : 12.21067, 31.28089, -13.45867, 5.375111 (xmin, xmax, ymin, ymax)\n", "crs : +proj=longlat +datum=WGS84 +no_defs \n", - "source : r_tmp_2021-10-25_142438_1337_91161.tif \n", + "source : r_tmp_2021-11-01_145918_845_65258.tif \n", "names : agbd_2020, agbd_sd_2020 \n", "min values : 0, 0 \n", "max values : 552, 1068 \n" @@ -725,7 +716,7 @@ }, { "cell_type": "markdown", - "id": "careful-delivery", + "id": "needed-return", "metadata": {}, "source": [ "#### Read in the NCEO Biomass data for this AOI from the downloaded data. NCEO data is stored as a single file for the continent of Africa, rather than multiple tiles." @@ -733,8 +724,8 @@ }, { "cell_type": "code", - "execution_count": 13, - "id": "fatty-activation", + "execution_count": 9, + "id": "sudden-veteran", "metadata": {}, "outputs": [ { @@ -753,7 +744,7 @@ "resolution : 0.0008983153, 0.0008983153 (x, y)\n", "extent : 12.2108, 31.28024, -13.45856, 5.375519 (xmin, xmax, ymin, ymax)\n", "crs : +proj=longlat +datum=WGS84 +no_defs \n", - "source : r_tmp_2021-10-25_145108_1337_50743.grd \n", + "source : r_tmp_2021-11-01_151612_845_75868.grd \n", "names : agbd_2017, agbd_sd_2017 \n", "min values : 0, 0 \n", "max values : 730, 310 \n" @@ -771,14 +762,13 @@ "filenames_nceo <- c(file.path(nceo_data_folder, file_name), file.path(nceo_data_folder, file_name_sd))\n", "print(filenames_nceo)\n", "\n", - "\n", + "filename <- \"\"\n", "\n", "tile_stack <- crop(stack(filenames_nceo), aoi)#, datatype=\"INT1U\", format='GTiff', options=\"COMPRESS=LZW\")\n", "\n", "names(tile_stack) <- band_names_nceo\n", "tile_stacks <- list(tile_stack)\n", "\n", - "\n", "tile_mosaic <- tile_stacks[[1]]\n", " if (filename != '') {\n", " tile_mosaic <- writeRaster(tile_mosaic, filename=filename, \n", @@ -796,7 +786,7 @@ { "cell_type": "code", "execution_count": 14, - "id": "hawaiian-bargain", + "id": "intelligent-russell", "metadata": {}, "outputs": [ { @@ -846,7 +836,7 @@ }, { "cell_type": "markdown", - "id": "caroline-infrared", + "id": "developmental-natural", "metadata": {}, "source": [ "#### Calculate total aboveground biomass and average aboveground biomass density for 2017 CCI and NCEO biomass for the selected country" @@ -855,7 +845,7 @@ { "cell_type": "code", "execution_count": null, - "id": "sophisticated-photographer", + "id": "cooperative-field", "metadata": {}, "outputs": [], "source": [ @@ -999,7 +989,7 @@ }, { "cell_type": "markdown", - "id": "continuing-crest", + "id": "simplified-format", "metadata": {}, "source": [ "#### Print out basic forest aboveground biomass statistics for the selected country\n", @@ -1009,7 +999,7 @@ { "cell_type": "code", "execution_count": null, - "id": "professional-vertical", + "id": "later-budapest", "metadata": {}, "outputs": [], "source": [ @@ -1020,7 +1010,7 @@ { "cell_type": "code", "execution_count": null, - "id": "premier-wallace", + "id": "normal-princeton", "metadata": {}, "outputs": [], "source": [ @@ -1054,7 +1044,7 @@ { "cell_type": "code", "execution_count": null, - "id": "statutory-chess", + "id": "rapid-request", "metadata": {}, "outputs": [], "source": [ @@ -1065,7 +1055,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dedicated-grass", + "id": "ultimate-woman", "metadata": {}, "outputs": [], "source": [ @@ -1075,7 +1065,7 @@ { "cell_type": "code", "execution_count": null, - "id": "signal-tractor", + "id": "portable-framing", "metadata": {}, "outputs": [], "source": [ @@ -1085,7 +1075,7 @@ { "cell_type": "code", "execution_count": null, - "id": "focal-trunk", + "id": "hybrid-tattoo", "metadata": {}, "outputs": [], "source": [] @@ -1093,7 +1083,7 @@ { "cell_type": "code", "execution_count": null, - "id": "several-spokesman", + "id": "ceramic-paradise", "metadata": {}, "outputs": [], "source": [] -- GitLab