Skip to content

Commit 3c21db0

Browse files
committed
fix aspect ratios
1 parent 4e0b781 commit 3c21db0

5 files changed

+37
-40
lines changed

tutorial/10_hextof_workflow_trXPS_bam_correction.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
"metadata": {},
239239
"outputs": [],
240240
"source": [
241-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
241+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
242242
"res.plot(robust=True, ax=ax[0], cmap='terrain')\n",
243243
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
244244
"ax[0].set_title('raw')\n",
@@ -338,7 +338,7 @@
338338
"outputs": [],
339339
"source": [
340340
"\n",
341-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
341+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
342342
"res_bam.sel(bam=slice(-6400,-5100)).sum('trainId').plot(ax=ax[0],robust=True, cmap='terrain')\n",
343343
"res_bam.sel(bam=slice(-6400,-5100)).sum('pulseId').plot(ax=ax[1],robust=True, cmap='terrain')\n",
344344
"plt.show()"
@@ -404,7 +404,7 @@
404404
"metadata": {},
405405
"outputs": [],
406406
"source": [
407-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
407+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
408408
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
409409
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
410410
"ax[0].set_title('raw')\n",
@@ -523,7 +523,7 @@
523523
"plt.legend(loc=1)\n",
524524
"plt.title(\"Sidebands with bam correction\")\n",
525525
"\n",
526-
"fig.suptitle(f'Run {run_number}: Effect of BAM correction',fontsize='22')"
526+
"fig.suptitle(f'Run {run_number}: Effect of BAM correction',fontsize='14')"
527527
]
528528
},
529529
{
@@ -545,7 +545,7 @@
545545
],
546546
"metadata": {
547547
"kernelspec": {
548-
"display_name": "sed-processor-7Jy-bAA8-py3.9",
548+
"display_name": ".venv",
549549
"language": "python",
550550
"name": "python3"
551551
},
@@ -559,7 +559,7 @@
559559
"name": "python",
560560
"nbconvert_exporter": "python",
561561
"pygments_lexer": "ipython3",
562-
"version": "3.9.19"
562+
"version": "3.12.8"
563563
}
564564
},
565565
"nbformat": 4,

tutorial/11_hextof_workflow_trXPS_energy_calibration_using_SB.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@
327327
"bins = [100,60]\n",
328328
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
329329
"\n",
330-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
330+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
331331
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
332332
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
333333
"ax[0].set_title('raw')\n",
@@ -443,7 +443,7 @@
443443
"bins = [200,60]\n",
444444
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
445445
"\n",
446-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
446+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
447447
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
448448
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
449449
"ax[0].set_title('raw')\n",

tutorial/1_binning_fake_data.ipynb

+4-7
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"metadata": {},
107107
"outputs": [],
108108
"source": [
109-
"fig, axs = plt.subplots(1, 3, figsize=(8, 2.5), constrained_layout=True)\n",
109+
"fig, axs = plt.subplots(1, 3, figsize=(6, 1.875), constrained_layout=True)\n",
110110
"for i in range(3):\n",
111111
" axs[i].imshow(res.sum(i))"
112112
]
@@ -164,7 +164,7 @@
164164
"metadata": {},
165165
"outputs": [],
166166
"source": [
167-
"fig, axs = plt.subplots(1, 3, figsize=(8, 2.5), constrained_layout=True)\n",
167+
"fig, axs = plt.subplots(1, 3, figsize=(6, 1.875), constrained_layout=True)\n",
168168
"for dim, ax in zip(binAxes, axs):\n",
169169
" res.sum(dim).plot(ax=ax)"
170170
]
@@ -179,11 +179,8 @@
179179
}
180180
],
181181
"metadata": {
182-
"interpreter": {
183-
"hash": "728003ee06929e5fa5ff815d1b96bf487266025e4b7440930c6bf4536d02d243"
184-
},
185182
"kernelspec": {
186-
"display_name": "python3",
183+
"display_name": "Python 3",
187184
"language": "python",
188185
"name": "python3"
189186
},
@@ -197,7 +194,7 @@
197194
"name": "python",
198195
"nbconvert_exporter": "python",
199196
"pygments_lexer": "ipython3",
200-
"version": "3.8.12"
197+
"version": "3.9.19"
201198
}
202199
},
203200
"nbformat": 4,

