|
291 | 291 | "metadata": {},
|
292 | 292 | "outputs": [],
|
293 | 293 | "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", |
295 | 295 | "fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
|
296 | 296 | "res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
|
297 | 297 | "ax[0].set_title('raw')\n",
|
|
341 | 341 | "plt.show()\n",
|
342 | 342 | "\n",
|
343 | 343 | "## 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", |
345 | 345 | "res_kx_ky.sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
346 | 346 | "ax[0,0].set_title(\"XPD of $1^{st}$ order sidebands\")\n",
|
347 | 347 | "res_kx_ky.sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
|
381 | 381 | "## Apply Gaussian Blur to background image\n",
|
382 | 382 | "bgd_blur = xr.apply_ufunc(gaussian_filter, bgd, 15)\n",
|
383 | 383 | "\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", |
385 | 385 | "bgd.plot(robust=True, cmap='terrain', ax=ax[0])\n",
|
386 | 386 | "ax[0].set_title('Background image')\n",
|
387 | 387 | "bgd_blur.plot(cmap='terrain', ax=ax[1])\n",
|
|
397 | 397 | "outputs": [],
|
398 | 398 | "source": [
|
399 | 399 | "## 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", |
401 | 401 | "(res_kx_ky/bgd).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
402 | 402 | "(res_kx_ky/bgd).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
403 | 403 | "(res_kx_ky/bgd).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
|
404 | 404 | "(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", |
406 | 406 | "\n",
|
407 | 407 | "## 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", |
409 | 409 | "(res_kx_ky/bgd_blur).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
410 | 410 | "(res_kx_ky/bgd_blur).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
411 | 411 | "(res_kx_ky/bgd_blur).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
|
412 | 412 | "(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", |
414 | 414 | "\n",
|
415 | 415 | "## 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", |
417 | 417 | "(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",
|
418 | 418 | "(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",
|
419 | 419 | "(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",
|
420 | 420 | "(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')" |
422 | 422 | ]
|
423 | 423 | },
|
424 | 424 | {
|
|
451 | 451 | "W_5p_blur = xr.apply_ufunc(gaussian_filter, W_5p, 15)\n",
|
452 | 452 | "\n",
|
453 | 453 | "### 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", |
455 | 455 | "(SB/SB_blur).plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
456 | 456 | "(W_4f_7/W_4f_7_blur).plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
457 | 457 | "(W_4f_5/W_4f_5_blur).plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
|
458 | 458 | "(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", |
460 | 460 | "\n",
|
461 | 461 | "### Apply Gaussian Blur to resulted images to improve contrast\n",
|
462 | 462 | "SB_norm = xr.apply_ufunc(gaussian_filter, SB/SB_blur, 1)\n",
|
|
465 | 465 | "W_5p_norm = xr.apply_ufunc(gaussian_filter, W_5p/W_5p_blur, 1)\n",
|
466 | 466 | "\n",
|
467 | 467 | "### 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", |
469 | 469 | "SB_norm.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
470 | 470 | "W_4f_7_norm.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
471 | 471 | "W_4f_5_norm.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
|
472 | 472 | "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') " |
474 | 474 | ]
|
475 | 475 | },
|
476 | 476 | {
|
|
503 | 503 | "W_4f_7_nrm2_blur = xr.apply_ufunc(gaussian_filter, W_4f_7_nrm2, 1)\n",
|
504 | 504 | "\n",
|
505 | 505 | "### 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", |
507 | 507 | "W_4f_7.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
|
508 | 508 | "W_4f_7_bgd.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
|
509 | 509 | "W_4f_7_nrm1.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
|
510 | 510 | "W_4f_7_nrm1_blur.plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
|
511 | 511 | "W_4f_7_bgd_blur.plot(robust=True, ax=ax[2,0], cmap='terrain')\n",
|
512 | 512 | "W_4f_7_nrm2.plot(robust=True, ax=ax[2,1], cmap='terrain')\n",
|
513 | 513 | "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') " |
515 | 515 | ]
|
516 | 516 | },
|
517 | 517 | {
|
|
521 | 521 | "metadata": {},
|
522 | 522 | "outputs": [],
|
523 | 523 | "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", |
525 | 525 | "(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",
|
526 | 526 | "W_4f_7_norm.plot(robust=True, ax=ax[1], cmap='terrain')\n",
|
527 | 527 | "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')" |
529 | 529 | ]
|
530 | 530 | },
|
531 | 531 | {
|
|
539 | 539 | ],
|
540 | 540 | "metadata": {
|
541 | 541 | "kernelspec": {
|
542 |
| - "display_name": "python3", |
| 542 | + "display_name": ".venv", |
543 | 543 | "language": "python",
|
544 | 544 | "name": "python3"
|
545 | 545 | },
|
|
553 | 553 | "name": "python",
|
554 | 554 | "nbconvert_exporter": "python",
|
555 | 555 | "pygments_lexer": "ipython3",
|
556 |
| - "version": "3.9.19" |
| 556 | + "version": "3.12.8" |
557 | 557 | }
|
558 | 558 | },
|
559 | 559 | "nbformat": 4,
|
|
0 commit comments