Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Improve tutorials by adding basic analysis functions #382

Merged
merged 1 commit into from
Aug 9, 2023
Merged
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
23 changes: 22 additions & 1 deletion docs/source/tutorials/1_Introduction-to-the-API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,25 @@
"ts = OpenPMDTimeSeries('./example-2d/hdf5/')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Extracting iterations and time values\n",
"\n",
"One can extract all available iterations and corresponding time values from the time series into a numpy array object by doing"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"it = ts.iterations\n",
"time = ts.t"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand All @@ -103,6 +122,8 @@
"\n",
"### Accessing the field data\n",
"\n",
"The list of available fields is accessible through `ts.avail_fields`.\n",
"\n",
"The fields can be read with the method `get_field`. \n",
"\n",
"The user can either require a time (in seconds) or an iteration (an integer). When giving a time, it is not needed to provide the exact time of an available iteration, as the time of the closest available value will be used instead."
Expand All @@ -127,7 +148,7 @@
"source": [
"The method `get_field` returns two quantities:\n",
"- A 2D array containing the values of the requested field.\n",
"- A object containing metainformation about the extent of the grid.\n",
"- An object containing metainformation about the extent of the grid (e.g `info_rho.z` and `info_rho.x` respectively return an array of the z and x positions).\n",
"\n",
"These two objects can then be used in a Python environnement to perform numerical analysis."
]
Expand Down
Loading