Skip to content

Commit

Permalink
Updated links and checked X-ray examples
Browse files Browse the repository at this point in the history
  • Loading branch information
daurer committed Jun 10, 2024
1 parent 3bdf15e commit 44270f1
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 142 deletions.
26 changes: 13 additions & 13 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ The table below gives an overview of all examples with associated data and a lin
| [](notebooks/basic_examples/06_stochastic_engines) | No Data Required | - | - |
| [](notebooks/basic_examples/07_gradient_based_engines) | No Data Required | - | - |
| **Experimental X-ray Data** |
| [](notebooks/experimental_xray_data/00_data_loading) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/01_working_with_large_data) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/02_fixing_data_issues) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/03_partial_coherence) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/04_position_refinement) | [dls_i14_test_structure.zip](https://zenodo.org/records/11501765/files/dls_i14_test_structure.zip?download=1) | 3.68 GB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/05_missing_detector_frames) | [dls_i08_nanogold_raster.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_raster.zip?download=1) | 993 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/06_testing_different_algorithms) | [dls_i13_butterfly.zip](https://zenodo.org/records/11501765/files/dls_i13_butterfly.zip?download=1) | 286 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/07_multi_gpu) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/experimental_xray_data/00_data_loading) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/01_working_with_large_data) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/02_fixing_data_issues) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/03_partial_coherence) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/04_position_refinement) | [dls_i14_test_structure.zip](https://zenodo.org/records/11501765/files/dls_i14_test_structure.zip?download=1) | 3.68 GB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/05_missing_detector_frames) | [dls_i08_nanogold_raster.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_raster.zip?download=1) | 993 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/06_testing_different_algorithms) | [dls_i13_butterfly.zip](https://zenodo.org/records/11501765/files/dls_i13_butterfly.zip?download=1) | 286 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/experimental_xray_data/07_multi_gpu) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| **Electron Ptychography Data** |
| [](notebooks/ptychography_with_electrons/00_electron_data) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/ptychography_with_electrons/01_chaining_multiple_engines) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/ptychography_with_electrons/02_start_from_previous_reconstruction) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/ptychography_with_electrons/00_electron_data) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/ptychography_with_electrons/01_chaining_multiple_engines) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/ptychography_with_electrons/02_start_from_previous_reconstruction) | [dls_epsic_80kV_graphene.zip](https://zenodo.org/records/11501765/files/dls_epsic_80kV_graphene.zip?download=1) | 270 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| **Supplementary Examples** |
| [](notebooks/supplementary_examples/00_nearfield_ptychography) | esrf_id16_AlNi_nearfield.zip | 532 MB | TBA |
| [](notebooks/supplementary_examples/01_object_regularisation) | esrf_id16_AlNi_nearfield.zip | 532 MB | TBA |
| [](notebooks/supplementary_examples/02_live_visualisation) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/supplementary_examples/02_live_visualisation) | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | 1.11 GB | [doi](https://doi.org/10.5281/zenodo.11501765) |
| [](notebooks/supplementary_examples/03_simulating_data) | No Data Required | - | - |
| [](notebooks/supplementary_examples/04_modified_initial_probe) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://zenodo.org/doi/10.5281/zenodo.11501764) |
| [](notebooks/supplementary_examples/04_modified_initial_probe) | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | 126 MB | [doi](https://doi.org/10.5281/zenodo.11501765) |


## Jupyter Lab/Notebooks
Expand Down
17 changes: 10 additions & 7 deletions notebooks/experimental_xray_data/00_data_loading.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"\n",
"| **Data file** | **Type** | **Download** | **Courtesy of** | **Reference** |\n",
"| :- | :- | :- | :-: | :-: |\n",
"| dls_i08_nanogold_small.h5 | Raw | small_data.zip | Majid Kazemian | [doi](https://10.5281/zenodo.11501765) |\n",
"| dls_i08_nanogold_small.h5 | Raw | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | Majid Kazemian | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"\n",
"In this example, we use an experimental data set collected at the I08-1 instrument at the Diamond Light Source on a test sample (gold nanostructures deposited on a carbon film). A subset of the experimental data including some meta information has been saved in an HDF5 file named \"dls_i08_nanogold_small.h5\" that was specifically created for the purpose of this tutorial. We can use the following code\n",
"```python\n",
Expand Down Expand Up @@ -57,7 +57,9 @@
"cell_type": "code",
"execution_count": null,
"id": "e8d3874c",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import h5py, os\n",
Expand Down Expand Up @@ -188,7 +190,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b0743148",
"metadata": {},
Expand All @@ -210,7 +211,9 @@
"cell_type": "code",
"execution_count": null,
"id": "8faefcc7-8b44-426f-8246-c3a93e471942",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import ptypy, os\n",
Expand Down Expand Up @@ -318,9 +321,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": {
Expand All @@ -332,7 +335,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
28 changes: 11 additions & 17 deletions notebooks/experimental_xray_data/01_working_with_large_data.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "413a3048-7624-4fa6-a0e5-a2d92e55f9d0",
"metadata": {},
Expand All @@ -21,7 +20,7 @@
"\n",
"| **Data file** | **Type** | **Download** | **Courtesy of** | **Reference** |\n",
"| :- | :- | :- | :-: | :-: | \n",
"| i08-1-5776_cropped.h5 | Raw | dls_i08_nanogold_spiral.zip | Majid Kazemian | [doi](https://10.5281/zenodo.11501765) |\n",
"| i08-1-5776_cropped.h5 | Raw | [dls_i08_nanogold_spiral.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_spiral.zip?download=1) | Majid Kazemian | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"\n",
"At the I08-1 instrument at the Diamond Light Source, raw data is written into HDF5/Nexus files. As an example, we can look at the original raw data from the nanogold test sample which is stored in ```\"dls_i08_nanogold_spiral/i08-1-5776_cropped.h5\"``` and inspect the relevant entries\n",
"```python\n",
Expand Down Expand Up @@ -60,7 +59,9 @@
"cell_type": "code",
"execution_count": null,
"id": "f12c532f-6e99-4855-b11b-507ca27e2264",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import h5py, os\n",
Expand Down Expand Up @@ -201,7 +202,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "64f75030-3d41-4665-bb27-b66305fd2cf2",
"metadata": {},
Expand All @@ -223,7 +223,9 @@
"cell_type": "code",
"execution_count": null,
"id": "ee3cbe0e-7393-4e07-8e6c-a0063eb55dbe",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import ptypy, os\n",
Expand All @@ -233,7 +235,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",
Expand Down Expand Up @@ -353,21 +355,13 @@
"# Run reconstruction\n",
"P = ptypy.core.Ptycho(p,level=5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f40ea151-03f7-43fe-9651-80def27f3c89",
"metadata": {},
"outputs": [],
"source": []
}
],
"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": {
Expand All @@ -379,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
15 changes: 8 additions & 7 deletions notebooks/experimental_xray_data/02_fixing_data_issues.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-info\" markdown=\"1\">\n",
"<strong>Note</strong><br>Since PtyPy 0.8.1 the megapixel limit has been increase to 100M therefore you might run out of memory before seeing this RuntimeError. \n",
"<strong>Note</strong><br>Since PtyPy 0.8.1 the megapixel limit has been increased to 100M therefore you might run out of memory before seeing this RuntimeError. \n",
"</div>"
]
},
Expand All @@ -35,7 +35,7 @@
"\n",
"| **Data file** | **Type** | **Download** | **Courtesy of** | **Reference** |\n",
"| :- | :- | :- | :-: | :-: |\n",
"| dls_i08_nanogold_issue.h5 | Raw data | small_data.zip | Majid Kazemian | [doi](https://10.5281/zenodo.11501765) |\n",
"| dls_i08_nanogold_issue.h5 | Raw data | [small_data.zip](https://zenodo.org/records/11501765/files/small_data.zip?download=1) | Majid Kazemian | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"\n",
"Based on the small I08-1 data set that was used in the tutorial on [Loading HDF5 Data](./00_data_loading.ipynb) we have a created a new file named ```\"dls_i08_nanogold_issue.h5\"``` for which the coordinate system has been modified sligthly. The task for this tutorial is to figure out the correct ```orientation``` based on the data that has been provided. As a starting point, we set it to zero.\n",
"\n",
Expand All @@ -59,7 +59,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f5dd1b69-425a-41bf-b9a3-1ba2a46579a1",
"metadata": {},
Expand All @@ -81,7 +80,9 @@
"cell_type": "code",
"execution_count": null,
"id": "8faefcc7-8b44-426f-8246-c3a93e471942",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import ptypy, os\n",
Expand Down Expand Up @@ -177,9 +178,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": {
Expand All @@ -191,7 +192,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
75 changes: 13 additions & 62 deletions notebooks/experimental_xray_data/03_partial_coherence.ipynb

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions notebooks/experimental_xray_data/04_position_refinement.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"\n",
"| **Data file** | **Type** | **Download** | **Courtesy of** | **Reference** |\n",
"| :- | :- | :- | :-: | :-: |\n",
"| i14-logo-128.h5 | Raw | dls_i14_test_structure.zip | Miguel Gomez Gonzalez | [doi](https://10.5281/zenodo.11501765) |\n",
"| scan_103937.ptyr | Reconstruction | dls_i14_test_structure.zip | Miguel Gomez Gonzalez | [doi](https://10.5281/zenodo.11501765) |\n",
"| i14-logo-128.h5 | Raw | [dls_i14_test_structure.zip](https://zenodo.org/records/11501765/files/dls_i14_test_structure.zip?download=1) | Miguel Gomez Gonzalez | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"| scan_103937.ptyr | Reconstruction | [dls_i14_test_structure.zip](https://zenodo.org/records/11501765/files/dls_i14_test_structure.zip?download=1) | Miguel Gomez Gonzalez | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"\n",
"\n",
"In this example, we are using a test dataset that has been collected at the I14 instrument at the Diamond Light Source. The raw data has been collected with a MediPix3 detector and was stored in an HDF5/Nexus file with the following relevant entries for the intensities and scan positions\n",
Expand Down Expand Up @@ -192,7 +192,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "28be44d4-4715-44bb-8d5e-1caae987f2d0",
"metadata": {},
Expand All @@ -214,7 +213,9 @@
"cell_type": "code",
"execution_count": null,
"id": "ee3cbe0e-7393-4e07-8e6c-a0063eb55dbe",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import ptypy, os\n",
Expand Down Expand Up @@ -365,9 +366,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": {
Expand All @@ -379,7 +380,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
28 changes: 20 additions & 8 deletions notebooks/experimental_xray_data/05_missing_detector_frames.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"\n",
"| **Data file** | **Type** | **Download** | **Courtesy of** | **Refernce** |\n",
"| :- | :- | :- | :-: | :-: | \n",
"| i08-1-5778_cropped.h5 | Raw data | dls_i08_nanogold_raster.zip | Majid Kazemian | [doi](https://10.5281/zenodo.11501765) |\n",
"| i08-1-5778_cropped.h5 | Raw data | [dls_i08_nanogold_raster.zip](https://zenodo.org/records/11501765/files/dls_i08_nanogold_raster.zip?download=1) | Majid Kazemian | [DOI](https://doi.org/10.5281/zenodo.11501765) |\n",
"\n",
"We are again revisting nanogold data from I08-1, similar to the data used in [Working With Large Data](./01_working_with_large_data.ipynb) but this time collected with a raster grid scan (instead of a spiral scan). The raw data is located in the HDF5/Nexus file ```\"dls_i08_nanogold_raster/i08-1-5778_cropped.h5\"``` with the following relevant entries\n",
"\n",
Expand Down Expand Up @@ -143,6 +143,16 @@
"![](./_assets/i08_nanogold_framefilter.png)"
]
},
{
"cell_type": "markdown",
"id": "4956626c-a6f7-4c0a-9cf5-cac4598e850c",
"metadata": {},
"source": [
"<div class=\"alert alert-warning\" markdown=\"1\">\n",
" <strong>Challenge</strong><br>Compare reconstructions without and with using the framefilter to exclude the missing detector frame.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "bc8f7e85-7830-406d-813f-89aae9f47459",
Expand All @@ -155,7 +165,9 @@
"cell_type": "code",
"execution_count": null,
"id": "afaaf9cc-6d5e-487c-8980-aa9a20fa19d0",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import ptypy, os\n",
Expand Down Expand Up @@ -261,9 +273,9 @@
"p.scans.scan_00.data.darkfield.file = path_to_data\n",
"p.scans.scan_00.data.darkfield.key = \"dark\"\n",
"\n",
"p.scans.scan_00.data.framefilter = u.Param()\n",
"p.scans.scan_00.data.framefilter.file = path_to_data\n",
"p.scans.scan_00.data.framefilter.key = \"datasum\"\n",
"# p.scans.scan_00.data.framefilter = u.Param()\n",
"# p.scans.scan_00.data.framefilter.file = path_to_data\n",
"# p.scans.scan_00.data.framefilter.key = \"datasum\"\n",
"\n",
"p.scans.scan_00.data.energy = 0.710\n",
"p.scans.scan_00.data.distance = 0.072\n",
Expand Down Expand Up @@ -298,9 +310,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": {
Expand All @@ -312,7 +324,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 44270f1

Please sign in to comment.