tutorial/4_hextof_workflow.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@
759759
"metadata": {},
760760
"outputs": [],
761761
"source": [
762-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
762+
"fig,ax = plt.subplots(1,2,figsize=2.25), layout='constrained')\n",
763763
"res.plot(robust=True, ax=ax[0])\n",
764764
"bg = res.isel(delayStage=slice(0,10)).mean('delayStage')\n",
765765
"(res-bg).plot(robust=True, ax=ax[1])"
@@ -827,7 +827,7 @@
827827
},
828828
"outputs": [],
829829
"source": [
830-
"fig,ax = plt.subplots(1,2,figsize=(6,3))\n",
830+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25))\n",
831831
"res.plot(robust=True, ax=ax[0])\n",
832832
"bg = res.sel(delayStage=slice(-1,-0.2)).mean('delayStage')\n",
833833
"(res-bg).plot(robust=True, ax=ax[1])\n",
@@ -848,7 +848,7 @@
848848
"outputs": [],
849849
"source": [
850850
"res = sp.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
851-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
851+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
852852
"res.plot(robust=True, ax=ax[0])\n",
853853
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
854854
"(res-bg).plot(robust=True, ax=ax[1])"
@@ -966,7 +966,7 @@
966966
"metadata": {},
967967
"outputs": [],
968968
"source": [
969-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
969+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
970970
"res.plot(robust=True, ax=ax[0])\n",
971971
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
972972
"(res-bg).plot(robust=True, ax=ax[1])"
@@ -1017,7 +1017,7 @@
10171017
],
10181018
"metadata": {
10191019
"kernelspec": {
1020-
"display_name": "python3",
1020+
"display_name": ".venv",
10211021
"language": "python",
10221022
"name": "python3"
10231023
},
@@ -1031,7 +1031,7 @@
10311031
"name": "python",
10321032
"nbconvert_exporter": "python",
10331033
"pygments_lexer": "ipython3",
1034-
"version": "3.9.19"
1034+
"version": "3.12.8"
10351035
}
10361036
},
10371037
"nbformat": 4,

tutorial/9_hextof_workflow_trXPD.ipynb

