|
83 | 83 | "metadata": {},
|
84 | 84 | "outputs": [],
|
85 | 85 | "source": [
|
86 |
| - "dp = pxm.load_hspy('SPED_data_of_MgO_nanoparticles_bin2,2,1,1.hdf5',\n", |
| 86 | + "dp = pxm.load_hspy('SPED_MgO.hdf5',\n", |
87 | 87 | " lazy=False,\n",
|
88 | 88 | " assign_to='electron_diffraction2d')"
|
89 | 89 | ]
|
|
96 | 96 | ]
|
97 | 97 | },
|
98 | 98 | {
|
99 |
| - "cell_type": "code", |
100 |
| - "execution_count": null, |
| 99 | + "cell_type": "markdown", |
101 | 100 | "metadata": {},
|
102 |
| - "outputs": [], |
103 | 101 | "source": [
|
104 | 102 | "dp.plot(cmap='magma_r')"
|
105 | 103 | ]
|
|
138 | 136 | "cell_type": "markdown",
|
139 | 137 | "metadata": {},
|
140 | 138 | "source": [
|
141 |
| - "Find the position of the direct beam in background subtracted data." |
| 139 | + "Find the position of the direct beam in the background subtracted data." |
142 | 140 | ]
|
143 | 141 | },
|
144 | 142 | {
|
|
192 | 190 | "dp_rb.set_scan_calibration(scale_real)"
|
193 | 191 | ]
|
194 | 192 | },
|
| 193 | + { |
| 194 | + "cell_type": "code", |
| 195 | + "execution_count": null, |
| 196 | + "metadata": {}, |
| 197 | + "outputs": [], |
| 198 | + "source": [ |
| 199 | + "dp_rb.save('dp_rb_final.hdf5')" |
| 200 | + ] |
| 201 | + }, |
195 | 202 | {
|
196 | 203 | "cell_type": "markdown",
|
197 | 204 | "metadata": {},
|
|
260 | 267 | ]
|
261 | 268 | },
|
262 | 269 | {
|
263 |
| - "cell_type": "code", |
264 |
| - "execution_count": null, |
| 270 | + "cell_type": "markdown", |
265 | 271 | "metadata": {},
|
266 |
| - "outputs": [], |
267 | 272 | "source": [
|
268 |
| - "dp_padded = np.zeros((dp.data.shape[0],dp.data.shape[1],\n", |
269 |
| - " dp.data.shape[2]+12,dp.data.shape[2]+12))\n", |
270 |
| - "dp_padded[:,:,6:dp.data.shape[2]+6,6:dp.data.shape[2]+6] = dp_rb.data\n", |
271 |
| - "dp_padded = pxm.ElectronDiffraction2D(dp_padded)\n", |
272 |
| - "dp_padded.set_diffraction_calibration(scale)\n", |
273 |
| - "dp_padded.set_scan_calibration(scale_real)" |
| 273 | + "Filter away the peaks at the edges of the patterns, since it is not possible to get a correct sub-pixel refinement of these peaks. " |
274 | 274 | ]
|
275 | 275 | },
|
276 | 276 | {
|
277 |
| - "cell_type": "markdown", |
278 |
| - "metadata": {}, |
| 277 | + "cell_type": "code", |
| 278 | + "execution_count": null, |
| 279 | + "metadata": { |
| 280 | + "scrolled": false |
| 281 | + }, |
| 282 | + "outputs": [], |
279 | 283 | "source": [
|
280 |
| - "Padding is used so that peaks at the edges of the diffraction patterns are treated correctly." |
| 284 | + "peaks_filtered = peaks.filter_vectors_detector_edge(exclude_width=74)" |
281 | 285 | ]
|
282 | 286 | },
|
283 | 287 | {
|
284 | 288 | "cell_type": "code",
|
285 | 289 | "execution_count": null,
|
286 | 290 | "metadata": {
|
287 |
| - "scrolled": false |
| 291 | + "scrolled": true |
288 | 292 | },
|
289 | 293 | "outputs": [],
|
290 | 294 | "source": [
|
291 |
| - "refine_gen = SubpixelrefinementGenerator(dp_padded, peaks)\n", |
| 295 | + "refine_gen = SubpixelrefinementGenerator(dp_rb, peaks_filtered)\n", |
292 | 296 | "peaks_refined = DiffractionVectors(\n",
|
293 | 297 | " refine_gen.center_of_mass_method(square_size=4))\n",
|
294 | 298 | "peaks_refined.axes_manager.set_signal_dimension(0)"
|
|
392 | 396 | "metadata": {},
|
393 | 397 | "outputs": [],
|
394 | 398 | "source": [
|
395 |
| - "Gs = unique_peaks.filter_vector_magnitudes(\n", |
| 399 | + "Gs = unique_peaks.filter_vectors_magnitudes(\n", |
396 | 400 | " min_magnitude=10*scale, max_magnitude=np.inf)\n",
|
397 | 401 | "print(np.shape(Gs)[0], ' unique vectors.')"
|
398 | 402 | ]
|
|
527 | 531 | "metadata": {},
|
528 | 532 | "outputs": [],
|
529 | 533 | "source": [
|
530 |
| - "i = 26\n", |
| 534 | + "i = 25\n", |
531 | 535 | "sep_i = separate_watershed(\n",
|
532 | 536 | " VDFs.inav[i].data, min_distance=min_distance, min_size=min_size,\n",
|
533 | 537 | " max_size=max_size, max_number_of_grains=max_number_of_grains,\n",
|
|
0 commit comments