bobleesj commited on
Commit
79d40fa
·
verified ·
1 Parent(s): 2dc9add

docs: slim card to provenance + one pointer to quantem.widget docs, license MIT

Browse files
Files changed (1) hide show
  1. README.md +25 -91
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- license: cc-by-4.0
3
  tags:
4
  - electron-microscopy
5
  - 4D-STEM
@@ -10,66 +10,37 @@ pretty_name: quantem-data
10
 
11
  # quantem-data
12
 
13
- Reference electron-microscopy datasets for browsing and learning. Open in your browser via [quantem.widget](https://github.com/bobleesj/quantem.widget) **no quantem.live install needed**.
 
 
14
 
15
- Two buckets:
16
-
17
- - **`4dstem/`** 4D-STEM acquisitions. `_npy_bin*` variants are pre-binned NumPy files for fast workshop / Colab demos; the originals are full Arina h5 bundles.
18
- - **`haadf/`** — HAADF survey images. `_npy` variants are pre-cooked NumPy + a `meta.json` sidecar carrying sampling + optics; the originals are full Velox EMD files.
19
-
20
- A ready-to-run notebook sits at `notebooks/show4dstem_colab.ipynb` in this repo.
21
-
22
- ## One-click workshop notebook (Google Colab)
23
-
24
- [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/bobleesj/54864ce5b2a6f0a4fd5ae1e5d5719b45/show4dstem_colab.ipynb)
25
-
26
- It does the full pipeline in 7 cells: install `quantem.widget` (TestPyPI rc) + `quantem` (dev fork branch), download the pre-binned NumPy bundle from this dataset, wrap it as `Dataset4dstem.from_tensor`, render with `Show4DSTEM` in your browser via WebGPU. No CUDA on Colab. No quantem.live.
27
-
28
- [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/bobleesj/a05a90185c6cddbb331342cae6d7e9c1/berk_workshop_v1.ipynb)
29
-
30
- **Workshop v1** — real gold 4D-STEM: browse + bright field + dark field + probe + DPC, all on the Colab T4. No `quantem.live`, no local install. The notebook lives at `notebooks/berk_workshop_v1.ipynb` in this repo and on the `berk-workshop` branch of `bobleesj/quantem`.
31
-
32
- ## Workshop quick start — Show4DSTEM (any Jupyter)
33
 
34
  ```python
35
- !pip install -q --pre --extra-index-url https://test.pypi.org/simple/ quantem.widget huggingface_hub
36
- !pip install -q git+https://github.com/electronmicroscopy/quantem.git@dev
37
-
38
- import os, json, numpy as np, torch
39
- from huggingface_hub import snapshot_download
40
- from quantem.core.datastructures import Dataset4dstem
41
  from quantem.widget import Show4DSTEM
 
42
 
43
- folder = snapshot_download("bobleesj/quantem-data", repo_type="dataset",
44
- allow_patterns=["4dstem/gold_512_npy_bin8/*"])
45
- asset = os.path.join(folder, "4dstem", "gold_512_npy_bin8")
46
- data = np.load(os.path.join(asset, "data.npy"))
47
- meta = json.load(open(os.path.join(asset, "meta.json")))
48
-
49
- dset = Dataset4dstem.from_tensor(torch.from_numpy(data),
50
- sampling=meta["sampling"], units=meta["units"])
51
- Show4DSTEM(dset)
52
  ```
53
 
54
- ## Workshop quick start Show2D for HAADF
55
-
56
- ```python
57
- import os, json, numpy as np, torch
58
- from huggingface_hub import snapshot_download
59
- from quantem.widget import Show2D
60
-
61
- folder = snapshot_download("bobleesj/quantem-data", repo_type="dataset",
62
- allow_patterns=["haadf/gold_haadf_npy/*"])
63
- asset = os.path.join(folder, "haadf", "gold_haadf_npy")
64
- img = np.load(os.path.join(asset, "data.npy"))
65
- meta = json.load(open(os.path.join(asset, "meta.json")))
66
 
67
- Show2D(torch.from_numpy(img), sampling=meta["sampling"], units=meta["units"])
68
- ```
 
 
69
 
70
  ## Acquisition parameters
71
 
72
- The 20260423 drift session's optics are **confirmed via the session's own HAADF EMD** (`AccelerationVoltage`, `BeamConvergence`, `CameraLength`). 4D-STEM `scan_sampling` is an **operator pattern from a sibling SSB session** — the drift acquisition itself was never per-file calibrated.
 
 
 
73
 
74
  | dataset | voltage | probe | CL | scan | scan sampling | det pitch | mag |
75
  |---|---|---|---|---|---|---|---|
@@ -82,45 +53,8 @@ The 20260423 drift session's optics are **confirmed via the session's own HAADF
82
 
83
  ✓ = confirmed via EMD/yaml. `(op)` = operator pattern, not file-certified.
84
 
85
- ## Datasets at a glance
86
-
87
- | name | kind | shape | dtype | size | use |
88
- |---|---|---|---|---|---|
89
- | `4dstem/gold_512_npy_bin8/` | NumPy bundle | (512, 512, 24, 24) | uint16 | ~302 MB | workshop / Colab demo |
90
- | `4dstem/gold_512_npy_bin4/` | NumPy bundle | (512, 512, 48, 48) | uint16 | ~1.2 GB | sharper workshop version |
91
- | `4dstem/gold_512/` | Arina h5 | (512, 512, 192, 192) | uint16 | ~5 GB | power user |
92
- | `4dstem/gold_30mrad1.3mx04` … `09` | Arina h5 | varies | uint16 | ~5 GB each | series demo |
93
- | `haadf/gold_haadf_npy/` | NumPy bundle | (4096, 4096) | uint16 | ~34 MB | workshop / Colab Show2D |
94
- | `haadf/gold_haadf.emd` | Velox EMD | (4096, 4096) | uint16 | a few MB | full optics carrier |
95
-
96
- Each `_npy*` bundle ships a `meta.json` next to `data.npy`: shape, dtype, sampling, units, voltage / probe / CL (with provenance flags) when known.
97
-
98
- ## Power-user path (full data, GPU decompression)
99
-
100
- Got an NVIDIA GPU and want the full Arina h5 / Velox EMD path? Install [`quantem.live`](https://github.com/bobleesj/quantem.live):
101
-
102
- ```python
103
- from quantem.live import io
104
- from quantem.widget import Show4DSTEM, Show2D
105
- import torch
106
-
107
- folder = io.download("gold_512")
108
- result = io.load(io.discover_masters(folder)[0], det_bin=2)
109
- Show4DSTEM(torch.from_dlpack(result.data))
110
-
111
- ds = io.read_image(io.download("gold_haadf"))
112
- Show2D(ds)
113
- ```
114
-
115
- ## Memory (VRAM) for the full h5
116
-
117
- | `det_bin` | detector | loaded | peak VRAM | fits 16 GB? |
118
- |---|---|---|---|---|
119
- | 1 | 192×192 | 18 GB | ~25 GB | no |
120
- | **2** | 96×96 | 4.5 GB | **~6.9 GB** | **yes** |
121
- | 4 | 48×48 | 1.1 GB | ~2.2 GB | yes |
122
- | 8 | 24×24 | 0.3 GB | ~0.5 GB | yes |
123
-
124
- ## Licence
125
 
126
- CC-BY-4.0. Cite quantem.live / quantem.widget if you use these in a publication.
 
 
 
1
  ---
2
+ license: mit
3
  tags:
4
  - electron-microscopy
5
  - 4D-STEM
 
10
 
11
  # quantem-data
12
 
13
+ Reference electron-microscopy datasets (gold 4D-STEM and HAADF) for browsing
14
+ and learning with [quantem.widget](https://github.com/bobleesj/quantem.widget).
15
+ This repo just hosts the data — all instructions live in one place:
16
 
17
+ **How to download and use this data:** follow the
18
+ [Download data tutorial](https://bobleesj.github.io/quantem.widget/tutorials/download_data.html)
19
+ in the quantem.widget docs. One call per dataset:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ```python
 
 
 
 
 
 
22
  from quantem.widget import Show4DSTEM
23
+ from quantem.widget.datasets import show4dstem_gold
24
 
25
+ Show4DSTEM(show4dstem_gold())
 
 
 
 
 
 
 
 
26
  ```
27
 
28
+ Layout: `4dstem/` holds Arina h5 originals plus pre-binned `_npy_bin*` NumPy
29
+ bundles; `haadf/` holds Velox EMD originals plus `_npy` bundles. Every `_npy*`
30
+ bundle ships a `meta.json` (shape, dtype, sampling, units, optics) next to
31
+ `data.npy`.
 
 
 
 
 
 
 
 
32
 
33
+ Workshop notebooks (Google Colab, no local install):
34
+ [Show4DSTEM demo](https://colab.research.google.com/gist/bobleesj/54864ce5b2a6f0a4fd5ae1e5d5719b45/show4dstem_colab.ipynb)
35
+ ·
36
+ [Workshop v1](https://colab.research.google.com/gist/bobleesj/a05a90185c6cddbb331342cae6d7e9c1/berk_workshop_v1.ipynb)
37
 
38
  ## Acquisition parameters
39
 
40
+ The 20260423 drift session's optics are **confirmed via the session's own
41
+ HAADF EMD** (`AccelerationVoltage`, `BeamConvergence`, `CameraLength`).
42
+ 4D-STEM `scan_sampling` is an **operator pattern from a sibling SSB session**
43
+ — the drift acquisition itself was never per-file calibrated.
44
 
45
  | dataset | voltage | probe | CL | scan | scan sampling | det pitch | mag |
46
  |---|---|---|---|---|---|---|---|
 
53
 
54
  ✓ = confirmed via EMD/yaml. `(op)` = operator pattern, not file-certified.
55
 
56
+ ## License
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ MIT free to use for anything. Citing
59
+ [quantem.widget](https://github.com/bobleesj/quantem.widget) in publications
60
+ is appreciated.