+19-19
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
"metadata": {},
292292
"outputs": [],
293293
"source": [
294-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
294+
"fig,ax = plt.subplots(1,2,figsize=(6,2.25), layout='constrained')\n",
295295
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
296296
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
297297
"ax[0].set_title('raw')\n",
@@ -341,7 +341,7 @@
341341
"plt.show()\n",
342342
"\n",
343343
"## XPD plots\n",
344-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
344+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
345345
"res_kx_ky.sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
346346
"ax[0,0].set_title(\"XPD of $1^{st}$ order sidebands\")\n",
347347
"res_kx_ky.sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
@@ -381,7 +381,7 @@
381381
"## Apply Gaussian Blur to background image\n",
382382
"bgd_blur = xr.apply_ufunc(gaussian_filter, bgd, 15)\n",
383383
"\n",
384-
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
384+
"fig,ax = plt.subplots(1,2,figsize=(6,2.7), layout='constrained')\n",
385385
"bgd.plot(robust=True, cmap='terrain', ax=ax[0])\n",
386386
"ax[0].set_title('Background image')\n",
387387
"bgd_blur.plot(cmap='terrain', ax=ax[1])\n",
@@ -397,28 +397,28 @@
397397
"outputs": [],
398398
"source": [
399399
"## XPD normalized by background image\n",
400-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
400+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
401401
"(res_kx_ky/bgd).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
402402
"(res_kx_ky/bgd).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
403403
"(res_kx_ky/bgd).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
404404
"(res_kx_ky/bgd).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
405-
"fig.suptitle(f'Run {run_number}: XPD patterns after background normalization',fontsize='14')\n",
405+
"fig.suptitle(f'Run {run_number}: XPD patterns after background normalization',fontsize='11')\n",
406406
"\n",
407407
"## XPD normalized by Gaussian-blurred background image\n",
408-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
408+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
409409
"(res_kx_ky/bgd_blur).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
410410
"(res_kx_ky/bgd_blur).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
411411
"(res_kx_ky/bgd_blur).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
412412
"(res_kx_ky/bgd_blur).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
413-
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian-blurred background normalization',fontsize='14')\n",
413+
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian-blurred background normalization',fontsize='11')\n",
414414
"\n",
415415
"## XPD normalized by Gaussian-blurred background image and blurred to improve contrast\n",
416-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
416+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
417417
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
418418
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
419419
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
420420
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
421-
"fig.suptitle(f'Run {run_number}: resulting Gaussian-blurred XPD patterns',fontsize='14')"
421+
"fig.suptitle(f'Run {run_number}: resulting Gaussian-blurred XPD patterns',fontsize='11')"
422422
]
423423
},
424424
{
@@ -451,12 +451,12 @@
451451
"W_5p_blur = xr.apply_ufunc(gaussian_filter, W_5p, 15)\n",
452452
"\n",
453453
"### Visualize results\n",
454-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
454+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
455455
"(SB/SB_blur).plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
456456
"(W_4f_7/W_4f_7_blur).plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
457457
"(W_4f_5/W_4f_5_blur).plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
458458
"(W_5p/W_5p_blur).plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
459-
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian Blur normalization',fontsize='14')\n",
459+
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian Blur normalization',fontsize='11')\n",
460460
"\n",
461461
"### Apply Gaussian Blur to resulted images to improve contrast\n",
462462
"SB_norm = xr.apply_ufunc(gaussian_filter, SB/SB_blur, 1)\n",
@@ -465,12 +465,12 @@
465465
"W_5p_norm = xr.apply_ufunc(gaussian_filter, W_5p/W_5p_blur, 1)\n",
466466
"\n",
467467
"### Visualize results\n",
468-
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
468+
"fig,ax = plt.subplots(2,2,figsize=(6,4.7), layout='constrained')\n",
469469
"SB_norm.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
470470
"W_4f_7_norm.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
471471
"W_4f_5_norm.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
472472
"W_5p_norm.plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
473-
"fig.suptitle(f'Run {run_number}: XPD patterns after Gauss Blur normalization',fontsize='14') "
473+
"fig.suptitle(f'Run {run_number}: XPD patterns after Gauss Blur normalization',fontsize='11') "
474474
]
475475
},
476476
{
@@ -503,15 +503,15 @@
503503
"W_4f_7_nrm2_blur = xr.apply_ufunc(gaussian_filter, W_4f_7_nrm2, 1)\n",
504504
"\n",
505505
"### Visualize all steps\n",
506-
"fig,ax = plt.subplots(4,2,figsize=(6,12), layout='constrained')\n",
506+
"fig,ax = plt.subplots(4,2,figsize=(6,8), layout='constrained')\n",
507507
"W_4f_7.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
508508
"W_4f_7_bgd.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
509509
"W_4f_7_nrm1.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
510510
"W_4f_7_nrm1_blur.plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
511511
"W_4f_7_bgd_blur.plot(robust=True, ax=ax[2,0], cmap='terrain')\n",
512512
"W_4f_7_nrm2.plot(robust=True, ax=ax[2,1], cmap='terrain')\n",
513513
"W_4f_7_nrm2_blur.plot(robust=True, ax=ax[3,0], cmap='terrain')\n",
514-
"fig.suptitle(f'Run {run_number}: XPD patterns of W4f7/2 with pre-core level normalization',fontsize='14') "
514+
"fig.suptitle(f'Run {run_number}: XPD patterns of W4f7/2 with pre-core level normalization',fontsize='11') "
515515
]
516516
},
517517
{
@@ -521,11 +521,11 @@
521521
"metadata": {},
522522
"outputs": [],
523523
"source": [
524-
"fig,ax = plt.subplots(1,3,figsize=(6,3), layout='constrained')\n",
524+
"fig,ax = plt.subplots(1,3,figsize=(6,2), layout='constrained')\n",
525525
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0], cmap='terrain')\n",
526526
"W_4f_7_norm.plot(robust=True, ax=ax[1], cmap='terrain')\n",
527527
"W_4f_7_nrm2_blur.plot(robust=True, ax=ax[2], cmap='terrain')\n",
528-
"fig.suptitle(f'Run {run_number}: comparison of different normalizations\\nof XPD pattern for W4f 7/2 peak with Gaussian Blur',fontsize='14')"
528+
"fig.suptitle(f'Run {run_number}: comparison of different normalizations\\nof XPD pattern for W4f 7/2 peak with Gaussian Blur',fontsize='11')"
529529
]
530530
},
531531
{
@@ -539,7 +539,7 @@
539539
],
540540
"metadata": {
541541
"kernelspec": {
542-
"display_name": "python3",
542+
"display_name": ".venv",
543543
"language": "python",
544544
"name": "python3"
545545
},
@@ -553,7 +553,7 @@
553553
"name": "python",
554554
"nbconvert_exporter": "python",
555555
"pygments_lexer": "ipython3",
556-
"version": "3.9.19"
556+
"version": "3.12.8"
557557
}
558558
},
559559
"nbformat": 4,

0 commit comments

Comments
 (0)