diff --git a/docs/examples/amor.ipynb b/docs/examples/amor.ipynb index d67ab9f..96d8d0a 100644 --- a/docs/examples/amor.ipynb +++ b/docs/examples/amor.ipynb @@ -37,8 +37,8 @@ "metadata": {}, "outputs": [], "source": [ - "normalized = pipeline.compute(NormalizedIOverQ)\n", - "normalized.plot(norm='log') + normalized.mean('detector_number').plot(norm='log')\n" + "# Compute I over Q and the standard deviation of Q\n", + "ioq, qstd = pipeline.compute((NormalizedIOverQ, QStd)).values()" ] }, { @@ -47,14 +47,24 @@ "metadata": {}, "outputs": [], "source": [ - "# Diagnostics plot\n", - "(pipeline.compute(ThetaData[Sample])\n", - " .bins.concat('detector_number')\n", - " .hist(\n", - " theta=sc.linspace(dim='theta', start=0.0, stop=1.2, num=165, unit='deg').to(unit='rad'),\n", - " wavelength=sc.linspace(dim='wavelength', start=0, stop=15.0, num=165, unit='angstrom'),\n", - " )\n", - " .plot())\n" + "import matplotlib.pyplot as plt\n", + "\n", + "fig = plt.figure(figsize=(5, 7))\n", + "ax1 = fig.add_axes([0, 0.55, 1.0, 0.45])\n", + "ax2 = fig.add_axes([0, 0.0, 1.0, 0.45])\n", + "cax = fig.add_axes([1.05, 0.55, 0.03, 0.45])\n", + "fig1 = ioq.plot(norm='log', ax=ax1, cax=cax, grid=True)\n", + "fig2 = ioq.mean('detector_number').plot(norm='log', ax=ax2, grid=True)\n", + "fig1.canvas.xrange = fig2.canvas.xrange\n", + "fig1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Make a $(\\lambda, \\theta)$ map\n", + "A good sanity check is to create a two-dimensional map of the counts in $\\lambda$ and $\\theta$ bins. To achieve this, we request the `ThetaData` from the pipeline. In the graph above we can see that `WavelengthData` is required to compute `ThetaData`, therefore it is also present in `ThetaData` so we don't need to require it separately." ] }, { @@ -63,8 +73,21 @@ "metadata": {}, "outputs": [], "source": [ - "res = pipeline.compute((NormalizedIOverQ, QStd))\n", - "res[QStd].plot()" + "from essreflectometry.reflectometry.types import ThetaData\n", + "pipeline.compute(ThetaData[Sample])\\\n", + " .bins.concat('detector_number')\\\n", + " .hist(\n", + " theta=sc.linspace(dim='theta', start=0.0, stop=1.2, num=165, unit='deg').to(unit='rad'),\n", + " wavelength=sc.linspace(dim='wavelength', start=0, stop=15.0, num=165, unit='angstrom'),\n", + " )\\\n", + " .plot()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This plot can be used to check if the value of the sample rotation angle $\\omega$ is correct. The bright triangles should be pointing back to the origin $\\lambda = \\theta = 0$." ] } ],