Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Impact-T read/write emfield_cartesian FieldMesh #73

Merged
merged 7 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 145 additions & 72 deletions docs/examples/bunching.ipynb

Large diffs are not rendered by default.

346 changes: 272 additions & 74 deletions docs/examples/fields/corrector_modeling.ipynb

Large diffs are not rendered by default.

190 changes: 130 additions & 60 deletions docs/examples/fields/field_conversion.ipynb

Large diffs are not rendered by default.

714 changes: 563 additions & 151 deletions docs/examples/fields/field_examples.ipynb

Large diffs are not rendered by default.

270 changes: 135 additions & 135 deletions docs/examples/fields/field_expansion.ipynb

Large diffs are not rendered by default.

204 changes: 103 additions & 101 deletions docs/examples/fields/field_tracking.ipynb

Large diffs are not rendered by default.

1,334 changes: 976 additions & 358 deletions docs/examples/labels.ipynb

Large diffs are not rendered by default.

285 changes: 237 additions & 48 deletions docs/examples/normalized_coordinates.ipynb

Large diffs are not rendered by default.

664 changes: 536 additions & 128 deletions docs/examples/particle_examples.ipynb

Large diffs are not rendered by default.

79 changes: 67 additions & 12 deletions docs/examples/plot_examples.ipynb

Large diffs are not rendered by default.

79 changes: 70 additions & 9 deletions docs/examples/read_examples.ipynb

Large diffs are not rendered by default.

