From 857827847e41820000d887be33ce822ac4282d58 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Fri, 20 Oct 2023 09:45:23 +0200 Subject: [PATCH] Update example --- docs/examples/amor.ipynb | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/examples/amor.ipynb b/docs/examples/amor.ipynb index e01f8c4..cb96917 100644 --- a/docs/examples/amor.ipynb +++ b/docs/examples/amor.ipynb @@ -13,20 +13,20 @@ "from essreflectometry.amor.load import load\n", "from essreflectometry.amor.beamline import make_beamline\n", "from essreflectometry.amor.conversions import specular_reflection\n", - "from essreflectometry.amor.resolution import add_resolutions, compute_resolution\n", + "from essreflectometry.amor.resolution import compute_resolution\n", "from essreflectometry.amor.normalize import normalize_by_supermirror\n", "from essreflectometry.amor.calibrations import supermirror_calibration\n", "from essreflectometry.reflectometry.corrections import footprint_correction, normalize_by_counts\n", "from essreflectometry.reflectometry.conversions import providers\n", "from essreflectometry.reflectometry.types import (\n", - " ThetaBins, WavelengthBins, Sample, Reference, Sample, SampleRotation, Filename,\n", + " ThetaBins, WavelengthBins, Sample, Reference, Sample, SampleRotation, Filename, Raw, BeamlineParams,\n", " ThetaData, WavelengthData, HistogrammedByQ, QDataWithResolutions, QData, QBins, NormalizedIOverQ\n", ")\n", "\n", "\n", "pipeline = sciline.Pipeline(\n", " [load, make_beamline, specular_reflection, footprint_correction,\n", - " add_resolutions, compute_resolution, normalize_by_counts, supermirror_calibration, normalize_by_supermirror]\n", + " compute_resolution, normalize_by_counts, supermirror_calibration, normalize_by_supermirror]\n", " + providers,\n", " params={\n", " ThetaBins: sc.linspace(dim='theta', start=0, stop=np.pi/2, num=2, unit='rad'),\n", @@ -49,7 +49,8 @@ "metadata": {}, "outputs": [], "source": [ - "pipeline.compute(HistogrammedByQ[QData[Reference]])" + "normalized = pipeline.compute(NormalizedIOverQ)\n", + "normalized.plot(norm='log') + normalized.mean('detector_number').plot(norm='log')\n" ] }, { @@ -58,9 +59,25 @@ "metadata": {}, "outputs": [], "source": [ - "(pipeline.compute(WithResolution)\n", - " .bins.concat('detector_number').hist(wavelength=200)\n", - " .plot())" + "# 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" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plopp\n", + "\n", + "[]" ] } ],