Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Nov 28, 2024
1 parent 1faae3e commit 38b4d40
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions notebooks/01a-griddap.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"CAVEAT: Note that ERDDAP can serve gridded data with longitudes in the 0–360 format or -180–180.\n",
"The user must inspect the dataset and modify your query accordingly.\n",
"\n",
"Information on the griddap dataset is fetched with `griddap_initialize`.\n",
"This fills in the `variables` and `constraints` properties for that dataset."
"Information on the griddap dataset is fetched automatically and the `variables` and `constraints` properties for that dataset are filled using ERDDAP's defaults."
]
},
{
Expand All @@ -83,24 +82,55 @@
"source": [
"import json\n",
"\n",
"e.griddap_initialize()\n",
"constraints = json.dumps(e.constraints, indent=1)\n",
"\n",
"print(f\"variables in this dataset:\\n\\n{e.variables}\")\n",
"constraints = json.dumps(e.constraints, indent=1)\n",
"print(f\"\\nconstraints of this dataset:\\n\\n{constraints}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The default behaviour is to use erddap standard subsetting to return all variables at the most recent timestep and every point of the remaining dimensions.\n",
"ERDDAP's standard subsetting return all variables at the most recent timestep and every point of the remaining dimensions.\n",
"\n",
"This can result in large data requests!\n",
"However, the values of the constraints can be changed and variables dropped before data set is downloaded.\n",
"Here we will download only one variable from that list."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"e.constraints[\"latitude_step\"] = 10\n",
"e.constraints[\"longitude_step\"] = 10\n",
"\n",
"constraints = json.dumps(e.constraints, indent=1)\n",
"print(f\"\\nconstraints of this dataset:\\n\\n{constraints}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The user can reset to the defaults with `griddap_initialize()`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"e.griddap_initialize()\n",
"\n",
"constraints = json.dumps(e.constraints, indent=1)\n",
"print(f\"\\nconstraints of this dataset:\\n\\n{constraints}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -258,13 +288,6 @@
"e.dataset_id = \"etopo5_lon180\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The data can be downloaded immediately, no need to run `griddap_initialize`\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -332,7 +355,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.13.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 38b4d40

Please sign in to comment.