Skip to content

Commit 57b522e

Browse files
authored
Merge pull request #1 from pc494/dnj-rotation-calibration
Updated strain mapping for 0.9.0
2 parents 0a50c91 + 48562fd commit 57b522e

File tree

1 file changed

+36
-227
lines changed

1 file changed

+36
-227
lines changed

Strain Mapping.ipynb

Lines changed: 36 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"cell_type": "markdown",
2626
"metadata": {},
2727
"source": [
28-
"All functionality has been checked to run using pyxem-0.8.0"
28+
"All functionality has been checked to run using pyxem-0.9.0"
2929
]
3030
},
3131
{
@@ -60,7 +60,7 @@
6060
},
6161
{
6262
"cell_type": "code",
63-
"execution_count": 4,
63+
"execution_count": null,
6464
"metadata": {},
6565
"outputs": [],
6666
"source": [
@@ -83,7 +83,7 @@
8383
},
8484
{
8585
"cell_type": "code",
86-
"execution_count": 2,
86+
"execution_count": null,
8787
"metadata": {},
8888
"outputs": [],
8989
"source": [
@@ -101,7 +101,7 @@
101101
},
102102
{
103103
"cell_type": "code",
104-
"execution_count": 5,
104+
"execution_count": null,
105105
"metadata": {},
106106
"outputs": [],
107107
"source": [
@@ -119,7 +119,7 @@
119119
},
120120
{
121121
"cell_type": "code",
122-
"execution_count": 7,
122+
"execution_count": null,
123123
"metadata": {},
124124
"outputs": [],
125125
"source": [
@@ -139,52 +139,9 @@
139139
},
140140
{
141141
"cell_type": "code",
142-
"execution_count": 9,
143-
"metadata": {},
144-
"outputs": [
145-
{
146-
"data": {
147-
"application/vnd.jupyter.widget-view+json": {
148-
"model_id": "697e10b675214c0382d239600b84d9d1",
149-
"version_major": 2,
150-
"version_minor": 0
151-
},
152-
"text/plain": [
153-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
154-
]
155-
},
156-
"metadata": {},
157-
"output_type": "display_data"
158-
},
159-
{
160-
"name": "stdout",
161-
"output_type": "stream",
162-
"text": [
163-
"\n"
164-
]
165-
},
166-
{
167-
"data": {
168-
"application/vnd.jupyter.widget-view+json": {
169-
"model_id": "0ac5ff29514e45658c370074e0a89782",
170-
"version_major": 2,
171-
"version_minor": 0
172-
},
173-
"text/plain": [
174-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
175-
]
176-
},
177-
"metadata": {},
178-
"output_type": "display_data"
179-
},
180-
{
181-
"name": "stdout",
182-
"output_type": "stream",
183-
"text": [
184-
"\n"
185-
]
186-
}
187-
],
142+
"execution_count": null,
143+
"metadata": {},
144+
"outputs": [],
188145
"source": [
189146
"dp = pxm.ElectronDiffraction2D((np.asarray([[pattern,patternd],[pattern,pattern]])))\n",
190147
"\n",
@@ -208,7 +165,7 @@
208165
},
209166
{
210167
"cell_type": "code",
211-
"execution_count": 10,
168+
"execution_count": null,
212169
"metadata": {},
213170
"outputs": [],
214171
"source": [
@@ -231,7 +188,7 @@
231188
},
232189
{
233190
"cell_type": "code",
234-
"execution_count": 11,
191+
"execution_count": null,
235192
"metadata": {},
236193
"outputs": [],
237194
"source": [
@@ -247,7 +204,7 @@
247204
},
248205
{
249206
"cell_type": "code",
250-
"execution_count": 12,
207+
"execution_count": null,
251208
"metadata": {},
252209
"outputs": [],
253210
"source": [
@@ -265,24 +222,9 @@
265222
},
266223
{
267224
"cell_type": "code",
268-
"execution_count": 13,
269-
"metadata": {},
270-
"outputs": [
271-
{
272-
"name": "stdout",
273-
"output_type": "stream",
274-
"text": [
275-
"Components\tParameter\tValue\n",
276-
"ScalableReferencePattern\n",
277-
"\t\td11\t1\n",
278-
"\t\td12\t0\n",
279-
"\t\td21\t0\n",
280-
"\t\td22\t1\n",
281-
"\t\tt1\t0\n",
282-
"\t\tt2\t0\n"
283-
]
284-
}
285-
],
225+
"execution_count": null,
226+
"metadata": {},
227+
"outputs": [],
286228
"source": [
287229
"m.print_current_values()"
288230
]
@@ -296,31 +238,9 @@
296238
},
297239
{
298240
"cell_type": "code",
299-
"execution_count": 14,
300-
"metadata": {},
301-
"outputs": [
302-
{
303-
"data": {
304-
"application/vnd.jupyter.widget-view+json": {
305-
"model_id": "25d7a973e8e14f9e9d169b86c9ec7603",
306-
"version_major": 2,
307-
"version_minor": 0
308-
},
309-
"text/plain": [
310-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
311-
]
312-
},
313-
"metadata": {},
314-
"output_type": "display_data"
315-
},
316-
{
317-
"name": "stdout",
318-
"output_type": "stream",
319-
"text": [
320-
"\n"
321-
]
322-
}
323-
],
241+
"execution_count": null,
242+
"metadata": {},
243+
"outputs": [],
324244
"source": [
325245
"m.multifit()"
326246
]
@@ -334,7 +254,7 @@
334254
},
335255
{
336256
"cell_type": "code",
337-
"execution_count": 15,
257+
"execution_count": null,
338258
"metadata": {},
339259
"outputs": [],
340260
"source": [
@@ -350,31 +270,9 @@
350270
},
351271
{
352272
"cell_type": "code",
353-
"execution_count": 16,
354-
"metadata": {},
355-
"outputs": [
356-
{
357-
"data": {
358-
"application/vnd.jupyter.widget-view+json": {
359-
"model_id": "812774bb8f3f4f3c9e2a192b22b9aef4",
360-
"version_major": 2,
361-
"version_minor": 0
362-
},
363-
"text/plain": [
364-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
365-
]
366-
},
367-
"metadata": {},
368-
"output_type": "display_data"
369-
},
370-
{
371-
"name": "stdout",
372-
"output_type": "stream",
373-
"text": [
374-
"\n"
375-
]
376-
}
377-
],
273+
"execution_count": null,
274+
"metadata": {},
275+
"outputs": [],
378276
"source": [
379277
"R, U = disp_grad.polar_decomposition()"
380278
]
@@ -388,52 +286,9 @@
388286
},
389287
{
390288
"cell_type": "code",
391-
"execution_count": 17,
392-
"metadata": {},
393-
"outputs": [
394-
{
395-
"data": {
396-
"application/vnd.jupyter.widget-view+json": {
397-
"model_id": "ec20ddd75d7e4c98a2d0e67ba04355c3",
398-
"version_major": 2,
399-
"version_minor": 0
400-
},
401-
"text/plain": [
402-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
403-
]
404-
},
405-
"metadata": {},
406-
"output_type": "display_data"
407-
},
408-
{
409-
"name": "stdout",
410-
"output_type": "stream",
411-
"text": [
412-
"\n"
413-
]
414-
},
415-
{
416-
"data": {
417-
"application/vnd.jupyter.widget-view+json": {
418-
"model_id": "e83251c647b94deeb9cb8ecffac3cf0d",
419-
"version_major": 2,
420-
"version_minor": 0
421-
},
422-
"text/plain": [
423-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
424-
]
425-
},
426-
"metadata": {},
427-
"output_type": "display_data"
428-
},
429-
{
430-
"name": "stdout",
431-
"output_type": "stream",
432-
"text": [
433-
"\n"
434-
]
435-
}
436-
],
289+
"execution_count": null,
290+
"metadata": {},
291+
"outputs": [],
437292
"source": [
438293
"strain_map = disp_grad.get_strain_maps()\n",
439294
"strain_map.plot(cmap='seismic',vmax=0.04,vmin=-0.04)"
@@ -455,7 +310,7 @@
455310
},
456311
{
457312
"cell_type": "code",
458-
"execution_count": 18,
313+
"execution_count": null,
459314
"metadata": {},
460315
"outputs": [],
461316
"source": [
@@ -473,7 +328,7 @@
473328
},
474329
{
475330
"cell_type": "code",
476-
"execution_count": 19,
331+
"execution_count": null,
477332
"metadata": {},
478333
"outputs": [],
479334
"source": [
@@ -492,31 +347,9 @@
492347
},
493348
{
494349
"cell_type": "code",
495-
"execution_count": 20,
496-
"metadata": {},
497-
"outputs": [
498-
{
499-
"data": {
500-
"application/vnd.jupyter.widget-view+json": {
501-
"model_id": "3f5e512223de46b79d4ade272988e18b",
502-
"version_major": 2,
503-
"version_minor": 0
504-
},
505-
"text/plain": [
506-
"HBox(children=(IntProgress(value=0, max=4), HTML(value='')))"
507-
]
508-
},
509-
"metadata": {},
510-
"output_type": "display_data"
511-
},
512-
{
513-
"name": "stdout",
514-
"output_type": "stream",
515-
"text": [
516-
"\n"
517-
]
518-
}
519-
],
350+
"execution_count": null,
351+
"metadata": {},
352+
"outputs": [],
520353
"source": [
521354
"spg = SubpixelrefinementGenerator(dp,np.asarray([x_peak,y_peak]))\n",
522355
"Vs = spg.center_of_mass_method(6)"
@@ -531,42 +364,18 @@
531364
},
532365
{
533366
"cell_type": "code",
534-
"execution_count": 21,
535-
"metadata": {},
536-
"outputs": [
537-
{
538-
"ename": "TypeError",
539-
"evalue": "'DiffractionVectors' object is not subscriptable",
540-
"output_type": "error",
541-
"traceback": [
542-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
543-
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
544-
"\u001b[0;32m<ipython-input-21-6176deb6744b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mD\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_DisplacementGradientMap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msignals\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSignal2D\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mVs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mVs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
545-
"\u001b[0;31mTypeError\u001b[0m: 'DiffractionVectors' object is not subscriptable"
546-
]
547-
}
548-
],
367+
"execution_count": null,
368+
"metadata": {},
369+
"outputs": [],
549370
"source": [
550-
"D = get_DisplacementGradientMap(hs.signals.Signal2D(Vs), Vs[0,0])"
371+
"D = get_DisplacementGradientMap(hs.signals.Signal2D(Vs), Vs.data[0,0])"
551372
]
552373
},
553374
{
554375
"cell_type": "code",
555-
"execution_count": 22,
556-
"metadata": {},
557-
"outputs": [
558-
{
559-
"ename": "NameError",
560-
"evalue": "name 'D' is not defined",
561-
"output_type": "error",
562-
"traceback": [
563-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
564-
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
565-
"\u001b[0;32m<ipython-input-22-588d297aa93a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mstrain_map\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mD\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_strain_maps\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
566-
"\u001b[0;31mNameError\u001b[0m: name 'D' is not defined"
567-
]
568-
}
569-
],
376+
"execution_count": null,
377+
"metadata": {},
378+
"outputs": [],
570379
"source": [
571380
"strain_map = D.get_strain_maps()"
572381
]

0 commit comments

Comments
 (0)