diff --git a/notebooks/supplementary_examples/00_nearfield_ptychography.ipynb b/notebooks/supplementary_examples/00_nearfield_ptychography.ipynb index 621ae77..643aa2a 100644 --- a/notebooks/supplementary_examples/00_nearfield_ptychography.ipynb +++ b/notebooks/supplementary_examples/00_nearfield_ptychography.ipynb @@ -76,7 +76,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "c7b8dac1-ec91-42b8-b609-66e8860fcb70", "metadata": {}, @@ -168,7 +167,9 @@ "cell_type": "code", "execution_count": null, "id": "ee3cbe0e-7393-4e07-8e6c-a0063eb55dbe", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import ptypy, h5py, os\n", @@ -178,7 +179,7 @@ "ptypy.load_ptyscan_module(\"hdf5_loader\")\n", "\n", "# This will import the GPU engines\n", - "ptypy.load_gpu_engines(\"cuda\") \n", + "ptypy.load_gpu_engines(\"cupy\") \n", "\n", "# Root directory of tutorial data\n", "tutorial_data_home = \"../../data/\"\n", @@ -260,7 +261,7 @@ "# Reconstruct using GPU-accelerated DM/ML engines\n", "p.engines = u.Param()\n", "p.engines.DM = u.Param()\n", - "p.engines.DM.name = 'DM_pycuda'\n", + "p.engines.DM.name = 'DM_cupy'\n", "p.engines.DM.numiter = 500\n", "p.engines.DM.numiter_contiguous = 10\n", "p.engines.DM.probe_support = None\n", @@ -269,7 +270,7 @@ "p.engines.DM.probe_update_start = 0\n", "\n", "p.engines.ML = u.Param()\n", - "p.engines.ML.name = 'ML_pycuda'\n", + "p.engines.ML.name = 'ML_cupy'\n", "p.engines.ML.numiter = 500\n", "p.engines.ML.numiter_contiguous = 10\n", "p.engines.ML.ML_type = 'Gaussian'\n", @@ -287,9 +288,9 @@ ], "metadata": { "kernelspec": { - "display_name": "PtyPy", + "display_name": "PtyPy (cupy)", "language": "python", - "name": "ptypy_pycuda" + "name": "ptypy_cupy" }, "language_info": { "codemirror_mode": { @@ -301,7 +302,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.11.8" } }, "nbformat": 4, diff --git a/notebooks/supplementary_examples/01_object_regularisation.ipynb b/notebooks/supplementary_examples/01_object_regularisation.ipynb index 80883ed..c7db1ca 100644 --- a/notebooks/supplementary_examples/01_object_regularisation.ipynb +++ b/notebooks/supplementary_examples/01_object_regularisation.ipynb @@ -70,7 +70,9 @@ "cell_type": "code", "execution_count": null, "id": "e5286f05-4595-4d85-857a-612274f213d9", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import h5py\n", @@ -269,7 +271,9 @@ "cell_type": "code", "execution_count": null, "id": "a495ee4f-604b-4f68-a023-032061ae43dd", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import ptypy, h5py, os\n", @@ -279,7 +283,7 @@ "ptypy.load_ptyscan_module(\"hdf5_loader\")\n", "\n", "# This will import the GPU engines\n", - "ptypy.load_gpu_engines(\"cuda\")\n", + "ptypy.load_gpu_engines(\"pycuda\")\n", "\n", "# Load custom engine\n", "from ptypy.custom.DM_pycuda_object_regul import DM_pycuda_object_regul\n", @@ -385,7 +389,7 @@ ], "metadata": { "kernelspec": { - "display_name": "PtyPy", + "display_name": "PtyPy (pycuda)", "language": "python", "name": "ptypy_pycuda" }, @@ -399,7 +403,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/notebooks/supplementary_examples/02_live_visualisation.ipynb b/notebooks/supplementary_examples/02_live_visualisation.ipynb index 03782ff..ddf563d 100644 --- a/notebooks/supplementary_examples/02_live_visualisation.ipynb +++ b/notebooks/supplementary_examples/02_live_visualisation.ipynb @@ -65,7 +65,9 @@ "cell_type": "code", "execution_count": null, "id": "b81d242c-deda-4b5d-a577-b55b42e46ac9", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "with open(\"./ptypy_run_dls_i08_nanogold.py\", \"w\") as f:\n", @@ -78,6 +80,18 @@ "\"\"\")" ] }, + { + "cell_type": "raw", + "id": "75d00b06-5dc5-46da-93a8-5b160285845b", + "metadata": { + "tags": [] + }, + "source": [ + "# commands to copy into terminal\n", + "cd $HOME/tutorials/notebooks/supplementary_examples\n", + "srun -n 4 -c 2 --gpus-per-task=1 --gpu-bin=None python ptypy_run_dls_i08_nanogold.py" + ] + }, { "cell_type": "markdown", "id": "6a288a19-ea65-41f6-9bb3-0337a00dde6a", @@ -139,7 +153,9 @@ "cell_type": "code", "execution_count": null, "id": "ca168d91-e5b8-4d41-8b5d-1c37035f906a", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import ptypy\n", @@ -160,7 +176,9 @@ "cell_type": "code", "execution_count": null, "id": "06fe8608-449e-4b66-a512-0f339ea7afe8", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "# Refresh this cell multiple time \n", @@ -182,9 +200,9 @@ ], "metadata": { "kernelspec": { - "display_name": "PtyPy", + "display_name": "PtyPy (cupy)", "language": "python", - "name": "ptypy_pycuda" + "name": "ptypy_cupy" }, "language_info": { "codemirror_mode": { @@ -196,7 +214,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.11.8" } }, "nbformat": 4, diff --git a/notebooks/supplementary_examples/03_simulating_data.ipynb b/notebooks/supplementary_examples/03_simulating_data.ipynb index 4a99c8c..5697421 100644 --- a/notebooks/supplementary_examples/03_simulating_data.ipynb +++ b/notebooks/supplementary_examples/03_simulating_data.ipynb @@ -153,7 +153,9 @@ "cell_type": "code", "execution_count": null, "id": "3d920728-63e9-4070-bbab-455a97d8303b", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import ptypy\n", @@ -262,9 +264,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel) [User Conda - cuda12.2]", + "display_name": "PtyPy (cupy)", "language": "python", - "name": "conda-env-User_Conda_-_cuda12.2-python3" + "name": "ptypy_cupy" }, "language_info": { "codemirror_mode": { @@ -276,7 +278,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.11.8" } }, "nbformat": 4, diff --git a/notebooks/supplementary_examples/04_modified_initial_probe.ipynb b/notebooks/supplementary_examples/04_modified_initial_probe.ipynb index 67e73dc..d7be21a 100644 --- a/notebooks/supplementary_examples/04_modified_initial_probe.ipynb +++ b/notebooks/supplementary_examples/04_modified_initial_probe.ipynb @@ -14,7 +14,7 @@ "id": "84411552-5a4e-4a26-a702-cdf0b23feab1", "metadata": {}, "source": [ - "This example builds on the data set used in [The Hdf5Loader](../experimental_xray_data/00_data_loading.ipynb) and shows how it is possible in PtyPy to set up a reconstruction, execute with ```level=4```, then modify the model of the initial probe and run the reconstruction via ```P.run()``` using the newly generated initial probe\n", + "This example is using the same data and parameters as in [Loading HDF5 Data](../experimental_xray_data/00_data_loading.ipynb) and shows how it is possible in PtyPy to set up a reconstruction, execute with ```level=4```, then modify the model of the initial probe and run the reconstruction via ```P.run()``` using the newly generated initial probe\n", "\n", "![](./_assets/modified_probe.png)" ] @@ -31,7 +31,9 @@ "cell_type": "code", "execution_count": null, "id": "903a1bb0-5ff1-401a-8f49-a0b5913eabc1", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import ptypy, os\n", @@ -137,7 +139,9 @@ "cell_type": "code", "execution_count": null, "id": "47c1927b-bc49-4dad-99bf-4746c1590bd1", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "from ptypy.core.illumination import _propagation, illumination_desc, aperture\n", @@ -173,7 +177,9 @@ "cell_type": "code", "execution_count": null, "id": "715591d6-e765-498d-a7da-22e19db20a87", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -195,7 +201,9 @@ "cell_type": "code", "execution_count": null, "id": "17d9466c-1296-4fe8-bdf9-65541db9b8ef", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "# Run the reconstruction using the modified initial probe\n", @@ -205,9 +213,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.10 [DLS Conda]", + "display_name": "PtyPy (cupy)", "language": "python", - "name": "conda-env-DLS_Conda-python3.10-kernel.json" + "name": "ptypy_cupy" }, "language_info": { "codemirror_mode": { @@ -219,7 +227,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.11.8" } }, "nbformat": 4,