164 changes: 111 additions & 53 deletions docs/examples/units.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:36.773062Z",
"iopub.status.busy": "2024-10-17T21:50:36.771258Z",
"iopub.status.idle": "2024-10-17T21:50:36.792464Z",
"shell.execute_reply": "2024-10-17T21:50:36.792055Z"
},
"tags": []
},
"outputs": [],
Expand All @@ -26,6 +32,12 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:36.794858Z",
"iopub.status.busy": "2024-10-17T21:50:36.794685Z",
"iopub.status.idle": "2024-10-17T21:50:37.567790Z",
"shell.execute_reply": "2024-10-17T21:50:37.567352Z"
},
"tags": []
},
"outputs": [],
Expand All @@ -47,54 +59,15 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.569624Z",
"iopub.status.busy": "2024-10-17T21:50:37.569368Z",
"iopub.status.idle": "2024-10-17T21:50:37.598846Z",
"shell.execute_reply": "2024-10-17T21:50:37.598422Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mInit signature:\u001b[0m \u001b[0mpmd_unit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0munitSymbol\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m''\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munitSI\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munitDimension\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m \n",
"Params\n",
"------\n",
"\n",
"unitSymbol: Native units name\n",
"unitSI: Conversion factor to the the correspontign SI unit\n",
"unitDimension: SI Base Exponents\n",
"\n",
"Base unit dimensions are defined as: \n",
" Base dimension | exponents. | SI unit\n",
" ---------------- ----------------- -------\n",
" length : (1,0,0,0,0,0,0) m\n",
" mass : (0,1,0,0,0,0,0) kg\n",
" time : (0,0,1,0,0,0,0) s\n",
" current : (0,0,0,1,0,0,0) A\n",
" temperture : (0,0,0,0,1,0,0) K\n",
" mol : (0,0,0,0,0,1,0) mol\n",
" luminous : (0,0,0,0,0,0,1) cd \n",
"\n",
"Example:\n",
" pmd_unit('eV', 1.602176634e-19, (2, 1, -2, 0, 0, 0, 0))\n",
" defines that an eV is 1.602176634e-19 of base units m^2 kg/s^2, which is a Joule (J)\n",
"\n",
"If unitSI=0 (default), init with a known symbol:\n",
" pmd_unit('T')\n",
"returns:\n",
" pmd_unit('T', 1, (0, 1, -2, -1, 0, 0, 0))\n",
" \n",
" \n",
"Simple equalities are provided:\n",
" u1 == u2\n",
"Returns True if the params are all the same. \n",
"\u001b[0;31mFile:\u001b[0m ~/Code/GitHub/openPMD-beamphysics/pmd_beamphysics/units.py\n",
"\u001b[0;31mType:\u001b[0m type\n",
"\u001b[0;31mSubclasses:\u001b[0m \n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"?pmd_unit"
]
Expand All @@ -110,6 +83,12 @@
"cell_type": "code",
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.600430Z",
"iopub.status.busy": "2024-10-17T21:50:37.600304Z",
"iopub.status.idle": "2024-10-17T21:50:37.613585Z",
"shell.execute_reply": "2024-10-17T21:50:37.613249Z"
},
"tags": []
},
"outputs": [
Expand Down Expand Up @@ -144,6 +123,12 @@
"cell_type": "code",
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.634528Z",
"iopub.status.busy": "2024-10-17T21:50:37.634394Z",
"iopub.status.idle": "2024-10-17T21:50:37.646165Z",
"shell.execute_reply": "2024-10-17T21:50:37.645891Z"
},
"tags": []
},
"outputs": [
Expand Down Expand Up @@ -175,6 +160,12 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.647688Z",
"iopub.status.busy": "2024-10-17T21:50:37.647575Z",
"iopub.status.idle": "2024-10-17T21:50:37.659408Z",
"shell.execute_reply": "2024-10-17T21:50:37.659168Z"
},
"tags": []
},
"outputs": [
Expand Down Expand Up @@ -207,7 +198,14 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.660640Z",
"iopub.status.busy": "2024-10-17T21:50:37.660559Z",
"iopub.status.idle": "2024-10-17T21:50:37.671325Z",
"shell.execute_reply": "2024-10-17T21:50:37.671046Z"
}
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -236,14 +234,20 @@
"cell_type": "code",
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.672619Z",
"iopub.status.busy": "2024-10-17T21:50:37.672531Z",
"iopub.status.idle": "2024-10-17T21:50:37.683213Z",
"shell.execute_reply": "2024-10-17T21:50:37.682992Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"{'unitDimension': array([ 1, 1, -1, 0, 0, 0, 0]),\n",
" 'unitSI': 5.344285992678308e-28,\n",
" 'unitSI': np.float64(5.344285992678308e-28),\n",
" 'unitSymbol': 'eV/c'}"
]
},
Expand All @@ -261,13 +265,25 @@
"cell_type": "code",
"execution_count": 9,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.684446Z",
"iopub.status.busy": "2024-10-17T21:50:37.684366Z",
"iopub.status.idle": "2024-10-17T21:50:37.694323Z",
"shell.execute_reply": "2024-10-17T21:50:37.694075Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(1, 1, -1, 0, 0, 0, 0)"
"(np.int64(1),\n",
" np.int64(1),\n",
" np.int64(-1),\n",
" np.int64(0),\n",
" np.int64(0),\n",
" np.int64(0),\n",
" np.int64(0))"
]
},
"execution_count": 9,
Expand All @@ -290,6 +306,12 @@
"cell_type": "code",
"execution_count": 10,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.695658Z",
"iopub.status.busy": "2024-10-17T21:50:37.695564Z",
"iopub.status.idle": "2024-10-17T21:50:37.706645Z",
"shell.execute_reply": "2024-10-17T21:50:37.706404Z"
},
"tags": []
},
"outputs": [
Expand Down Expand Up @@ -319,6 +341,12 @@
"cell_type": "code",
"execution_count": 11,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.707933Z",
"iopub.status.busy": "2024-10-17T21:50:37.707849Z",
"iopub.status.idle": "2024-10-17T21:50:37.717595Z",
"shell.execute_reply": "2024-10-17T21:50:37.717353Z"
},
"tags": []
},
"outputs": [],
Expand All @@ -337,13 +365,19 @@
"cell_type": "code",
"execution_count": 12,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.718903Z",
"iopub.status.busy": "2024-10-17T21:50:37.718818Z",
"iopub.status.idle": "2024-10-17T21:50:37.728852Z",
"shell.execute_reply": "2024-10-17T21:50:37.728622Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(100.00000000000001, 1e-06, 'µ')"
"(np.float64(100.00000000000001), np.float64(1e-06), 'µ')"
]
},
"execution_count": 12,
Expand All @@ -361,13 +395,19 @@
"cell_type": "code",
"execution_count": 13,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.730219Z",
"iopub.status.busy": "2024-10-17T21:50:37.730120Z",
"iopub.status.idle": "2024-10-17T21:50:37.741039Z",
"shell.execute_reply": "2024-10-17T21:50:37.740794Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(array([-10., 10.]), 0.001, 'm')"
"(array([-10., 10.]), np.float64(0.001), 'm')"
]
},
"execution_count": 13,
Expand All @@ -383,6 +423,12 @@
"cell_type": "code",
"execution_count": 14,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.742326Z",
"iopub.status.busy": "2024-10-17T21:50:37.742244Z",
"iopub.status.idle": "2024-10-17T21:50:37.751517Z",
"shell.execute_reply": "2024-10-17T21:50:37.751284Z"
},
"tags": []
},
"outputs": [],
Expand All @@ -394,13 +440,19 @@
"cell_type": "code",
"execution_count": 15,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.752801Z",
"iopub.status.busy": "2024-10-17T21:50:37.752721Z",
"iopub.status.idle": "2024-10-17T21:50:37.763696Z",
"shell.execute_reply": "2024-10-17T21:50:37.763464Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(0.001, 'm')"
"(np.float64(0.001), 'm')"
]
},
"execution_count": 15,
Expand All @@ -427,6 +479,12 @@
"cell_type": "code",
"execution_count": 16,
"metadata": {
"execution": {
"iopub.execute_input": "2024-10-17T21:50:37.764906Z",
"iopub.status.busy": "2024-10-17T21:50:37.764826Z",
"iopub.status.idle": "2024-10-17T21:50:37.774438Z",
"shell.execute_reply": "2024-10-17T21:50:37.774197Z"
},
"tags": []
},
"outputs": [
Expand Down Expand Up @@ -463,7 +521,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
Loading
Loading