Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 78 additions & 11 deletions doc/source/example_notebooks/IS2_data_variables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"import icepyx as ipx\n",
Expand Down Expand Up @@ -319,7 +321,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -329,15 +331,15 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# Uncomment and run the code in this cell to use the second variable subsetting suite of examples,\n",
"# with the beam specifier containing \"profile\" instead of \"gt#l\"\n",
"\n",
"# region_a = ipx.Query('ATL09',[-55, 68, -48, 71],['2019-02-22','2019-02-28'], \\\n",
"# start_time='00:00:00', end_time='23:59:59')"
"region_a = ipx.Query('ATL09',[-55, 68, -48, 71],['2019-02-22','2019-02-28'], \\\n",
" start_time='00:00:00', end_time='23:59:59')"
]
},
{
Expand Down Expand Up @@ -450,6 +452,7 @@
"1. Use a default list for the product (not yet fully implemented across all products. Have a default variable list for your field/product? Submit a pull request or post it as an issue on [GitHub](https://github.com/icesat2py/icepyx)!)\n",
"2. Provide a list of variable names\n",
"3. Provide a list of profiles/beams or other path keywords, where \"keywords\" are simply the unique subdirectory names contained in the full variable paths of the product. A full list of available keywords for the product is displayed in the error message upon entering `keyword_list=['']` into the `append` function (see below for an example) or by running `region_a.order_vars.avail(options=True)`, as above.\n",
"4. Providing a list of full variable path names from the H5 root path. icepyx will ensure that you are submitting valid variable paths.\n",
"\n",
"**Note: all products have a short list of \"mandatory\" variables/paths (containing spacecraft orientation and time information needed to convert the data's `delta_time` to a readable datetime) that are automatically added to any built list. If you have any recommendations for other variables that should always be included (e.g. uncertainty information), please let us know!**\n",
"\n",
Expand Down Expand Up @@ -724,7 +727,45 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Example 1.10: generate a default list for the rest of the tutorial\n",
"#### Example 1.10: `path_list`\n",
"Add a specific list of variable paths."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "too many values to unpack (expected 3)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[10], line 8\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# region_a.order_vars.remove(all=True)\u001b[39;00m\n\u001b[1;32m 2\u001b[0m path_list \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/delta_time\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 3\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/geophysical/bsnow_h\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 4\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/geophysical/bsnow_conf\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 5\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/fit_statistics/h_mean\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 6\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/latitude\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 7\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgt1l/land_ice_segments/longitude\u001b[39m\u001b[38;5;124m'\u001b[39m,]\n\u001b[0;32m----> 8\u001b[0m \u001b[43mregion_a\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43morder_vars\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mappend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath_list\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mpath_list\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 9\u001b[0m pprint(region_a\u001b[38;5;241m.\u001b[39morder_vars\u001b[38;5;241m.\u001b[39mwanted)\n",
"File \u001b[0;32m~/computing/icepyx/github_repo/icepyx/icepyx/core/variables.py:530\u001b[0m, in \u001b[0;36mVariables.append\u001b[0;34m(self, defaults, var_list, beam_list, keyword_list, path_list)\u001b[0m\n\u001b[1;32m 527\u001b[0m final_vars \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 529\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m path_list:\n\u001b[0;32m--> 530\u001b[0m _, (beams, keywords, variables) \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mparse_var_list(\n\u001b[1;32m 531\u001b[0m path_list, tiered_vars\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 532\u001b[0m )\n\u001b[1;32m 533\u001b[0m var_list \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28mset\u001b[39m(variables))\n\u001b[1;32m 534\u001b[0m beam_list \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28mset\u001b[39m(beams))\n",
"\u001b[0;31mValueError\u001b[0m: too many values to unpack (expected 3)"
]
}
],
"source": [
"# region_a.order_vars.remove(all=True)\n",
"path_list = ['gt1l/land_ice_segments/delta_time',\n",
" 'gt1l/land_ice_segments/geophysical/bsnow_h',\n",
" 'gt1l/land_ice_segments/geophysical/bsnow_conf',\n",
" 'gt1l/land_ice_segments/fit_statistics/h_mean',\n",
" 'gt1l/land_ice_segments/latitude',\n",
" 'gt1l/land_ice_segments/longitude',]\n",
"region_a.order_vars.append(path_list=path_list)\n",
"pprint(region_a.order_vars.wanted)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Example 1.11: generate a default list for the rest of the tutorial\n",
"Generate a reasonable variable list prior to download"
]
},
Expand Down Expand Up @@ -912,7 +953,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"region_a.order_vars.remove(beam_list=['profile_1','profile_3'])\n",
Expand All @@ -923,7 +966,31 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Example 2.10: generate a default list for the rest of the tutorial\n",
"#### Example 2.10: `path_list`\n",
"Add a specific list of variable paths."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"region_a.order_vars.remove(all=True)\n",
"path_list = ['profile_2/high_rate/beam_elevation',\n",
" 'profile_2/high_rate/solar_elevation',\n",
" 'profile_2/high_rate/surface_conf',\n",
" 'profile_2/high_rate/surface_height'\n",
" ]\n",
"region_a.order_vars.append(path_list=path_list)\n",
"pprint(region_a.order_vars.wanted)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Example 2.11: generate a default list for the rest of the tutorial\n",
"Generate a reasonable variable list prior to download"
]
},
Expand Down Expand Up @@ -1063,9 +1130,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "icepyx-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "icepyx-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1077,7 +1144,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/documentation/classes_dev_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading