diff --git a/src/cli/particle_extract.ipynb b/src/cli/particle_extract.ipynb new file mode 100644 index 0000000000..c9933cc193 --- /dev/null +++ b/src/cli/particle_extract.ipynb @@ -0,0 +1,1442 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "a2fce232-c7da-4666-a634-db934934696d", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import openpmd_api as io\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fb913a51-e436-44ab-ab9d-9a2a1e9860af", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "input_series = io.Series(\"/home/axel/src/openPMD/openPMD-example-datasets/example-3d/hdf5/data%T.h5\", io.Access.read_only)\n", + "input_series.backend" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fab061d9-675d-4fd9-ad97-87304e008a8b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "!rm -rf particle_extract.*" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9320f003-5683-4527-b110-b684996e3e89", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "output_series = io.Series(\"particle_extract.bp\", io.Access.create)\n", + "output_series.backend" + ] + }, + { + "cell_type": "markdown", + "id": "d25d3dba-5478-4d10-aac3-f14054bfa0bd", + "metadata": { + "tags": [] + }, + "source": [ + "## Filter Particles" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d9397148-84df-48ff-a0b2-c4c310d647b0", + "metadata": {}, + "outputs": [], + "source": [ + "# species record: filter\n", + "def filter_species(in_p, in_slice):\n", + " \"\"\"\n", + " example: filter by z position\n", + " \"\"\"\n", + " # prepare reading of records of the current slice\n", + " # note: you can read more than one record to use for filtering\n", + " filter_data = in_p[\"position\"][\"z\"][in_slice]\n", + "\n", + " # trigger read operations\n", + " in_p.series_flush()\n", + "\n", + " # create & return binary filter array for the current slice\n", + " # example here: simple position threshold filter\n", + " # note: you can also calculate temporary arrays here and filter from those\n", + " return filter_data > 3.5e-05" + ] + }, + { + "cell_type": "markdown", + "id": "13681260-2fa2-469c-889d-bf55cb07d04a", + "metadata": { + "tags": [] + }, + "source": [ + "## Copy Particles" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7dc86882-ec8a-4a2f-8bfc-e3dcd0f56b95", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# avoid running out-of-memory: maximum number of particles to copy at once\n", + "slice_size = 250_000_000 # 250 million particles at a time" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f82f6170-c826-45e3-ae4c-321554613386", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Iteration: 100\n", + " Particle species 'electrons'\n", + " Number of particles: 85625\n", + " number of passes: 1\n", + " charge\n", + " \u000b", + "Scalar [85625]->[0:85625]\n", + " mass\n", + " \u000b", + "Scalar [85625]->[0:85625]\n", + " momentum\n", + " x [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " position\n", + " x [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " positionOffset\n", + " x [85625]->[0:85625]\n", + " y [85625]->[0:85625]\n", + " z [85625]->[0:85625]\n", + " weighting\n", + " \u000b", + "Scalar [85625]->[0:85625]\n", + " out_slice=slice(0, 0, None), 0\n", + " Filter results for this iteration and species are empty!\n", + "Iteration: 200\n", + " Particle species 'electrons'\n", + " Number of particles: 147500\n", + " number of passes: 1\n", + " charge\n", + " \u000b", + "Scalar [147500]->[0:147500]\n", + " mass\n", + " \u000b", + "Scalar [147500]->[0:147500]\n", + " momentum\n", + " x [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " position\n", + " x [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " positionOffset\n", + " x [147500]->[0:147500]\n", + " y [147500]->[0:147500]\n", + " z [147500]->[0:147500]\n", + " weighting\n", + " \u000b", + "Scalar [147500]->[0:147500]\n", + " out_slice=slice(0, 0, None), 0\n", + " Filter results for this iteration and species are empty!\n", + "Iteration: 300\n", + " Particle species 'electrons'\n", + " Number of particles: 208750\n", + " number of passes: 1\n", + " charge\n", + " \u000b", + "Scalar [208750]->[0:208750]\n", + " mass\n", + " \u000b", + "Scalar [208750]->[0:208750]\n", + " momentum\n", + " x [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " position\n", + " x [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " y [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " z [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " positionOffset\n", + " x [208750]->[0:208750]\n", + " y [208750]->[0:208750]\n", + " z [208750]->[0:208750]\n", + " weighting\n", + " \u000b", + "Scalar [208750]->[0:208750]\n", + " out_slice=slice(0, 0, None), 0\n", + " Filter results for this iteration and species are empty!\n", + "Iteration: 400\n", + " Particle species 'electrons'\n", + " Number of particles: 270625\n", + " number of passes: 1\n", + " charge\n", + " \u000b", + "Scalar [270625]->[0:270625]\n", + " mass\n", + " \u000b", + "Scalar [270625]->[0:270625]\n", + " momentum\n", + " x [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " y [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " z [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " position\n", + " x [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " y [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " z [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + " positionOffset\n", + " x [270625]->[0:270625]\n", + " y [270625]->[0:270625]\n", + " z [270625]->[0:270625]\n", + " weighting\n", + " \u000b", + "Scalar [270625]->[0:270625]\n", + " out_slice=slice(0, 58125, None), 0\n", + "Iteration: 500\n", + " Particle species 'electrons'\n", + " Number of particles: 331875\n", + " number of passes: 1\n", + " charge\n", + " \u000b", + "Scalar [331875]->[0:331875]\n", + " mass\n", + " \u000b", + "Scalar [331875]->[0:331875]\n", + " momentum\n", + " x [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " y [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " z [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " position\n", + " x [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " y [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " z [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n", + " positionOffset\n", + " x [331875]->[0:331875]\n", + " y [331875]->[0:331875]\n", + " z [331875]->[0:331875]\n", + " weighting\n", + " \u000b", + "Scalar [331875]->[0:331875]\n", + " out_slice=slice(0, 119391, None), 0\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "\n", + "for k_it, in_it in input_series.iterations.items():\n", + " print(f\"Iteration: {k_it}\")\n", + " out_it = output_series.iterations[k_it]\n", + "\n", + " # particle species\n", + " for k_p, in_p in in_it.particles.items():\n", + " print(f\" Particle species '{k_p}'\")\n", + " out_p = out_it.particles[k_p]\n", + "\n", + " num_particles = in_p[\"momentum\"][\"x\"].shape[0]\n", + " print(f\" Number of particles: {num_particles}\")\n", + "\n", + " N_pass = int(np.ceil(num_particles/slice_size))\n", + " print(f\" number of passes: {N_pass}\")\n", + " \n", + " # bookkeeping in the global output arrays of the species\n", + " out_slice_start = 0\n", + " out_slice_end = 0\n", + "\n", + " # stepping through particle in slices\n", + " for slice_start in range(0, num_particles, slice_size):\n", + " slice_end = slice_start + slice_size\n", + " if slice_end > num_particles:\n", + " slice_end = num_particles\n", + " #print(' {:,} {:,}'.format(slice_start, slice_end))\n", + " in_slice = np.s_[slice_start:slice_end]\n", + " \n", + " # species record: filter\n", + " accepted = filter_species(in_p, in_slice)\n", + " out_slice_end = out_slice_start + np.sum(accepted)\n", + " \n", + " # species records\n", + " for k_p_r, in_p_r in in_p.items():\n", + " print(f\" {k_p_r}\")\n", + " out_p_r = out_p[k_p_r]\n", + " \n", + " # species record components: data\n", + " for k_p_rc, in_p_rc in in_p_r.items():\n", + " print(f\" {k_p_rc} {in_p_rc.shape}->[{slice_start}:{slice_end}]\")\n", + " out_p_rc = out_p_r[k_p_rc]\n", + "\n", + " # copy data\n", + " if in_p_rc.empty:\n", + " if not out_p_rc.empty:\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, in_p_rc.shape))\n", + " out_p_rc.make_empty(1)\n", + " elif in_p_rc.constant:\n", + " if not out_p_rc.constant:\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, in_p_rc.shape))\n", + " out_p_rc.make_constant(in_p_rc.get_attribute(\"value\"))\n", + " else:\n", + " data = in_p_rc[in_slice]\n", + " input_series.flush()\n", + "\n", + " # write accepted particles back\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, (out_slice_end,), '{ \"resizable\": true }')) \n", + " out_slice = np.s_[out_slice_start:out_slice_end]\n", + " print(f\" out_slice={out_slice}, {out_slice_start}\")\n", + " if out_slice_end != out_slice_start:\n", + " out_p_rc[out_slice] = data[accepted]\n", + " output_series.flush()\n", + "\n", + " out_slice_start = out_slice_end\n", + " # next species record\n", + " \n", + " # filter results are empty?\n", + " if out_slice_start == 0:\n", + " print(\" Filter results for this iteration and species are empty!\")\n", + " for k_p_r, in_p_r in in_p.items():\n", + " out_p_r = out_p[k_p_r]\n", + " for k_p_rc, in_p_rc in in_p_r.items():\n", + " out_p_rc = out_p_r[k_p_rc]\n", + "\n", + " if not out_p_rc.empty:\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, (0,)))\n", + " # out_p_rc.make_empty(dtype, 1) # done by reset_datatype w/ zero shape already\n", + "\n", + " # next particle species\n", + " # next iteration\n", + "\n", + "output_series.flush()" + ] + }, + { + "cell_type": "markdown", + "id": "8a869600-1b00-4dcb-a105-bd62bbfc9487", + "metadata": { + "tags": [] + }, + "source": [ + "## Copy Attributes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "998d114f-47dc-48cd-a407-e7272a28b5e4", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "100\n", + " dt\n", + " time\n", + " timeUnitSI\n", + "electrons\n", + " currentDeposition\n", + " particleInterpolation\n", + " particlePush\n", + " particleShape\n", + " particleSmoothing\n", + "electrons charge\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons momentum\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons position\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons positionOffset\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " shape\n", + " unitSI\n", + " value\n", + " y\n", + " shape\n", + " unitSI\n", + " value\n", + " z\n", + " shape\n", + " unitSI\n", + " value\n", + "electrons weighting\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + "200\n", + " dt\n", + " time\n", + " timeUnitSI\n", + "electrons\n", + " currentDeposition\n", + " particleInterpolation\n", + " particlePush\n", + " particleShape\n", + " particleSmoothing\n", + "electrons charge\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons momentum\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons position\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons positionOffset\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " shape\n", + " unitSI\n", + " value\n", + " y\n", + " shape\n", + " unitSI\n", + " value\n", + " z\n", + " shape\n", + " unitSI\n", + " value\n", + "electrons weighting\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + "300\n", + " dt\n", + " time\n", + " timeUnitSI\n", + "electrons\n", + " currentDeposition\n", + " particleInterpolation\n", + " particlePush\n", + " particleShape\n", + " particleSmoothing\n", + "electrons charge\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons momentum\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons position\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons positionOffset\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " shape\n", + " unitSI\n", + " value\n", + " y\n", + " shape\n", + " unitSI\n", + " value\n", + " z\n", + " shape\n", + " unitSI\n", + " value\n", + "electrons weighting\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + "400\n", + " dt\n", + " time\n", + " timeUnitSI\n", + "electrons\n", + " currentDeposition\n", + " particleInterpolation\n", + " particlePush\n", + " particleShape\n", + " particleSmoothing\n", + "electrons charge\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons momentum\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons position\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons positionOffset\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " shape\n", + " unitSI\n", + " value\n", + " y\n", + " shape\n", + " unitSI\n", + " value\n", + " z\n", + " shape\n", + " unitSI\n", + " value\n", + "electrons weighting\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + "500\n", + " dt\n", + " time\n", + " timeUnitSI\n", + "electrons\n", + " currentDeposition\n", + " particleInterpolation\n", + " particlePush\n", + " particleShape\n", + " particleSmoothing\n", + "electrons charge\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " weightingPower\n", + "electrons momentum\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons position\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " unitSI\n", + " y\n", + " unitSI\n", + " z\n", + " unitSI\n", + "electrons positionOffset\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " weightingPower\n", + " x\n", + " shape\n", + " unitSI\n", + " value\n", + " y\n", + " shape\n", + " unitSI\n", + " value\n", + " z\n", + " shape\n", + " unitSI\n", + " value\n", + "electrons weighting\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " weightingPower\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "\n", + "# series attributes\n", + "for a in input_series.attributes:\n", + " output_series.set_attribute(a, input_series.get_attribute(a))\n", + "\n", + "# iteration attributes\n", + "for k_it, in_it in input_series.iterations.items():\n", + " print(k_it)\n", + " out_it = output_series.iterations[k_it]\n", + " for a in in_it.attributes:\n", + " print(f\" {a}\")\n", + " out_it.set_attribute(a, in_it.get_attribute(a))\n", + "\n", + " # species attributes\n", + " for k_p, in_p in in_it.particles.items():\n", + " print(k_p)\n", + " out_p = out_it.particles[k_p]\n", + " for a in in_p.attributes:\n", + " print(f\" {a}\")\n", + " out_p.set_attribute(a, in_p.get_attribute(a))\n", + " \n", + " # species record attributes\n", + " for k_p_r, in_p_r in in_p.items():\n", + " print(k_p, k_p_r)\n", + " out_p_r = out_p[k_p_r]\n", + " for a in in_p_r.attributes:\n", + " print(f\" {a}\")\n", + " out_p_r.set_attribute(a, in_p_r.get_attribute(a))\n", + " \n", + " # species record component attributes\n", + " for k_p_rc, in_p_rc in in_p_r.items():\n", + " print(f\" {k_p_rc}\")\n", + " out_p_rc = out_p_r[k_p_rc]\n", + " for a in in_p_rc.attributes:\n", + " print(f\" {a}\")\n", + " out_p_rc.set_attribute(a, in_p_rc.get_attribute(a))\n", + "\n", + "output_series.flush()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5d46de8d-25f1-4150-9a52-e69a83054860", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "openPMD series: data%T\n", + "openPMD standard: 1.1.0\n", + "openPMD extensions: 1\n", + "\n", + "data author: unknown\n", + "data created: 2018-02-06 09:40:21 -0800\n", + "data backend: HDF5\n", + "generating machine: unknown\n", + "generating software: warp (version: 4)\n", + "generating software dependencies: unknown\n", + "\n", + "number of iterations: 5 (fileBased)\n", + " all iterations: 100 200 300 400 500 \n", + "\n", + "number of meshes: 2\n", + " all meshes:\n", + " E\n", + " rho\n", + "\n", + "number of particle species: 1\n", + " all particle species:\n", + " electrons\n", + "\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "io.list_series(input_series, longer=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5002b0d1-c480-4625-a63d-009878e43794", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "openPMD series: particle_extract\n", + "openPMD standard: 1.1.0\n", + "openPMD extensions: 1\n", + "\n", + "data author: unknown\n", + "data created: 2018-02-06 09:40:21 -0800\n", + "data backend: ADIOS2\n", + "generating machine: unknown\n", + "generating software: warp (version: 4)\n", + "generating software dependencies: unknown\n", + "\n", + "number of iterations: 5 (groupBased)\n", + " all iterations: 100 200 300 400 500 \n", + "\n", + "number of meshes: 0\n", + "\n", + "number of particle species: 1\n", + " all particle species:\n", + " electrons\n", + "\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "io.list_series(output_series, longer=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "af2f6e29-0b5a-406e-854a-f7ff1d77d9f6", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "del input_series\n", + "del output_series" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1fd36fe4-bba0-4e88-9c56-0680b3ee610b", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File info:\n", + " of variables: 14\n", + " of attributes: 329\n", + "\n", + " double /data/400/particles/electrons/momentum/x {58125}\n", + " double /data/400/particles/electrons/momentum/y {58125}\n", + " double /data/400/particles/electrons/momentum/z {58125}\n", + " double /data/400/particles/electrons/position/x {58125}\n", + " double /data/400/particles/electrons/position/y {58125}\n", + " double /data/400/particles/electrons/position/z {58125}\n", + " double /data/400/particles/electrons/weighting {58125}\n", + " double /data/500/particles/electrons/momentum/x {119391}\n", + " double /data/500/particles/electrons/momentum/y {119391}\n", + " double /data/500/particles/electrons/momentum/z {119391}\n", + " double /data/500/particles/electrons/position/x {119391}\n", + " double /data/500/particles/electrons/position/y {119391}\n", + " double /data/500/particles/electrons/position/z {119391}\n", + " double /data/500/particles/electrons/weighting {119391}\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "!bpls -v particle_extract.bp" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e1a9ca83-807e-419c-90a2-87b7cdadf9fe", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " string /basePath attr = \"/data/%T/\"\n", + " uint8_t /data/100/closed attr = 1\n", + " double /data/100/dt attr = 3.28471e-16\n", + " uint8_t /data/100/particles/electrons/charge/macroWeighted attr = 0\n", + " int64_t /data/100/particles/electrons/charge/shape attr = 85625\n", + " double /data/100/particles/electrons/charge/timeOffset attr = 0\n", + " double /data/100/particles/electrons/charge/unitDimension attr = {0, 0, 1, 1, 0, 0, 0}\n", + " double /data/100/particles/electrons/charge/unitSI attr = 1\n", + " double /data/100/particles/electrons/charge/value attr = -1.60218e-19\n", + " double /data/100/particles/electrons/charge/weightingPower attr = 1\n", + " string /data/100/particles/electrons/currentDeposition attr = \"Esirkepov\"\n", + " uint8_t /data/100/particles/electrons/mass/macroWeighted attr = 0\n", + " int64_t /data/100/particles/electrons/mass/shape attr = 85625\n", + " double /data/100/particles/electrons/mass/timeOffset attr = 0\n", + " double /data/100/particles/electrons/mass/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/100/particles/electrons/mass/unitSI attr = 1\n", + " double /data/100/particles/electrons/mass/value attr = 9.10938e-31\n", + " double /data/100/particles/electrons/mass/weightingPower attr = 1\n", + " uint8_t /data/100/particles/electrons/momentum/macroWeighted attr = 0\n", + " double /data/100/particles/electrons/momentum/timeOffset attr = 0\n", + " double /data/100/particles/electrons/momentum/unitDimension attr = {1, 1, -1, 0, 0, 0, 0}\n", + " double /data/100/particles/electrons/momentum/weightingPower attr = 1\n", + " uint64_t /data/100/particles/electrons/momentum/x/shape attr = 0\n", + " double /data/100/particles/electrons/momentum/x/unitSI attr = 1\n", + " double /data/100/particles/electrons/momentum/x/value attr = 0\n", + " uint64_t /data/100/particles/electrons/momentum/y/shape attr = 0\n", + " double /data/100/particles/electrons/momentum/y/unitSI attr = 1\n", + " double /data/100/particles/electrons/momentum/y/value attr = 0\n", + " uint64_t /data/100/particles/electrons/momentum/z/shape attr = 0\n", + " double /data/100/particles/electrons/momentum/z/unitSI attr = 1\n", + " double /data/100/particles/electrons/momentum/z/value attr = 0\n", + " string /data/100/particles/electrons/particleInterpolation attr = \"momentumConserving\"\n", + " string /data/100/particles/electrons/particlePush attr = \"Vay\"\n", + " double /data/100/particles/electrons/particleShape attr = 3\n", + " string /data/100/particles/electrons/particleSmoothing attr = \"none\"\n", + " uint8_t /data/100/particles/electrons/position/macroWeighted attr = 0\n", + " double /data/100/particles/electrons/position/timeOffset attr = 0\n", + " double /data/100/particles/electrons/position/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/100/particles/electrons/position/weightingPower attr = 0\n", + " uint64_t /data/100/particles/electrons/position/x/shape attr = 0\n", + " double /data/100/particles/electrons/position/x/unitSI attr = 1\n", + " double /data/100/particles/electrons/position/x/value attr = 0\n", + " uint64_t /data/100/particles/electrons/position/y/shape attr = 0\n", + " double /data/100/particles/electrons/position/y/unitSI attr = 1\n", + " double /data/100/particles/electrons/position/y/value attr = 0\n", + " uint64_t /data/100/particles/electrons/position/z/shape attr = 0\n", + " double /data/100/particles/electrons/position/z/unitSI attr = 1\n", + " double /data/100/particles/electrons/position/z/value attr = 0\n", + " uint8_t /data/100/particles/electrons/positionOffset/macroWeighted attr = 0\n", + " double /data/100/particles/electrons/positionOffset/timeOffset attr = 0\n", + " double /data/100/particles/electrons/positionOffset/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/100/particles/electrons/positionOffset/weightingPower attr = 0\n", + " int64_t /data/100/particles/electrons/positionOffset/x/shape attr = 85625\n", + " double /data/100/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/100/particles/electrons/positionOffset/x/value attr = 0\n", + " int64_t /data/100/particles/electrons/positionOffset/y/shape attr = 85625\n", + " double /data/100/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/100/particles/electrons/positionOffset/y/value attr = 0\n", + " int64_t /data/100/particles/electrons/positionOffset/z/shape attr = 85625\n", + " double /data/100/particles/electrons/positionOffset/z/unitSI attr = 1\n", + " double /data/100/particles/electrons/positionOffset/z/value attr = 0\n", + " uint8_t /data/100/particles/electrons/weighting/macroWeighted attr = 1\n", + " uint64_t /data/100/particles/electrons/weighting/shape attr = 0\n", + " double /data/100/particles/electrons/weighting/timeOffset attr = 0\n", + " double /data/100/particles/electrons/weighting/unitDimension attr = {0, 0, 0, 0, 0, 0, 0}\n", + " double /data/100/particles/electrons/weighting/unitSI attr = 1\n", + " double /data/100/particles/electrons/weighting/value attr = 0\n", + " double /data/100/particles/electrons/weighting/weightingPower attr = 1\n", + " double /data/100/time attr = 3.28471e-14\n", + " double /data/100/timeUnitSI attr = 1\n", + " uint8_t /data/200/closed attr = 1\n", + " double /data/200/dt attr = 3.28471e-16\n", + " uint8_t /data/200/particles/electrons/charge/macroWeighted attr = 0\n", + " int64_t /data/200/particles/electrons/charge/shape attr = 147500\n", + " double /data/200/particles/electrons/charge/timeOffset attr = 0\n", + " double /data/200/particles/electrons/charge/unitDimension attr = {0, 0, 1, 1, 0, 0, 0}\n", + " double /data/200/particles/electrons/charge/unitSI attr = 1\n", + " double /data/200/particles/electrons/charge/value attr = -1.60218e-19\n", + " double /data/200/particles/electrons/charge/weightingPower attr = 1\n", + " string /data/200/particles/electrons/currentDeposition attr = \"Esirkepov\"\n", + " uint8_t /data/200/particles/electrons/mass/macroWeighted attr = 0\n", + " int64_t /data/200/particles/electrons/mass/shape attr = 147500\n", + " double /data/200/particles/electrons/mass/timeOffset attr = 0\n", + " double /data/200/particles/electrons/mass/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/200/particles/electrons/mass/unitSI attr = 1\n", + " double /data/200/particles/electrons/mass/value attr = 9.10938e-31\n", + " double /data/200/particles/electrons/mass/weightingPower attr = 1\n", + " uint8_t /data/200/particles/electrons/momentum/macroWeighted attr = 0\n", + " double /data/200/particles/electrons/momentum/timeOffset attr = 0\n", + " double /data/200/particles/electrons/momentum/unitDimension attr = {1, 1, -1, 0, 0, 0, 0}\n", + " double /data/200/particles/electrons/momentum/weightingPower attr = 1\n", + " uint64_t /data/200/particles/electrons/momentum/x/shape attr = 0\n", + " double /data/200/particles/electrons/momentum/x/unitSI attr = 1\n", + " double /data/200/particles/electrons/momentum/x/value attr = 0\n", + " uint64_t /data/200/particles/electrons/momentum/y/shape attr = 0\n", + " double /data/200/particles/electrons/momentum/y/unitSI attr = 1\n", + " double /data/200/particles/electrons/momentum/y/value attr = 0\n", + " uint64_t /data/200/particles/electrons/momentum/z/shape attr = 0\n", + " double /data/200/particles/electrons/momentum/z/unitSI attr = 1\n", + " double /data/200/particles/electrons/momentum/z/value attr = 0\n", + " string /data/200/particles/electrons/particleInterpolation attr = \"momentumConserving\"\n", + " string /data/200/particles/electrons/particlePush attr = \"Vay\"\n", + " double /data/200/particles/electrons/particleShape attr = 3\n", + " string /data/200/particles/electrons/particleSmoothing attr = \"none\"\n", + " uint8_t /data/200/particles/electrons/position/macroWeighted attr = 0\n", + " double /data/200/particles/electrons/position/timeOffset attr = 0\n", + " double /data/200/particles/electrons/position/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/200/particles/electrons/position/weightingPower attr = 0\n", + " uint64_t /data/200/particles/electrons/position/x/shape attr = 0\n", + " double /data/200/particles/electrons/position/x/unitSI attr = 1\n", + " double /data/200/particles/electrons/position/x/value attr = 0\n", + " uint64_t /data/200/particles/electrons/position/y/shape attr = 0\n", + " double /data/200/particles/electrons/position/y/unitSI attr = 1\n", + " double /data/200/particles/electrons/position/y/value attr = 0\n", + " uint64_t /data/200/particles/electrons/position/z/shape attr = 0\n", + " double /data/200/particles/electrons/position/z/unitSI attr = 1\n", + " double /data/200/particles/electrons/position/z/value attr = 0\n", + " uint8_t /data/200/particles/electrons/positionOffset/macroWeighted attr = 0\n", + " double /data/200/particles/electrons/positionOffset/timeOffset attr = 0\n", + " double /data/200/particles/electrons/positionOffset/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/200/particles/electrons/positionOffset/weightingPower attr = 0\n", + " int64_t /data/200/particles/electrons/positionOffset/x/shape attr = 147500\n", + " double /data/200/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/200/particles/electrons/positionOffset/x/value attr = 0\n", + " int64_t /data/200/particles/electrons/positionOffset/y/shape attr = 147500\n", + " double /data/200/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/200/particles/electrons/positionOffset/y/value attr = 0\n", + " int64_t /data/200/particles/electrons/positionOffset/z/shape attr = 147500\n", + " double /data/200/particles/electrons/positionOffset/z/unitSI attr = 1\n", + " double /data/200/particles/electrons/positionOffset/z/value attr = 0\n", + " uint8_t /data/200/particles/electrons/weighting/macroWeighted attr = 1\n", + " uint64_t /data/200/particles/electrons/weighting/shape attr = 0\n", + " double /data/200/particles/electrons/weighting/timeOffset attr = 0\n", + " double /data/200/particles/electrons/weighting/unitDimension attr = {0, 0, 0, 0, 0, 0, 0}\n", + " double /data/200/particles/electrons/weighting/unitSI attr = 1\n", + " double /data/200/particles/electrons/weighting/value attr = 0\n", + " double /data/200/particles/electrons/weighting/weightingPower attr = 1\n", + " double /data/200/time attr = 6.56942e-14\n", + " double /data/200/timeUnitSI attr = 1\n", + " uint8_t /data/300/closed attr = 1\n", + " double /data/300/dt attr = 3.28471e-16\n", + " uint8_t /data/300/particles/electrons/charge/macroWeighted attr = 0\n", + " int64_t /data/300/particles/electrons/charge/shape attr = 208750\n", + " double /data/300/particles/electrons/charge/timeOffset attr = 0\n", + " double /data/300/particles/electrons/charge/unitDimension attr = {0, 0, 1, 1, 0, 0, 0}\n", + " double /data/300/particles/electrons/charge/unitSI attr = 1\n", + " double /data/300/particles/electrons/charge/value attr = -1.60218e-19\n", + " double /data/300/particles/electrons/charge/weightingPower attr = 1\n", + " string /data/300/particles/electrons/currentDeposition attr = \"Esirkepov\"\n", + " uint8_t /data/300/particles/electrons/mass/macroWeighted attr = 0\n", + " int64_t /data/300/particles/electrons/mass/shape attr = 208750\n", + " double /data/300/particles/electrons/mass/timeOffset attr = 0\n", + " double /data/300/particles/electrons/mass/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/300/particles/electrons/mass/unitSI attr = 1\n", + " double /data/300/particles/electrons/mass/value attr = 9.10938e-31\n", + " double /data/300/particles/electrons/mass/weightingPower attr = 1\n", + " uint8_t /data/300/particles/electrons/momentum/macroWeighted attr = 0\n", + " double /data/300/particles/electrons/momentum/timeOffset attr = 0\n", + " double /data/300/particles/electrons/momentum/unitDimension attr = {1, 1, -1, 0, 0, 0, 0}\n", + " double /data/300/particles/electrons/momentum/weightingPower attr = 1\n", + " uint64_t /data/300/particles/electrons/momentum/x/shape attr = 0\n", + " double /data/300/particles/electrons/momentum/x/unitSI attr = 1\n", + " double /data/300/particles/electrons/momentum/x/value attr = 0\n", + " uint64_t /data/300/particles/electrons/momentum/y/shape attr = 0\n", + " double /data/300/particles/electrons/momentum/y/unitSI attr = 1\n", + " double /data/300/particles/electrons/momentum/y/value attr = 0\n", + " uint64_t /data/300/particles/electrons/momentum/z/shape attr = 0\n", + " double /data/300/particles/electrons/momentum/z/unitSI attr = 1\n", + " double /data/300/particles/electrons/momentum/z/value attr = 0\n", + " string /data/300/particles/electrons/particleInterpolation attr = \"momentumConserving\"\n", + " string /data/300/particles/electrons/particlePush attr = \"Vay\"\n", + " double /data/300/particles/electrons/particleShape attr = 3\n", + " string /data/300/particles/electrons/particleSmoothing attr = \"none\"\n", + " uint8_t /data/300/particles/electrons/position/macroWeighted attr = 0\n", + " double /data/300/particles/electrons/position/timeOffset attr = 0\n", + " double /data/300/particles/electrons/position/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/300/particles/electrons/position/weightingPower attr = 0\n", + " uint64_t /data/300/particles/electrons/position/x/shape attr = 0\n", + " double /data/300/particles/electrons/position/x/unitSI attr = 1\n", + " double /data/300/particles/electrons/position/x/value attr = 0\n", + " uint64_t /data/300/particles/electrons/position/y/shape attr = 0\n", + " double /data/300/particles/electrons/position/y/unitSI attr = 1\n", + " double /data/300/particles/electrons/position/y/value attr = 0\n", + " uint64_t /data/300/particles/electrons/position/z/shape attr = 0\n", + " double /data/300/particles/electrons/position/z/unitSI attr = 1\n", + " double /data/300/particles/electrons/position/z/value attr = 0\n", + " uint8_t /data/300/particles/electrons/positionOffset/macroWeighted attr = 0\n", + " double /data/300/particles/electrons/positionOffset/timeOffset attr = 0\n", + " double /data/300/particles/electrons/positionOffset/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/300/particles/electrons/positionOffset/weightingPower attr = 0\n", + " int64_t /data/300/particles/electrons/positionOffset/x/shape attr = 208750\n", + " double /data/300/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/300/particles/electrons/positionOffset/x/value attr = 0\n", + " int64_t /data/300/particles/electrons/positionOffset/y/shape attr = 208750\n", + " double /data/300/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/300/particles/electrons/positionOffset/y/value attr = 0\n", + " int64_t /data/300/particles/electrons/positionOffset/z/shape attr = 208750\n", + " double /data/300/particles/electrons/positionOffset/z/unitSI attr = 1\n", + " double /data/300/particles/electrons/positionOffset/z/value attr = 0\n", + " uint8_t /data/300/particles/electrons/weighting/macroWeighted attr = 1\n", + " uint64_t /data/300/particles/electrons/weighting/shape attr = 0\n", + " double /data/300/particles/electrons/weighting/timeOffset attr = 0\n", + " double /data/300/particles/electrons/weighting/unitDimension attr = {0, 0, 0, 0, 0, 0, 0}\n", + " double /data/300/particles/electrons/weighting/unitSI attr = 1\n", + " double /data/300/particles/electrons/weighting/value attr = 0\n", + " double /data/300/particles/electrons/weighting/weightingPower attr = 1\n", + " double /data/300/time attr = 9.85414e-14\n", + " double /data/300/timeUnitSI attr = 1\n", + " uint8_t /data/400/closed attr = 1\n", + " double /data/400/dt attr = 3.28471e-16\n", + " uint8_t /data/400/particles/electrons/charge/macroWeighted attr = 0\n", + " int64_t /data/400/particles/electrons/charge/shape attr = 270625\n", + " double /data/400/particles/electrons/charge/timeOffset attr = 0\n", + " double /data/400/particles/electrons/charge/unitDimension attr = {0, 0, 1, 1, 0, 0, 0}\n", + " double /data/400/particles/electrons/charge/unitSI attr = 1\n", + " double /data/400/particles/electrons/charge/value attr = -1.60218e-19\n", + " double /data/400/particles/electrons/charge/weightingPower attr = 1\n", + " string /data/400/particles/electrons/currentDeposition attr = \"Esirkepov\"\n", + " uint8_t /data/400/particles/electrons/mass/macroWeighted attr = 0\n", + " int64_t /data/400/particles/electrons/mass/shape attr = 270625\n", + " double /data/400/particles/electrons/mass/timeOffset attr = 0\n", + " double /data/400/particles/electrons/mass/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/400/particles/electrons/mass/unitSI attr = 1\n", + " double /data/400/particles/electrons/mass/value attr = 9.10938e-31\n", + " double /data/400/particles/electrons/mass/weightingPower attr = 1\n", + " uint8_t /data/400/particles/electrons/momentum/macroWeighted attr = 0\n", + " double /data/400/particles/electrons/momentum/timeOffset attr = 0\n", + " double /data/400/particles/electrons/momentum/unitDimension attr = {1, 1, -1, 0, 0, 0, 0}\n", + " double /data/400/particles/electrons/momentum/weightingPower attr = 1\n", + " double /data/400/particles/electrons/momentum/x {58125} = 0 / 0\n", + " double /data/400/particles/electrons/momentum/x/unitSI attr = 1\n", + " double /data/400/particles/electrons/momentum/y {58125} = 0 / 0\n", + " double /data/400/particles/electrons/momentum/y/unitSI attr = 1\n", + " double /data/400/particles/electrons/momentum/z {58125} = 0 / 0\n", + " double /data/400/particles/electrons/momentum/z/unitSI attr = 1\n", + " string /data/400/particles/electrons/particleInterpolation attr = \"momentumConserving\"\n", + " string /data/400/particles/electrons/particlePush attr = \"Vay\"\n", + " double /data/400/particles/electrons/particleShape attr = 3\n", + " string /data/400/particles/electrons/particleSmoothing attr = \"none\"\n", + " uint8_t /data/400/particles/electrons/position/macroWeighted attr = 0\n", + " double /data/400/particles/electrons/position/timeOffset attr = 0\n", + " double /data/400/particles/electrons/position/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/400/particles/electrons/position/weightingPower attr = 0\n", + " double /data/400/particles/electrons/position/x {58125} = 0 / 0\n", + " double /data/400/particles/electrons/position/x/unitSI attr = 1\n", + " double /data/400/particles/electrons/position/y {58125} = 0 / 0\n", + " double /data/400/particles/electrons/position/y/unitSI attr = 1\n", + " double /data/400/particles/electrons/position/z {58125} = 0 / 0\n", + " double /data/400/particles/electrons/position/z/unitSI attr = 1\n", + " uint8_t /data/400/particles/electrons/positionOffset/macroWeighted attr = 0\n", + " double /data/400/particles/electrons/positionOffset/timeOffset attr = 0\n", + " double /data/400/particles/electrons/positionOffset/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/400/particles/electrons/positionOffset/weightingPower attr = 0\n", + " int64_t /data/400/particles/electrons/positionOffset/x/shape attr = 270625\n", + " double /data/400/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/400/particles/electrons/positionOffset/x/value attr = 0\n", + " int64_t /data/400/particles/electrons/positionOffset/y/shape attr = 270625\n", + " double /data/400/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/400/particles/electrons/positionOffset/y/value attr = 0\n", + " int64_t /data/400/particles/electrons/positionOffset/z/shape attr = 270625\n", + " double /data/400/particles/electrons/positionOffset/z/unitSI attr = 1\n", + " double /data/400/particles/electrons/positionOffset/z/value attr = 0\n", + " double /data/400/particles/electrons/weighting {58125} = 0 / 0\n", + " uint8_t /data/400/particles/electrons/weighting/macroWeighted attr = 1\n", + " double /data/400/particles/electrons/weighting/timeOffset attr = 0\n", + " double /data/400/particles/electrons/weighting/unitDimension attr = {0, 0, 0, 0, 0, 0, 0}\n", + " double /data/400/particles/electrons/weighting/unitSI attr = 1\n", + " double /data/400/particles/electrons/weighting/weightingPower attr = 1\n", + " double /data/400/time attr = 1.31388e-13\n", + " double /data/400/timeUnitSI attr = 1\n", + " uint8_t /data/500/closed attr = 1\n", + " double /data/500/dt attr = 3.28471e-16\n", + " uint8_t /data/500/particles/electrons/charge/macroWeighted attr = 0\n", + " int64_t /data/500/particles/electrons/charge/shape attr = 331875\n", + " double /data/500/particles/electrons/charge/timeOffset attr = 0\n", + " double /data/500/particles/electrons/charge/unitDimension attr = {0, 0, 1, 1, 0, 0, 0}\n", + " double /data/500/particles/electrons/charge/unitSI attr = 1\n", + " double /data/500/particles/electrons/charge/value attr = -1.60218e-19\n", + " double /data/500/particles/electrons/charge/weightingPower attr = 1\n", + " string /data/500/particles/electrons/currentDeposition attr = \"Esirkepov\"\n", + " uint8_t /data/500/particles/electrons/mass/macroWeighted attr = 0\n", + " int64_t /data/500/particles/electrons/mass/shape attr = 331875\n", + " double /data/500/particles/electrons/mass/timeOffset attr = 0\n", + " double /data/500/particles/electrons/mass/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/500/particles/electrons/mass/unitSI attr = 1\n", + " double /data/500/particles/electrons/mass/value attr = 9.10938e-31\n", + " double /data/500/particles/electrons/mass/weightingPower attr = 1\n", + " uint8_t /data/500/particles/electrons/momentum/macroWeighted attr = 0\n", + " double /data/500/particles/electrons/momentum/timeOffset attr = 0\n", + " double /data/500/particles/electrons/momentum/unitDimension attr = {1, 1, -1, 0, 0, 0, 0}\n", + " double /data/500/particles/electrons/momentum/weightingPower attr = 1\n", + " double /data/500/particles/electrons/momentum/x {119391} = 0 / 0\n", + " double /data/500/particles/electrons/momentum/x/unitSI attr = 1\n", + " double /data/500/particles/electrons/momentum/y {119391} = 0 / 0\n", + " double /data/500/particles/electrons/momentum/y/unitSI attr = 1\n", + " double /data/500/particles/electrons/momentum/z {119391} = 0 / 0\n", + " double /data/500/particles/electrons/momentum/z/unitSI attr = 1\n", + " string /data/500/particles/electrons/particleInterpolation attr = \"momentumConserving\"\n", + " string /data/500/particles/electrons/particlePush attr = \"Vay\"\n", + " double /data/500/particles/electrons/particleShape attr = 3\n", + " string /data/500/particles/electrons/particleSmoothing attr = \"none\"\n", + " uint8_t /data/500/particles/electrons/position/macroWeighted attr = 0\n", + " double /data/500/particles/electrons/position/timeOffset attr = 0\n", + " double /data/500/particles/electrons/position/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/500/particles/electrons/position/weightingPower attr = 0\n", + " double /data/500/particles/electrons/position/x {119391} = 0 / 0\n", + " double /data/500/particles/electrons/position/x/unitSI attr = 1\n", + " double /data/500/particles/electrons/position/y {119391} = 0 / 0\n", + " double /data/500/particles/electrons/position/y/unitSI attr = 1\n", + " double /data/500/particles/electrons/position/z {119391} = 0 / 0\n", + " double /data/500/particles/electrons/position/z/unitSI attr = 1\n", + " uint8_t /data/500/particles/electrons/positionOffset/macroWeighted attr = 0\n", + " double /data/500/particles/electrons/positionOffset/timeOffset attr = 0\n", + " double /data/500/particles/electrons/positionOffset/unitDimension attr = {1, 0, 0, 0, 0, 0, 0}\n", + " double /data/500/particles/electrons/positionOffset/weightingPower attr = 0\n", + " int64_t /data/500/particles/electrons/positionOffset/x/shape attr = 331875\n", + " double /data/500/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/500/particles/electrons/positionOffset/x/value attr = 0\n", + " int64_t /data/500/particles/electrons/positionOffset/y/shape attr = 331875\n", + " double /data/500/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/500/particles/electrons/positionOffset/y/value attr = 0\n", + " int64_t /data/500/particles/electrons/positionOffset/z/shape attr = 331875\n", + " double /data/500/particles/electrons/positionOffset/z/unitSI attr = 1\n", + " double /data/500/particles/electrons/positionOffset/z/value attr = 0\n", + " double /data/500/particles/electrons/weighting {119391} = 0 / 0\n", + " uint8_t /data/500/particles/electrons/weighting/macroWeighted attr = 1\n", + " double /data/500/particles/electrons/weighting/timeOffset attr = 0\n", + " double /data/500/particles/electrons/weighting/unitDimension attr = {0, 0, 0, 0, 0, 0, 0}\n", + " double /data/500/particles/electrons/weighting/unitSI attr = 1\n", + " double /data/500/particles/electrons/weighting/weightingPower attr = 1\n", + " double /data/500/time attr = 1.64236e-13\n", + " double /data/500/timeUnitSI attr = 1\n", + " string /date attr = \"2018-02-06 09:40:21 -0800\"\n", + " string /iterationEncoding attr = \"fileBased\"\n", + " string /iterationFormat attr = \"data%T.h5\"\n", + " string /meshesPath attr = \"fields/\"\n", + " string /openPMD attr = \"1.1.0\"\n", + " uint8_t /openPMDextension attr = 1\n", + " string /particlesPath attr = \"particles/\"\n", + " string /software attr = \"warp\"\n", + " string /softwareVersion attr = \"4\"\n", + " uint64_t __openPMD_internal/openPMD2_adios2_schema attr = 0\n", + " uint8_t __openPMD_internal/useSteps attr = 0\n" + ] + } + ], + "source": [ + "# [donotremove]\n", + "!bpls -a -l particle_extract.bp" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}