Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Jun 8, 2021
1 parent f18ea57 commit 70c04bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
9 changes: 1 addition & 8 deletions docs/pyremo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Subpackages
.. toctree::

pyremo.physics
pyremo.prsint
pyremo.tables

Submodules
Expand Down Expand Up @@ -92,14 +93,6 @@ pyremo.ftp module
:undoc-members:
:show-inheritance:

pyremo.pyremo module
--------------------

.. automodule:: pyremo.pyremo
:members:
:undoc-members:
:show-inheritance:

pyremo.remo\_ds module
----------------------

Expand Down
33 changes: 11 additions & 22 deletions notebooks/prsint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"cells": [
{
"cell_type": "markdown",
"id": "elementary-argument",
"id": "transparent-adolescent",
"metadata": {},
"source": [
"# Pressure interpolation"
]
},
{
"cell_type": "markdown",
"id": "neutral-promise",
"id": "particular-nancy",
"metadata": {},
"source": [
"The pressure interpolation is included in pyremo. Historically, REMO has its own interpolator although theoretically the algorithm is similar to what can be found, e.g., in [metpy](https://unidata.github.io/MetPy/latest/examples/sigma_to_pressure_interpolation.html) or [GeoCAT](https://geocat-comp.readthedocs.io/en/latest/user_api/generated/geocat.comp.interp_hybrid_to_pressure.html#geocat.comp.interp_hybrid_to_pressure). However, REMO's algorithm includes a vertical spline fitting and requires temperature, pressure and orography as input. pyremo provides an API based on xarray and also a command line tool that is similar to the former fortran executable. We show an example of how to use the pyremo API here since it gives more control about input and output formats."
]
},
{
"cell_type": "markdown",
"id": "racial-folder",
"id": "approved-australian",
"metadata": {},
"source": [
"Let's load an example dataset:"
Expand All @@ -27,7 +27,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "straight-rogers",
"id": "parental-range",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -634,32 +634,21 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "premier-excuse",
"cell_type": "markdown",
"id": "environmental-activation",
"metadata": {},
"outputs": [],
"source": [
"The dataset contains a number of 3D variables on model levels (hybrid sigma) that can be interpolated to pressure levels. We will use the temperature here."
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "labeled-ridge",
"metadata": {},
"outputs": [],
"source": [
"from pyremo.prsint import pressure_interpolation"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "regulated-memory",
"execution_count": 30,
"id": "phantom-event",
"metadata": {},
"outputs": [],
"source": [
"from pyremo.prsint import pressure_interpolation\n",
"# define pressure levels in hPa\n",
"plev = [100,200,500,850,950]\n",
"t_plev = pressure_interpolation(ds.T, plev=[200, 400, 500, 800, 950], \n",
Expand All @@ -668,7 +657,7 @@
},
{
"cell_type": "markdown",
"id": "closed-estonia",
"id": "exterior-footwear",
"metadata": {},
"source": [
"The output dataset `t_plev` has the same structure and meta information as the input dataset. The algorithm utilizes xarray's [apply_ufunc](https://xarray.pydata.org/en/stable/examples/apply_ufunc_vectorize_1d.html) implementation which is particularly useful if the input dataset has a temporal dimension. The pressure interpolation will then also work with dask's vectorization for distributed computing."
Expand All @@ -677,7 +666,7 @@
{
"cell_type": "code",
"execution_count": 29,
"id": "prepared-paradise",
"id": "involved-bermuda",
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit 70c04bb

Please sign in to comment.