Skip to content

Commit 1d597f3

Browse files
committed
Updated experimental data notebooks
1 parent 965beba commit 1d597f3

8 files changed

Lines changed: 40 additions & 16 deletions

notebooks/experimental_xray_data/00_data_loading.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
"source": [
197197
"<div class=\"alert alert-warning\" markdown=\"1\">\n",
198198
" <strong>Challenge</strong><br>Modify the optical parameters used for estimating the initial probe and observe if/how it improves the quality or convergence of the reconstruction.\n",
199+
" For example, you can make the inital probe bigger/smaller by adjusting the <code>propagation.parallel</code> parameter.\n",
199200
"</div>"
200201
]
201202
},
@@ -335,7 +336,7 @@
335336
"name": "python",
336337
"nbconvert_exporter": "python",
337338
"pygments_lexer": "ipython3",
338-
"version": "3.9.7"
339+
"version": "3.11.7"
339340
}
340341
},
341342
"nbformat": 4,

notebooks/experimental_xray_data/01_working_with_large_data.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"```python\n",
179179
"p.engines = u.Param()\n",
180180
"p.engines.engine = u.Param()\n",
181-
"p.engines.engine.name = \"DM_pycuda\"\n",
181+
"p.engines.engine.name = \"DM_cupy\"\n",
182182
"p.engines.engine.numiter = 200\n",
183183
"p.engines.engine.numiter_contiguous = 10\n",
184184
"p.engines.engine.probe_support = None\n",
@@ -373,7 +373,7 @@
373373
"name": "python",
374374
"nbconvert_exporter": "python",
375375
"pygments_lexer": "ipython3",
376-
"version": "3.11.8"
376+
"version": "3.11.7"
377377
}
378378
},
379379
"nbformat": 4,

notebooks/experimental_xray_data/02_fixing_data_issues.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"name": "python",
193193
"nbconvert_exporter": "python",
194194
"pygments_lexer": "ipython3",
195-
"version": "3.11.8"
195+
"version": "3.11.7"
196196
}
197197
},
198198
"nbformat": 4,

notebooks/experimental_xray_data/03_partial_coherence.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,14 @@
242242
" ax2 = ptypy.utils.PtyAxis(axes[1,i],channel=\"a\")\n",
243243
" ax2.set_data(v[i][200:-200,200:-200])"
244244
]
245+
},
246+
{
247+
"cell_type": "code",
248+
"execution_count": null,
249+
"id": "19e25990-27c4-4ea6-89c7-6bc0f24d17b9",
250+
"metadata": {},
251+
"outputs": [],
252+
"source": []
245253
}
246254
],
247255
"metadata": {
@@ -260,7 +268,7 @@
260268
"name": "python",
261269
"nbconvert_exporter": "python",
262270
"pygments_lexer": "ipython3",
263-
"version": "3.11.8"
271+
"version": "3.11.7"
264272
}
265273
},
266274
"nbformat": 4,

notebooks/experimental_xray_data/04_position_refinement.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"metadata": {},
198198
"source": [
199199
"<div class=\"alert alert-warning\" markdown=\"1\">\n",
200-
" <strong>Challenge</strong><br>Run the reconstruction with position refinement and observe the improvement on the features in the object reconstruction. Modify the position refinement parameters how it effects the outcome and performance of the reconstruction, e.g. increase/decrease the <code>amplitude</code> or switch to <code>method=GridSearch</code> which does a brute-force optimisation of all possible positions instead of the random annealing.\n",
200+
" <strong>Challenge</strong><br>Run the reconstruction with position refinement and observe the improvement on the features in the object reconstruction. Modify the position refinement parameters to see how it effects the outcome and performance of the reconstruction, e.g. increase/decrease the <code>amplitude</code> or switch to <code>method=GridSearch</code> which does a brute-force optimisation of all possible positions instead of the random annealing.\n",
201201
"</div>"
202202
]
203203
},
@@ -380,7 +380,7 @@
380380
"name": "python",
381381
"nbconvert_exporter": "python",
382382
"pygments_lexer": "ipython3",
383-
"version": "3.11.8"
383+
"version": "3.11.7"
384384
}
385385
},
386386
"nbformat": 4,

notebooks/experimental_xray_data/05_missing_detector_frames.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
"name": "python",
325325
"nbconvert_exporter": "python",
326326
"pygments_lexer": "ipython3",
327-
"version": "3.11.8"
327+
"version": "3.11.7"
328328
}
329329
},
330330
"nbformat": 4,

notebooks/experimental_xray_data/06_testing_different_algorithms.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
"name": "python",
310310
"nbconvert_exporter": "python",
311311
"pygments_lexer": "ipython3",
312-
"version": "3.11.8"
312+
"version": "3.11.7"
313313
}
314314
},
315315
"nbformat": 4,

notebooks/experimental_xray_data/07_multi_gpu.ipynb

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,28 @@
7575
"id": "c3c5ac6f-9434-4de3-9779-8620c72d1a10",
7676
"metadata": {},
7777
"source": [
78-
"## Executing script in terminal on JupyterHub\n",
78+
"## Executing script in terminal on JupyterHub @ NERSC\n",
7979
"\n",
8080
"Now, we need to open a new terminal (click blue \"+\" in top left corner of JupyterHub and then \"Terminal\") which should look something like this\n",
8181
"\n",
8282
"```\n",
83-
"(PtyPy) benedikt@nid001848:/global/u2/b/benedikt> \n",
83+
"benedikt@login01:/global/u2/b/benedikt/tutorials/notebooks/experimental_xray_data> \n",
8484
"```\n",
8585
"\n",
86-
"with the (PtyPy) environment already loaded. We can then navigate to the folder for this example \n",
86+
"We then need to load the PtyPy conda environment\n",
87+
"\n",
88+
"```\n",
89+
"module load python\n",
90+
"conda activate /global/common/software/trn005/ptypy_env\n",
91+
"```\n",
92+
"\n",
93+
"which should make your terminal look like this\n",
94+
"\n",
95+
"```\n",
96+
"(ptypy_env) benedikt@login01:/global/u2/b/benedikt/tutorials/notebooks/experimental_xray_data> \n",
97+
"```\n",
98+
"\n",
99+
"with the (PtyPy) environment loaded. If not already in the correct folder, we can navigate to the folder for this example \n",
87100
"\n",
88101
"```bash\n",
89102
"cd $HOME/tutorials/notebooks/experimental_xray_data\n",
@@ -92,7 +105,7 @@
92105
"and execute a multi-GPU reconstruction via ```srun``` using all 4 GPUs that is available on a Perlmutter node. \n",
93106
"\n",
94107
"```bash\n",
95-
"srun -n 4 -c 2 --gpus-per-task=1 --gpu-bin=None python ptypy_run_dls_i08_nanogold.py\n",
108+
"srun -n 4 -c 2 --gpus-per-task=1 --gpu-bind=None python ptypy_run_dls_i08_nanogold.py\n",
96109
"```"
97110
]
98111
},
@@ -102,7 +115,7 @@
102115
"metadata": {},
103116
"source": [
104117
"<div class=\"alert alert-warning\" markdown=\"1\">\n",
105-
" <strong>Challenge</strong><br>Run the I08 nanogold example in a terminal using 4 GPUs and compare the speed against the previous example from the Jupyter notebook which was using just a single GPU.\n",
118+
" <strong>Challenge</strong><br>Run the I08 nanogold example in a terminal using 1,2,3 and 4 GPUs and compare the speed. You can add <code>p.io.benchmark=\"all\"</code> to get performance benchmark numbers written by PtyPy into a file called \"benchmark.json\"\n",
106119
"</div>"
107120
]
108121
},
@@ -120,8 +133,10 @@
120133
"metadata": {},
121134
"source": [
122135
"# commands to copy into terminal\n",
136+
"module load python\n",
137+
"conda activate /global/common/software/trn005/ptypy_env\n",
123138
"cd $HOME/tutorials/notebooks/experimental_xray_data\n",
124-
"srun -n 4 -c 2 --gpus-per-task=1 --gpu-bin=None python ptypy_run_dls_i08_nanogold.py"
139+
"srun -n 4 -c 2 --gpus-per-task=1 --gpu-bind=None python ptypy_run_dls_i08_nanogold.py"
125140
]
126141
},
127142
{
@@ -176,7 +191,7 @@
176191
"name": "python",
177192
"nbconvert_exporter": "python",
178193
"pygments_lexer": "ipython3",
179-
"version": "3.9.7"
194+
"version": "3.11.7"
180195
}
181196
},
182197
"nbformat": 4,

0 commit comments

Comments
 (0)