Skip to content

Commit 67b43e6

Browse files
committed
Notebooks: add plot of PSF with emission position overlay
1 parent 3936a73 commit 67b43e6

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

notebooks/PyBroMo - 2. Generate smFRET data, including mixtures.ipynb

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@
556556
"cell_type": "markdown",
557557
"metadata": {},
558558
"source": [
559-
"> **NOTE**: most positions are NaN when the timestamp is from background.\n",
559+
"> **NOTE**: positions are NaN when the timestamp is from background.\n",
560560
"\n",
561561
"Check that we have NaNs if and only if the timestamp is from background:"
562562
]
@@ -693,11 +693,25 @@
693693
"metadata": {},
694694
"outputs": [],
695695
"source": [
696-
"fig, ax = plt.subplots(figsize=(2, 5))\n",
697-
"ax.plot(R, Z, 'o', alpha=0.1)\n",
698-
"ax.set_xlim(0, 1)\n",
699-
"ax.set_ylim(-2, 2)\n",
700-
"ax.set(xlabel='R (μm)', ylabel='Z (μm)');"
696+
"# Increase the resolution of the figures displayed in the notebook\n",
697+
"%config InlineBackend.figure_format = 'retina' # 'png' for default res"
698+
]
699+
},
700+
{
701+
"cell_type": "code",
702+
"execution_count": null,
703+
"metadata": {},
704+
"outputs": [],
705+
"source": [
706+
"psf = pbm.NumericPSF().hdata\n",
707+
"cmap = plt.cm.YlGnBu\n",
708+
"cmap.set_under(alpha=0)\n",
709+
"kwargs = dict(interpolation='bicubic', origin='lower', cmap=cmap, vmin=1e-1, zorder=1)\n",
710+
"\n",
711+
"fig, ax = plt.subplots(figsize=(8, 2))\n",
712+
"ax.imshow(psf.T, extent=(-6, 6, 0, 4), **kwargs)\n",
713+
"ax.plot(Z, R, '.', ms=5, color='C1', alpha=0.3)\n",
714+
"ax.set(ylabel='R (μm)', xlabel='Z (μm)', ylim=(0, 1), xlim=(-2, 2));"
701715
]
702716
},
703717
{
@@ -733,7 +747,13 @@
733747
"sideBar": true,
734748
"skip_h1_title": false,
735749
"toc_cell": false,
736-
"toc_position": {},
750+
"toc_position": {
751+
"height": "591.867px",
752+
"left": "0px",
753+
"right": "959px",
754+
"top": "111.133px",
755+
"width": "212px"
756+
},
737757
"toc_section_display": "block",
738758
"toc_window_display": false
739759
}

0 commit comments

Comments
 (0)