From 930dc0187ba362f7bb4ff755561a6fcc2d9c9326 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 20 Mar 2023 18:07:47 -0700 Subject: [PATCH] Script: Filter & Copy Particles Notebook that filters & copies particles and their attributes in chunk-wise (fixed slice) manner. --- src/cli/particle_extract.ipynb | 1535 ++++++++++++++++++++++++++++++++ 1 file changed, 1535 insertions(+) create mode 100644 src/cli/particle_extract.ipynb diff --git a/src/cli/particle_extract.ipynb b/src/cli/particle_extract.ipynb new file mode 100644 index 0000000000..b42d32c142 --- /dev/null +++ b/src/cli/particle_extract.ipynb @@ -0,0 +1,1535 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "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": 2, + "id": "fb913a51-e436-44ab-ab9d-9a2a1e9860af", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'HDF5'" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "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": 3, + "id": "fab061d9-675d-4fd9-ad97-87304e008a8b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "!rm -rf particle_extract.*" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "9320f003-5683-4527-b110-b684996e3e89", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'ADIOS2'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "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": 5, + "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": 6, + "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": 7, + "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", + " Filter results for this iteration and species are empty!\n", + " charge \u000b", + "Scalar\n", + " mass \u000b", + "Scalar\n", + " momentum x\n", + " momentum y\n", + " momentum z\n", + " position x\n", + " position y\n", + " position z\n", + " positionOffset x\n", + " positionOffset y\n", + " positionOffset z\n", + " weighting \u000b", + "Scalar\n", + "Iteration: 200\n", + " Particle species 'electrons'\n", + " Number of particles: 147500\n", + " number of passes: 1\n", + " Filter results for this iteration and species are empty!\n", + " charge \u000b", + "Scalar\n", + " mass \u000b", + "Scalar\n", + " momentum x\n", + " momentum y\n", + " momentum z\n", + " position x\n", + " position y\n", + " position z\n", + " positionOffset x\n", + " positionOffset y\n", + " positionOffset z\n", + " weighting \u000b", + "Scalar\n", + "Iteration: 300\n", + " Particle species 'electrons'\n", + " Number of particles: 208750\n", + " number of passes: 1\n", + " Filter results for this iteration and species are empty!\n", + " charge \u000b", + "Scalar\n", + " mass \u000b", + "Scalar\n", + " momentum x\n", + " momentum y\n", + " momentum z\n", + " position x\n", + " position y\n", + " position z\n", + " positionOffset x\n", + " positionOffset y\n", + " positionOffset z\n", + " weighting \u000b", + "Scalar\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", + " Writing constant record components\n", + " charge \u000b", + "Scalar [270625]->[58125]\n", + " mass \u000b", + "Scalar [270625]->[58125]\n", + " positionOffset x [270625]->[58125]\n", + " positionOffset y [270625]->[58125]\n", + " positionOffset z [270625]->[58125]\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", + " Writing constant record components\n", + " charge \u000b", + "Scalar [331875]->[119391]\n", + " mass \u000b", + "Scalar [331875]->[119391]\n", + " positionOffset x [331875]->[119391]\n", + " positionOffset y [331875]->[119391]\n", + " positionOffset z [331875]->[119391]\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", + " if out_slice_end == out_slice_start:\n", + " continue\n", + " \n", + " # species records\n", + " for k_p_r, in_p_r in in_p.items():\n", + " print(f\" {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", + "\n", + " # copy data\n", + " if in_p_rc.empty:\n", + " out_p_r = out_p[k_p_r]\n", + " out_p_rc = out_p_r[k_p_rc]\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", + " elif in_p_rc.constant:\n", + " # later, once we know the final shape\n", + " pass\n", + " else:\n", + " data = in_p_rc[in_slice]\n", + " input_series.flush()\n", + "\n", + " # write accepted particles back\n", + " out_slice = np.s_[out_slice_start:out_slice_end]\n", + " print(f\" out_slice={out_slice}, {out_slice_start}\")\n", + "\n", + " out_p_r = out_p[k_p_r]\n", + " out_p_rc = out_p_r[k_p_rc]\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, (out_slice_end,), '{ \"resizable\": true }'))\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", + " print(f\" {k_p_r} {k_p_rc}\")\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", + " else:\n", + " # write constant record components with final shape\n", + " print(\" Writing constant record components\")\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 in_p_rc.constant:\n", + " print(f\" {k_p_r} {k_p_rc} {in_p_rc.shape}->[{out_slice_end}]\")\n", + " out_p_rc.reset_dataset(io.Dataset(in_p_rc.dtype, (out_slice_end,)))\n", + " out_p_rc.make_constant(in_p_rc.get_attribute(\"value\"))\n", + "\n", + " output_series.flush()\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": 8, + "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", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " y\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " z\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " y\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " z\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " y\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " z\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " y\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " z\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + "electrons mass\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\n", + " weightingPower\n", + " \u000b", + "Scalar\n", + " macroWeighted\n", + " shape\n", + " - skipped\n", + " timeOffset\n", + " unitDimension\n", + " unitSI\n", + " value\n", + " - skipped\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", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " y\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\n", + " z\n", + " shape\n", + " - skipped\n", + " unitSI\n", + " value\n", + " - skipped\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", + " if a in [\"shape\", \"value\"]:\n", + " print(\" - skipped\")\n", + " continue\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", + " if a in [\"shape\", \"value\"]:\n", + " print(\" - skipped\")\n", + " continue\n", + " out_p_rc.set_attribute(a, in_p_rc.get_attribute(a))\n", + "\n", + "output_series.flush()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "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": 10, + "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": 11, + "id": "af2f6e29-0b5a-406e-854a-f7ff1d77d9f6", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "del input_series\n", + "del output_series" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "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": 13, + "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", + " uint64_t /data/100/particles/electrons/charge/shape attr = 0\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 = 0\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", + " uint64_t /data/100/particles/electrons/mass/shape attr = 0\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 = 0\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", + " uint64_t /data/100/particles/electrons/positionOffset/x/shape attr = 0\n", + " double /data/100/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/100/particles/electrons/positionOffset/x/value attr = 0\n", + " uint64_t /data/100/particles/electrons/positionOffset/y/shape attr = 0\n", + " double /data/100/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/100/particles/electrons/positionOffset/y/value attr = 0\n", + " uint64_t /data/100/particles/electrons/positionOffset/z/shape attr = 0\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", + " uint64_t /data/200/particles/electrons/charge/shape attr = 0\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 = 0\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", + " uint64_t /data/200/particles/electrons/mass/shape attr = 0\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 = 0\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", + " uint64_t /data/200/particles/electrons/positionOffset/x/shape attr = 0\n", + " double /data/200/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/200/particles/electrons/positionOffset/x/value attr = 0\n", + " uint64_t /data/200/particles/electrons/positionOffset/y/shape attr = 0\n", + " double /data/200/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/200/particles/electrons/positionOffset/y/value attr = 0\n", + " uint64_t /data/200/particles/electrons/positionOffset/z/shape attr = 0\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", + " uint64_t /data/300/particles/electrons/charge/shape attr = 0\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 = 0\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", + " uint64_t /data/300/particles/electrons/mass/shape attr = 0\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 = 0\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", + " uint64_t /data/300/particles/electrons/positionOffset/x/shape attr = 0\n", + " double /data/300/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/300/particles/electrons/positionOffset/x/value attr = 0\n", + " uint64_t /data/300/particles/electrons/positionOffset/y/shape attr = 0\n", + " double /data/300/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/300/particles/electrons/positionOffset/y/value attr = 0\n", + " uint64_t /data/300/particles/electrons/positionOffset/z/shape attr = 0\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", + " uint64_t /data/400/particles/electrons/charge/shape attr = 58125\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", + " uint64_t /data/400/particles/electrons/mass/shape attr = 58125\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", + " uint64_t /data/400/particles/electrons/positionOffset/x/shape attr = 58125\n", + " double /data/400/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/400/particles/electrons/positionOffset/x/value attr = 0\n", + " uint64_t /data/400/particles/electrons/positionOffset/y/shape attr = 58125\n", + " double /data/400/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/400/particles/electrons/positionOffset/y/value attr = 0\n", + " uint64_t /data/400/particles/electrons/positionOffset/z/shape attr = 58125\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", + " uint64_t /data/500/particles/electrons/charge/shape attr = 119391\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", + " uint64_t /data/500/particles/electrons/mass/shape attr = 119391\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", + " uint64_t /data/500/particles/electrons/positionOffset/x/shape attr = 119391\n", + " double /data/500/particles/electrons/positionOffset/x/unitSI attr = 1\n", + " double /data/500/particles/electrons/positionOffset/x/value attr = 0\n", + " uint64_t /data/500/particles/electrons/positionOffset/y/shape attr = 119391\n", + " double /data/500/particles/electrons/positionOffset/y/unitSI attr = 1\n", + " double /data/500/particles/electrons/positionOffset/y/value attr = 0\n", + " uint64_t /data/500/particles/electrons/positionOffset/z/shape attr = 119391\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 +}