diff --git a/meta/SoilData/config.yaml b/meta/SoilData/config.yaml index ac27f54..52c5c4d 100644 --- a/meta/SoilData/config.yaml +++ b/meta/SoilData/config.yaml @@ -1,8 +1,14 @@ -service_id: phh2o -coverage_id: phh2o_0-5cm_mean -crs: urn:ogc:def:crs:EPSG::152160 -west: -1784000 -south: 1356000 -east: -1140000 -north: 1863000 -output: test.tif +bmi-soilgrids: + service_id: {{service_id}} + coverage_id: {{coverage_id}} + crs: {{crs}} + west: {{west}} + south: {{south}} + east: {{east}} + north: {{north}} + resx: {{resx}} + resy: {{resy}} + width: {{width}} + height: {{height}} + response_crs: {{response_crs}} + output: {{output}} diff --git a/meta/SoilData/parameters.yaml b/meta/SoilData/parameters.yaml new file mode 100644 index 0000000..86455ed --- /dev/null +++ b/meta/SoilData/parameters.yaml @@ -0,0 +1,90 @@ +service_id: + name: Service ID + description: Map service identifier for a map service + value: + type: string + default: phh2o + units: 1 +coverage_id: + name: Coverage ID + description: Map coverage identifier supported by a map service + value: + type: string + default: phh2o_0-5cm_mean + units: 1 +crs: + name: Coordinate system + description: Coordinate system code for a map coverage + value: + type: string + default: urn:ogc:def:crs:EPSG::152160 +west: + name: Bounding box west coordinate + description: The x value for the point on the lower left corner of the bounding box. + value: + type: float + default: -1784000 + units: meters +south: + name: Bounding box south Coordinate + description: The y value for the point on the lower left corner of the bounding box + value: + type: float + default: 1356000 + units: meters +east: + name: Bounding box east Coordinate + description: The x value for the point on the upper right corner of the bounding box + value: + type: float + default: -1140000 + units: meters +north: + name: Bounding box North Coordinate + description: The y value for the point on the upper right corner of the bounding box + value: + type: float + default: 1863000 + units: meters +resx: + name: X Resolution + description: Pixel resolution in x direction + value: + type: float + default: 250.0 + units: meters +resy: + name: Y Resolution + description: Pixel resolution in y direction + value: + type: float + default: 250.0 + units: meters +width: + name: Width + description: Total number of pixels for the width of subset data. + value: + type: int + default: 316 + units: 1 +height: + name: Height + description: Total number of pixels for the height of subset data. + value: + type: int + default: 275 + units: 1 +response_crs: + name: Response Coordinate System + description: Coordinate system code for the output GeoTiff file. + value: + type: string + default: urn:ogc:def:crs:EPSG::152160 + units: 1 +output: + name: Output + description: File name for the output GeoTiff file. + value: + type: string + default: 'test.tif' + units: 1 \ No newline at end of file diff --git a/meta/SoilData/parameters.yaml b/meta/SoilData/parameters.yaml deleted file mode 100644 index d137b02..0000000 --- a/meta/SoilData/parameters.yaml +++ /dev/null @@ -1,142 +0,0 @@ -service_id: - name: Service ID - description: Map service identifier for a map service - value: - type: string - default: - units: - range: - min: - max: - -coverage_id: - name: Coverage ID - description: Map coverage identifier supported by a map service. - value: - type: string - default: - range: - min: - max: - units: - -crs: - name: Coordinate System - description: Coordinate system code for a map coverage. - value: - type: string - default: - range: - min: - max: - units: - -west: - name: West Coordinate - description: The west value is for the point on the lower left corner of the bounding box - value: - type: float - default: - range: - min: - max: - units: - -south: - name: South Coordinate - description: The south value is for the point on the lower left corner of the bounding box - value: - type: float - default: - range: - min: - max: - units: - -east: - name: East Coordinate - description: The east value is for the point on the upper right corner of the bounding box - value: - type: float - default: - range: - min: - max: - units: - -north: - name: North Coordinate - description: The north value is for the point on the upper right corner of the bounding box - value: - type: float - default: - range: - min: - max: - units: - -rsex: - name: X Resolution - description: Pixel resolution in x direction - value: - type: float - default: - range: - min: - max: - units: meter - -rsey: - name: Y Resolution - description: Pixel resolution in y direction - value: - type: float - default: - range: - min: - max: - units: meter - -width: - name: Width - description: Width in pixels for data download. - value: - type: int - default: - range: - min: - max: - units: - -height: - name: Height - description: Height in pixels for data download. - value: - type: int - default: - range: - min: - max: - units: - -response_crs: - name: Response Coordinate System - description: Coordinate system code for the GeoTiff file. - value: - type: string - default: - range: - min: - max: - units: - -output: - name: Output - description: File name for the output GeoTiff file. - value: - type: string - default: - range: - min: - max: - units: \ No newline at end of file diff --git a/notebooks/config.yaml b/notebooks/config.yaml index ac27f54..d90593e 100644 --- a/notebooks/config.yaml +++ b/notebooks/config.yaml @@ -1,8 +1,9 @@ -service_id: phh2o -coverage_id: phh2o_0-5cm_mean -crs: urn:ogc:def:crs:EPSG::152160 -west: -1784000 -south: 1356000 -east: -1140000 -north: 1863000 -output: test.tif +bmi-soilgrids: + service_id: phh2o + coverage_id: phh2o_0-5cm_mean + crs: urn:ogc:def:crs:EPSG::152160 + west: -1784000 + south: 1356000 + east: -1140000 + north: 1863000 + output: test.tif diff --git a/notebooks/pymt_soilgrids.ipynb b/notebooks/pymt_soilgrids.ipynb index 87ab117..c1deead 100644 --- a/notebooks/pymt_soilgrids.ipynb +++ b/notebooks/pymt_soilgrids.ipynb @@ -2,6 +2,7 @@ "cells": [ { "cell_type": "markdown", + "id": "persistent-worst", "metadata": {}, "source": [ "" @@ -9,6 +10,7 @@ }, { "cell_type": "markdown", + "id": "political-argentina", "metadata": {}, "source": [ "## Introduction" @@ -16,6 +18,7 @@ }, { "cell_type": "markdown", + "id": "increasing-cooper", "metadata": {}, "source": [ "[soilgrids package](https://github.com/gantian127/soilgrids) provides a set of functions that allows downloading of the global gridded soil information from [SoilGrids](https://www.isric.org/explore/soilgrids), a system for global digital soil mapping to map the spatial distribution of soil properties across the globe. soilgrids package also includes a Basic Model Interface ([BMI](https://bmi.readthedocs.io/en/latest/)). \n", @@ -25,26 +28,25 @@ }, { "cell_type": "markdown", + "id": "excited-norway", "metadata": {}, "source": [ - "**If pymt and pymt_soilgrids are not installed, you can use the following commands:**\n", - "\n", - "\n", - "*To create a conda environment and install pymt*\n", - "\n", - "$ conda create -n pymt -c conda-forge python=3 pymt \n", - "\n", - "$ conda activate pymt\n", - "\n", - "
\n", - "\n", - "*To install pymt_soilgrids*\n", - "\n", - "$ pip install pymt_soilgrids" + "**To install pymt_soilgrids, use the following command:**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "powerful-staff", + "metadata": {}, + "outputs": [], + "source": [ + "! pip install pymt_soilgrids" ] }, { "cell_type": "markdown", + "id": "thermal-lodge", "metadata": {}, "source": [ "## Coding Example" @@ -52,6 +54,7 @@ }, { "cell_type": "markdown", + "id": "nuclear-creativity", "metadata": {}, "source": [ "Import SoilData class and instantiate it. A configuration file (yaml file) is required to provide the parameter settings for data download. An example configure.yaml file is provided in the same folder with this Jupyter Notebook file. For more details of the parameters specified in the config.yaml file, please check with the link [here](https://soilgrids.readthedocs.io/en/latest/?badge=latest#parameter-settings)." @@ -60,6 +63,7 @@ { "cell_type": "code", "execution_count": 1, + "id": "secret-briefing", "metadata": {}, "outputs": [], "source": [ @@ -75,6 +79,7 @@ }, { "cell_type": "markdown", + "id": "comic-shannon", "metadata": {}, "source": [ "Use variable related methods to check the variable information of the soil dataset. " @@ -83,6 +88,7 @@ { "cell_type": "code", "execution_count": 2, + "id": "dedicated-receipt", "metadata": {}, "outputs": [ { @@ -111,6 +117,7 @@ }, { "cell_type": "markdown", + "id": "analyzed-norman", "metadata": {}, "source": [ "Use grid related methods to check the grid information of the soil dataset. " @@ -119,6 +126,7 @@ { "cell_type": "code", "execution_count": 3, + "id": "violent-michigan", "metadata": {}, "outputs": [ { @@ -147,6 +155,7 @@ }, { "cell_type": "markdown", + "id": "monetary-exception", "metadata": {}, "source": [ "Use get_value( ) method to get the soil data as a numpy array. Please note that the default behavior of pymt components is to flatten data arrays. So make a new variable that restores the dimensionality of the data." @@ -155,6 +164,7 @@ { "cell_type": "code", "execution_count": 4, + "id": "ideal-grave", "metadata": {}, "outputs": [ { @@ -175,6 +185,7 @@ }, { "cell_type": "markdown", + "id": "aggressive-synthesis", "metadata": {}, "source": [ "Now let's make a plot of the soil data. " @@ -183,6 +194,7 @@ { "cell_type": "code", "execution_count": 5, + "id": "aerial-austria", "metadata": {}, "outputs": [ { @@ -228,6 +240,7 @@ }, { "cell_type": "markdown", + "id": "going-discussion", "metadata": {}, "source": [ "Complete the example by finalizing the component." @@ -236,6 +249,7 @@ { "cell_type": "code", "execution_count": 6, + "id": "published-vault", "metadata": {}, "outputs": [], "source": [ @@ -259,7 +273,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.9.2" } }, "nbformat": 4,