diff --git a/examples/notebooks/Grid_Levels_and_Parameters.ipynb b/examples/notebooks/Grid_Levels_and_Parameters.ipynb
index 154198a..de2087d 100644
--- a/examples/notebooks/Grid_Levels_and_Parameters.ipynb
+++ b/examples/notebooks/Grid_Levels_and_Parameters.ipynb
@@ -4,22 +4,122 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "This example covers the callable methods of python-awips when working with gridded data. We start with a connection to an EDEX server, then query data types, then grid names, parameters, levels, and other information. Finally the gridded data is plotted for its domain using Matplotlib and Cartopy."
+ "Python-AWIPS Tutorial Notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## DataAccessLayer.getSupportedDatatypes()\n",
"\n",
- "getSupportedDatatypes() returns a list of available data types offered by the EDEX server defined above. "
+ "\n",
+ "---\n",
+ "\n",
+ "\n",
+ "# Objectives\n",
+ "\n",
+ "* Cover the relevant methods for accessing EDEX and investigating what data is available. \n",
+ "* This example we look at the \"grid\" data type and investigate the Global Forcast System (GFS) model. \n",
+ "* We will talk quite a bit about the **DataAccessLayer** utility, and its [online documentation](http://unidata.github.io/python-awips/api/DataAccessLayer.html#) might be a helpful reference.\n",
+ "\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Table of Contents\n",
+ "\n",
+ "[1 Imports](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#1-imports)
\n",
+ "[2 Connect to EDEX](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#2-connect-to-edex)
\n",
+ "[3 Get a List of Supported Data Types](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#3-get-a-list-of-supported-data-types)
\n",
+ "[4 Create a New Data Request and Set the Type](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#4-create-a-new-data-request-and-set-the-type)
\n",
+ "[5 Get Available Locations](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#5-get-available-locations)
\n",
+ "[6 Get Available Parameters](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#6-get-available-parameters)
\n",
+ "[7 Get Available Levels](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#7-get-available-levels)
\n",
+ "[8 Get Available Times](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#8-get-available-times)
\n",
+ "[9 Get the Data!](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#9-get-the-data)
\n",
+ "[10 See Also](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html#10-see-also)
\n",
+ " [10.1 Related Notebooks](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Paramters.html#10.1-related-notebooks)
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 1 Imports\n",
+ "\n",
+ "Start by importing the DataAccessLayer package from python-awips:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
+ "outputs": [],
+ "source": [
+ "from awips.dataaccess import DataAccessLayer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
+ "\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 2 Connect to EDEX\n",
+ "\n",
+ "Define a url for your EDEX connection, and then point python-awips at that EDEX"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Unidata's cloud EDEX instance is used in this example\n",
+ "edex_url = \"edex-cloud.unidata.ucar.edu\"\n",
+ "DataAccessLayer.changeEDEXHost(edex_url)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
+ "\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 3 Get a List of Supported Data Types\n",
+ "\n",
+ "[***DataAccessLayer.getSupportedDatatypes()***](http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.getSupportedDatatypes) returns a list of supported data types offered by the EDEX server defined above. The code below shows how to populate, sort, and print out that list."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
"outputs": [
{
"data": {
@@ -53,16 +153,12 @@
" 'warning']"
]
},
- "execution_count": 1,
+ "execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "from awips.dataaccess import DataAccessLayer\n",
- "import unittest\n",
- "\n",
- "DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
"dataTypes = DataAccessLayer.getSupportedDatatypes()\n",
"dataTypes.sort()\n",
"list(dataTypes)"
@@ -72,14 +168,54 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## DataAccessLayer.getAvailableLocationNames()\n",
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
"\n",
- "Now create a new data request, and set the data type to **grid** to request all available grids with **getAvailableLocationNames()**"
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 4 Create a New Data Request and Set the Type\n",
+ "\n",
+ "Now create a new data request using [***DataAccessLayer.newDataRequest()***](http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.newDataRequest), and set the data type using [***request.setDatatype()***](http://unidata.github.io/python-awips/api/IDataRequest.html#awips.dataaccess.IDataRequest.setDatatype). Below we create a few different requests with different data types to show some differences with other methods.\n",
+ "\n",
+ "For this example we are going to look at the ***grid*** data type, which is where the model data can be found, along with some other datasets (such as MRMS)."
]
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create a request for data type grid\n",
+ "grid_request = DataAccessLayer.newDataRequest()\n",
+ "grid_request.setDatatype(\"grid\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
+ "\n",
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 5 Get Available Locations\n",
+ "\n",
+ "Use the [***DataAccessLayer.getAvailableLocationNames(request)***](http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.getAvailableLocationNames) method to find out what locations are available for the given dataset. Typically these will be geographic locations or NWS sites, although in some instances it will be something else. Take a look at what's outputted for the grid_request, for example."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
"metadata": {},
"outputs": [
{
@@ -146,31 +282,41 @@
" 'navgem0p5']"
]
},
- "execution_count": 2,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "request = DataAccessLayer.newDataRequest()\n",
- "request.setDatatype(\"grid\")\n",
- "available_grids = DataAccessLayer.getAvailableLocationNames(request)\n",
- "available_grids.sort()\n",
- "list(available_grids)"
+ "# Grid Locations\n",
+ "grid_locations = DataAccessLayer.getAvailableLocationNames(grid_request)\n",
+ "grid_locations.sort()\n",
+ "list(grid_locations)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## DataAccessLayer.getAvailableParameters()\n",
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
"\n",
- "After datatype and model name (locationName) are set, you can query all available parameters with **getAvailableParameters()**"
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Get Available Parameters\n",
+ "\n",
+ "We're setting the \"location\" (in this case, what model we are interested in) to specify our request before we look at the available parameters.\n",
+ "\n",
+ "Take a look at the available parameters for the data set by using [***DataAccessLayer.getAvailableParameters(request)***](http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.getAvailableParameters)"
]
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 6,
"metadata": {},
"outputs": [
{
@@ -192,16 +338,25 @@
" 'BlkShr',\n",
" 'CAPE',\n",
" 'CFRZR',\n",
+ " 'CFRZR3hr',\n",
+ " 'CFRZR6hr',\n",
" 'CICEP',\n",
+ " 'CICEP3hr',\n",
+ " 'CICEP6hr',\n",
" 'CIn',\n",
" 'CP',\n",
- " 'CP1hr',\n",
+ " 'CP-GFS',\n",
+ " 'CP3hr',\n",
+ " 'CP6hr',\n",
" 'CPr',\n",
" 'CPrD',\n",
" 'CRAIN',\n",
+ " 'CRAIN3hr',\n",
+ " 'CRAIN6hr',\n",
" 'CSNOW',\n",
+ " 'CSNOW3hr',\n",
+ " 'CSNOW6hr',\n",
" 'CURU',\n",
- " 'CXR',\n",
" 'CapeStk',\n",
" 'Corf',\n",
" 'CorfF',\n",
@@ -218,6 +373,7 @@
" 'EHI',\n",
" 'EHI01',\n",
" 'EHIi',\n",
+ " 'EMSP',\n",
" 'EPT',\n",
" 'EPTA',\n",
" 'EPTC',\n",
@@ -231,7 +387,6 @@
" 'ESP',\n",
" 'ESP2',\n",
" 'FVecs',\n",
- " 'FeatMot',\n",
" 'FnVecs',\n",
" 'FsVecs',\n",
" 'Fzra1',\n",
@@ -239,13 +394,12 @@
" 'GH',\n",
" 'GHxSM',\n",
" 'GHxSM2',\n",
- " 'Gust',\n",
+ " 'GVV',\n",
" 'HI',\n",
" 'HI1',\n",
" 'HI3',\n",
" 'HI4',\n",
" 'HIdx',\n",
- " 'HPBL',\n",
" 'Heli',\n",
" 'HeliC',\n",
" 'INV',\n",
@@ -261,7 +415,6 @@
" 'MCon2',\n",
" 'MLLCL',\n",
" 'MMP',\n",
- " 'MMSP',\n",
" 'MSFDi',\n",
" 'MSFi',\n",
" 'MSFmi',\n",
@@ -270,13 +423,18 @@
" 'Mix1',\n",
" 'Mix2',\n",
" 'Mmag',\n",
+ " 'MnT3hr',\n",
+ " 'MnT6hr',\n",
" 'MpV',\n",
+ " 'MxT3hr',\n",
+ " 'MxT6hr',\n",
" 'NBE',\n",
" 'NST',\n",
" 'NST1',\n",
" 'NST2',\n",
- " 'OmDiff',\n",
" 'P',\n",
+ " 'P3hr',\n",
+ " 'P6hr',\n",
" 'PAdv',\n",
" 'PBE',\n",
" 'PEC',\n",
@@ -285,10 +443,8 @@
" 'PGrd1',\n",
" 'PGrdM',\n",
" 'PIVA',\n",
- " 'PR',\n",
" 'PTvA',\n",
" 'PTyp',\n",
- " 'PVV',\n",
" 'PW',\n",
" 'PW2',\n",
" 'PoT',\n",
@@ -297,7 +453,6 @@
" 'QPV2',\n",
" 'QPV3',\n",
" 'QPV4',\n",
- " 'REFC',\n",
" 'RH',\n",
" 'RH_001_bin',\n",
" 'RH_002_bin',\n",
@@ -305,7 +460,6 @@
" 'RM6',\n",
" 'RMprop',\n",
" 'RMprop2',\n",
- " 'RRtype',\n",
" 'RV',\n",
" 'Rain1',\n",
" 'Rain2',\n",
@@ -329,7 +483,6 @@
" 'STP1',\n",
" 'Shear',\n",
" 'ShrMag',\n",
- " 'SnD',\n",
" 'Snow1',\n",
" 'Snow2',\n",
" 'Snow3',\n",
@@ -345,7 +498,9 @@
" 'TORi',\n",
" 'TORi2',\n",
" 'TP',\n",
- " 'TP1hr',\n",
+ " 'TP-GFS',\n",
+ " 'TP3hr',\n",
+ " 'TP6hr',\n",
" 'TQIND',\n",
" 'TShrMi',\n",
" 'TV',\n",
@@ -367,20 +522,15 @@
" 'TwMin',\n",
" 'Twstk',\n",
" 'TxSM',\n",
- " 'USTM',\n",
" 'VAdv',\n",
" 'VAdvAdvection',\n",
" 'VGP',\n",
- " 'VSTM',\n",
- " 'Vis',\n",
+ " 'VSS',\n",
" 'WCD',\n",
" 'WD',\n",
" 'WEASD',\n",
- " 'WEASD1hr',\n",
- " 'WGS',\n",
" 'Wind',\n",
" 'WndChl',\n",
- " 'ageoVC',\n",
" 'ageoW',\n",
" 'ageoWM',\n",
" 'cCape',\n",
@@ -439,7 +589,6 @@
" 'vTOT',\n",
" 'vW',\n",
" 'vWStk',\n",
- " 'vertCirc',\n",
" 'wDiv',\n",
" 'wSp',\n",
" 'wSp_001_bin',\n",
@@ -449,33 +598,57 @@
" 'zAGL']"
]
},
- "execution_count": 3,
+ "execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "request.setLocationNames(\"RAP13\")\n",
- "availableParms = DataAccessLayer.getAvailableParameters(request)\n",
- "availableParms.sort()\n",
- "list(availableParms)"
+ "# Pick a model and set the location for the grid request -- we'll be using the Global Forecast System 20km (GFS20) \n",
+ "grid_request.setLocationNames(\"GFS20\")\n",
+ "grid_params = DataAccessLayer.getAvailableParameters(grid_request)\n",
+ "grid_params.sort()\n",
+ "list(grid_params)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## DataAccessLayer.getAvailableLevels()\n",
+ "[Top](https://unidata.github.io/python-awips/examples/generated/Grid_Levels_and_Parameters.html)\n",
"\n",
- "Selecting **\"T\"** for temperature."
+ "---"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 7 Get Available Levels\n",
+ "\n",
+ "\n",
+ "Setting the parameters is just an option, you do not need to filter the data if you do not wish to. Also, although we are only setting one parameter in this example, you can set multiple parameters by using an array:\n",
+ "```\n",
+ "params = (\"param1\", \"param2\", \"param3\"...)\n",
+ "request.setParameters(params)\n",
+ "```\n",
+ "\n",
+ "Set a parameter, from the output above and take a look at what \"levels\" are available for the data set you're looking at using [***DataAccessLayer.getAvailableLevels(request)***](http://unidata.github.io/python-awips/api/DataAccessLayer.html#awips.dataaccess.DataAccessLayer.getAvailableLevels)."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "