Skip to content

Commit 965beba

Browse files
committed
Updated basic example notebooks
1 parent 9db29ee commit 965beba

9 files changed

+24
-22
lines changed

notebooks/basic_examples/00_the_parameter_tree.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323
"name": "python",
324324
"nbconvert_exporter": "python",
325325
"pygments_lexer": "ipython3",
326-
"version": "3.9.7"
326+
"version": "3.11.7"
327327
}
328328
},
329329
"nbformat": 4,

notebooks/basic_examples/01_using_yaml_or_json_config.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"name": "python",
214214
"nbconvert_exporter": "python",
215215
"pygments_lexer": "ipython3",
216-
"version": "3.11.8"
216+
"version": "3.11.7"
217217
}
218218
},
219219
"nbformat": 4,

notebooks/basic_examples/02_input_output_parameters.ipynb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"metadata": {},
5858
"source": [
5959
"<div class=\"alert alert-info\" markdown=\"1\">\n",
60-
"<strong>Note</strong><br>Live-plotting in Jupyter notebooks using <code>p.io.autoplot</code> works best in conjunction with <code>p.verbose_level = \"interactive\"</code>.\n",
60+
"<strong>Note</strong><br>Live-plotting in Jupyter notebooks using <code>p.io.autoplot</code> works best together with <code>p.verbose_level = \"interactive\"</code>.\n",
6161
"</div>"
6262
]
6363
},
@@ -84,17 +84,7 @@
8484
"metadata": {},
8585
"source": [
8686
"<div class=\"alert alert-warning\" markdown=\"1\">\n",
87-
" <strong>Challenge</strong><br>Modify the <code>p.io.home</code> path in the example below to wherever you would like the PtyPy output to be, run the reconstruction and observe all the new files saved to the path specified as <code>p.io.home</code>. You can use <code>ptypy.utils.plot_recon_from_ptyr</code> to look at the MoonFlower reconstruction at different iterations. \n",
88-
"</div>"
89-
]
90-
},
91-
{
92-
"cell_type": "markdown",
93-
"id": "53080c06-2b70-4eaf-9d88-5575c77c13e0",
94-
"metadata": {},
95-
"source": [
96-
"<div class=\"alert alert-success\" markdown=\"1\">\n",
97-
" <strong>Hint</strong><br>You can use shell commands within Jupyter Notebooks to explore the filesystem, i.e. <code>ls /tmp</code> to list all files in /tmp.\n",
87+
" <strong>Challenge</strong><br>Modify the <code>p.io.home</code> path in the example below to wherever you would like the PtyPy output to be, run the reconstruction and observe all the new files saved to the path specified as <code>p.io.home</code>. You can use <code>ptypy.utils.plot_recon_from_ptyr</code> to look at the MoonFlower reconstruction at different iterations based on <code>.ptyr</code> snapshots. \n",
9888
"</div>"
9989
]
10090
},
@@ -204,7 +194,7 @@
204194
"name": "python",
205195
"nbconvert_exporter": "python",
206196
"pygments_lexer": "ipython3",
207-
"version": "3.11.4"
197+
"version": "3.11.7"
208198
}
209199
},
210200
"nbformat": 4,

notebooks/basic_examples/03_scan_models.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,19 @@
1414
"id": "26f5e41d-88c9-4544-a85b-649e29fffbe9",
1515
"metadata": {},
1616
"source": [
17-
"The scan model is one of the core components that defines a ptychography experiment, it creates different data structures such as [Views](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.View), [Containers](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.Container) and [Storages](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.Storage). It also creates the [PODs](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.POD) which link the containers (and views) of probe, object, exit wave and diffraction data. PtyPy offers a range of different scan models\n",
17+
"The scan model is one of the core components that defines a ptychography experiment, it creates different data structures such as [Views](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.View), [Containers](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.Container) and [Storages](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.Storage). It also creates the [PODs](https://ptycho.github.io/ptypy/rst/ptypy.core.html#ptypy.core.classes.POD) which link the containers (and views) of probe, object, exit wave and diffraction data. This figure provides an overview of how PtyPy models an ptychographic experiment\n",
18+
"\n",
19+
"<img src=\"./_assets/ptypy_model.jpg\" alt=\"ptypy-model\" width=\"75%\">\n",
20+
"\n",
21+
"**The PtyPy model in a nutshell:** (a) Experimental sketch of a ptychographic experiment with optics focused on a sample and diffraction measured by a detector. (b) For each experimental view, PtyPy's **pod** captures all relevant properties from probe/object to exit wave, forward proejctor and diffraction data. (c) Example images for single view. (d) Diagram of the network of pods, each connected to a data view, a probe an object view and an exit wave. (e) Each pod has a container for the probe, object and diffraction - these containers are themselves connected underlying storages."
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"id": "751d51d7-f500-4e6e-a37b-2cd1748134c7",
27+
"metadata": {},
28+
"source": [
29+
"PtyPy offers a range of different scan models\n",
1830
"\n",
1931
"- The most commonly used scan model is `Full` and should work in most cases, but might not be suitable for large datasets (>10k frames)\n",
2032
"\n",
@@ -24,7 +36,7 @@
2436
"\n",
2537
"- `Vanilla` is a lightweight scan model that can be useful for simple simulations.\n",
2638
"\n",
27-
"All the `Full` - flavoured models share the same set of [parameters](https://ptycho.github.io/ptypy/rst/parameters.html#scan-full), while `Vanilla` has a much smaller sub-set of [parameters](https://ptycho.github.io/ptypy/rst/parameters.html#scan-vanilla).\n"
39+
"All the `Full` - flavoured models share the same set of [parameters](https://ptycho.github.io/ptypy/rst/parameters.html#scan-full), while `Vanilla` has a much smaller sub-set of [parameters](https://ptycho.github.io/ptypy/rst/parameters.html#scan-vanilla)."
2840
]
2941
},
3042
{
@@ -225,7 +237,7 @@
225237
"name": "python",
226238
"nbconvert_exporter": "python",
227239
"pygments_lexer": "ipython3",
228-
"version": "3.11.4"
240+
"version": "3.11.7"
229241
}
230242
},
231243
"nbformat": 4,

notebooks/basic_examples/04_choosing_engines.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"name": "python",
101101
"nbconvert_exporter": "python",
102102
"pygments_lexer": "ipython3",
103-
"version": "3.9.7"
103+
"version": "3.11.7"
104104
}
105105
},
106106
"nbformat": 4,

notebooks/basic_examples/05_projectional_engines.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
"name": "python",
176176
"nbconvert_exporter": "python",
177177
"pygments_lexer": "ipython3",
178-
"version": "3.9.7"
178+
"version": "3.11.7"
179179
}
180180
},
181181
"nbformat": 4,

notebooks/basic_examples/06_stochastic_engines.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"name": "python",
137137
"nbconvert_exporter": "python",
138138
"pygments_lexer": "ipython3",
139-
"version": "3.9.7"
139+
"version": "3.11.7"
140140
}
141141
},
142142
"nbformat": 4,

notebooks/basic_examples/07_gradient_based_engines.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"name": "python",
143143
"nbconvert_exporter": "python",
144144
"pygments_lexer": "ipython3",
145-
"version": "3.9.7"
145+
"version": "3.11.7"
146146
}
147147
},
148148
"nbformat": 4,
564 KB
Loading

0 commit comments

Comments
 (0)