Skip to content

Commit

Permalink
update aspect ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
zain-sohail committed Mar 3, 2025
1 parent 568085b commit b3e949f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions tutorial/10_hextof_workflow_trXPS_bam_correction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"res.plot(robust=True, ax=ax[0], cmap='terrain')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
"ax[0].set_title('raw')\n",
Expand Down Expand Up @@ -338,7 +338,7 @@
"outputs": [],
"source": [
"\n",
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"res_bam.sel(bam=slice(-6400,-5100)).sum('trainId').plot(ax=ax[0],robust=True, cmap='terrain')\n",
"res_bam.sel(bam=slice(-6400,-5100)).sum('pulseId').plot(ax=ax[1],robust=True, cmap='terrain')\n",
"plt.show()"
Expand Down Expand Up @@ -404,7 +404,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
"ax[0].set_title('raw')\n",
Expand Down Expand Up @@ -497,7 +497,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax=plt.subplots(2,2,figsize=(6,8),layout=\"constrained\")\n",
"fig,ax=plt.subplots(2,2,figsize=(6,6),layout=\"constrained\")\n",
"\n",
"plt.axes(ax[0,0])\n",
"res.plot(cmap='terrain', robust=True)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
"bins = [100,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
"\n",
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
"ax[0].set_title('raw')\n",
Expand Down Expand Up @@ -443,7 +443,7 @@
"bins = [200,60]\n",
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
"\n",
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
"ax[0].set_title('raw')\n",
Expand Down
16 changes: 8 additions & 8 deletions tutorial/4_hextof_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,3,figsize=(6,4), layout='tight')\n",
"res_chessy.plot(ax=ax[0], robust=True)\n",
"res_t05.plot(ax=ax[1], robust=True)\n",
"res_t10.plot(ax=ax[2], robust=True)"
"fig,ax = plt.subplots(1,3,figsize=(6,2), layout='tight')\n",
"res_chessy.plot(ax=ax[0], robust=True, add_colorbar=False)\n",

Check warning on line 349 in tutorial/4_hextof_workflow.ipynb

View workflow job for this annotation

GitHub Actions / lint

Unknown word (colorbar)
"res_t05.plot(ax=ax[1], robust=True, add_colorbar=False)\n",

Check warning on line 350 in tutorial/4_hextof_workflow.ipynb

View workflow job for this annotation

GitHub Actions / lint

Unknown word (colorbar)
"res_t10.plot(ax=ax[2], robust=True, add_colorbar=False)"

Check warning on line 351 in tutorial/4_hextof_workflow.ipynb

View workflow job for this annotation

GitHub Actions / lint

Unknown word (colorbar)
]
},
{
Expand Down Expand Up @@ -759,7 +759,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"res.plot(robust=True, ax=ax[0])\n",
"bg = res.isel(delayStage=slice(0,10)).mean('delayStage')\n",
"(res-bg).plot(robust=True, ax=ax[1])"
Expand Down Expand Up @@ -827,7 +827,7 @@
},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4))\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3))\n",
"res.plot(robust=True, ax=ax[0])\n",
"bg = res.sel(delayStage=slice(-1,-0.2)).mean('delayStage')\n",
"(res-bg).plot(robust=True, ax=ax[1])\n",
Expand All @@ -848,7 +848,7 @@
"outputs": [],
"source": [
"res = sp.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"res.plot(robust=True, ax=ax[0])\n",
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
"(res-bg).plot(robust=True, ax=ax[1])"
Expand Down Expand Up @@ -966,7 +966,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"res.plot(robust=True, ax=ax[0])\n",
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
"(res-bg).plot(robust=True, ax=ax[1])"
Expand Down
16 changes: 8 additions & 8 deletions tutorial/9_hextof_workflow_trXPD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
"ax[0].set_title('raw')\n",
Expand Down Expand Up @@ -341,7 +341,7 @@
"plt.show()\n",
"\n",
"## XPD plots\n",
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"res_kx_ky.sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
"ax[0,0].set_title(\"XPD of $1^{st}$ order sidebands\")\n",
"res_kx_ky.sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
Expand Down Expand Up @@ -381,7 +381,7 @@
"## Apply Gaussian Blur to background image\n",
"bgd_blur = xr.apply_ufunc(gaussian_filter, bgd, 15)\n",
"\n",
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
"bgd.plot(robust=True, cmap='terrain', ax=ax[0])\n",
"ax[0].set_title('Background image')\n",
"bgd_blur.plot(cmap='terrain', ax=ax[1])\n",
Expand All @@ -397,23 +397,23 @@
"outputs": [],
"source": [
"## XPD normalized by background image\n",
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"(res_kx_ky/bgd).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
"(res_kx_ky/bgd).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
"(res_kx_ky/bgd).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
"(res_kx_ky/bgd).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
"fig.suptitle(f'Run {run_number}: XPD patterns after background normalization',fontsize='18')\n",
"\n",
"## XPD normalized by Gaussian-blurred background image\n",
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"(res_kx_ky/bgd_blur).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
"(res_kx_ky/bgd_blur).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
"(res_kx_ky/bgd_blur).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
"(res_kx_ky/bgd_blur).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian-blurred background normalization',fontsize='18')\n",
"\n",
"## XPD normalized by Gaussian-blurred background image and blurred to improve contrast\n",
"fig,ax = plt.subplots(2,2,figsize=(9,7), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"(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",
"(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",
"(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",
Expand Down Expand Up @@ -451,7 +451,7 @@
"W_5p_blur = xr.apply_ufunc(gaussian_filter, W_5p, 15)\n",
"\n",
"### Visualize results\n",
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"(SB/SB_blur).plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
"(W_4f_7/W_4f_7_blur).plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
"(W_4f_5/W_4f_5_blur).plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
Expand All @@ -465,7 +465,7 @@
"W_5p_norm = xr.apply_ufunc(gaussian_filter, W_5p/W_5p_blur, 1)\n",
"\n",
"### Visualize results\n",
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
"SB_norm.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
"W_4f_7_norm.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
"W_4f_5_norm.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
Expand Down

0 comments on commit b3e949f

Please sign in to comment.