This is an automated email from the ASF dual-hosted git repository.

lahirujayathilake pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 5f42822a165d092b57a8d06a1fb3ee0b113a8c45
Author: lahiruj <[email protected]>
AuthorDate: Mon Mar 10 10:51:57 2025 -0400

    updated the gkeyll notebook script
---
 .../jupyterhub/data/gkeyll/plotE_z.ipynb           | 39 +++++++++++++---------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git 
a/modules/agent-framework/deployments/jupyterhub/data/gkeyll/plotE_z.ipynb 
b/modules/agent-framework/deployments/jupyterhub/data/gkeyll/plotE_z.ipynb
index 49de4e2389..ff7cc617b0 100644
--- a/modules/agent-framework/deployments/jupyterhub/data/gkeyll/plotE_z.ipynb
+++ b/modules/agent-framework/deployments/jupyterhub/data/gkeyll/plotE_z.ipynb
@@ -35,7 +35,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "!ls /anvil/projects/x-phy220105/cwsmith/vlabApps/gkyldataset"
+    "!ls /anvil/projects/x-phy220105/gkylMarch2025/vlabApps/gemReconnection"
    ]
   },
   {
@@ -46,23 +46,20 @@
    "outputs": [],
    "source": [
     "from pathlib import Path\n",
-    "import matplotlib.pyplot as plt \n",
-    "\n",
-    "import os\n",
-    "\n",
+    "import matplotlib.pyplot as plt\n",
     "import postgkyl as pg\n",
     "\n",
-    "data_base_path = 
\"/anvil/projects/x-phy220105/cwsmith/vlabApps/gkyldataset\"\n",
+    "data_base_path = 
\"/anvil/projects/x-phy220105/gkylMarch2025/vlabApps/gemReconnection\"\n",
     "run = Path.cwd()\n",
     "\n",
     "def getModelType():\n",
-    "    frame = 0 \n",
+    "    frame = 0\n",
     "    models = [\"5m\", \"10m\"]\n",
     "    for model in models:\n",
-    "        path = 
Path(f\"{data_base_path}/rt-{model}-gem_field_{frame}.bp\")\n",
+    "        path = 
Path(f\"{data_base_path}/rt_{model}_gem_gzero-field_{frame}.gkyl\")\n",
     "        if path.is_file():\n",
     "            return model\n",
-    "    error = \"Failed to find input ADIOS file rt-5m-gem_field_0.bp or 
rt-10m-gem_field_0.bp.\"\n",
+    "    error = \"Failed to find input file \" + str(path)\n",
     "    assert False, error"
    ]
   },
@@ -73,9 +70,9 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "frame = 0 \n",
+    "frame = 0\n",
     "model = getModelType()\n",
-    "filename = run / f\"{data_base_path}/rt-{model}-gem_field_{frame}.bp\"\n",
+    "filename = run / 
f\"{data_base_path}/rt_{model}_gem_gzero-field_{frame}.gkyl\"\n",
     "filename = str(filename)\n",
     "print(filename)"
    ]
@@ -89,13 +86,13 @@
    "source": [
     "gdata = pg.GData(filename)\n",
     "\n",
-    "vals = gdata.getValues() # cell-center values, shape is Ny * Nx * 
Ncomponents\n",
-    "grid = gdata.getGrid() # cell corner coordinates\n",
-    "ndim = gdata.getNumDims() # number of spatial dimensions\n",
+    "vals = gdata.get_values() # cell-center values, shape is Ny * Nx * 
Ncomponents\n",
+    "grid = gdata.get_grid() # cell corner coordinates\n",
+    "ndim = gdata.get_num_dims() # number of spatial dimensions\n",
     "\n",
     "assert len(vals.shape) == ndim+1 and len(grid) == ndim\n",
     "\n",
-    "icomp = 3 \n",
+    "icomp = 3\n",
     "compName = r'$E_z^2$'\n",
     "fileName = \"E_z.png\"\n",
     "\n",
@@ -110,7 +107,9 @@
     "ax.set_xlabel('x')\n",
     "ax.set_ylabel('y')\n",
     "ax.set_title(compName)\n",
-    "ax.set_aspect(1)"
+    "ax.set_aspect(1)\n",
+    "\n",
+    "plt.savefig(fileName)"
    ]
   },
   {
@@ -131,6 +130,14 @@
     "%stop_runtime test_cpu\n",
     "%switch_runtime local"
    ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "5d87f6d9-2547-473d-987a-af5306d6f00b",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {

Reply via email to