From 43566e8455af4d473d8b0d723d36a913e7600531 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Tue, 24 Oct 2023 16:08:36 +0200 Subject: [PATCH] docs: restructure and add some more context --- docs/examples/amor.ipynb | 68 +++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/docs/examples/amor.ipynb b/docs/examples/amor.ipynb index 96d8d0a..41cd07e 100644 --- a/docs/examples/amor.ipynb +++ b/docs/examples/amor.ipynb @@ -1,5 +1,16 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Divergent data reduction for Amor\n", + "\n", + "In this notebook, we will look at how to use the `essreflectometry` package with Sciline, for reflectometry data collected from the PSI instrument [Amor](https://www.psi.ch/en/sinq/amor) in [divergent beam mode](https://www.psi.ch/en/sinq/amor/selene).\n", + "\n", + "We will begin by importing the modules that are necessary for this notebook." + ] + }, { "cell_type": "code", "execution_count": null, @@ -8,26 +19,45 @@ "source": [ "import scipp as sc\n", "import sciline\n", - "from essreflectometry.amor import providers as amor, default_parameters\n", - "from essreflectometry.reflectometry import providers as reflectometry\n", - "from essreflectometry.reflectometry.types import (\n", - " Sample, Reference, Sample, Filename,\n", - " QBins, NormalizedIOverQ, QStd\n", - ")\n", - "from essreflectometry.amor.types import SampleRotation\n", - "\n", + "from essreflectometry.amor import providers, default_parameters\n", + "from essreflectometry.reflectometry.types import *\n", + "from essreflectometry.amor.types import SampleRotation" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "params={\n", + " **default_parameters,\n", + " QBins: sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom'),\n", + " SampleRotation[Sample]: sc.scalar(0.7989, unit='deg'),\n", + " Filename[Sample]: \"sample.nxs\",\n", + " SampleRotation[Reference]: sc.scalar(0.8389, unit='deg'),\n", + " Filename[Reference]: \"reference.nxs\",\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "pipeline = sciline.Pipeline(\n", - " amor + reflectometry,\n", - " params={\n", - " **default_parameters,\n", - " QBins: sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom'),\n", - " SampleRotation[Sample]: sc.scalar(0.7989, unit='deg'),\n", - " Filename[Sample]: \"sample.nxs\",\n", - " SampleRotation[Reference]: sc.scalar(0.8389, unit='deg'),\n", - " Filename[Reference]: \"reference.nxs\",\n", - " }\n", - ")\n", - "\n", + " providers,\n", + " params=params\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "pipeline.visualize((NormalizedIOverQ, QStd), graph_attr={'rankdir': 'LR'})" ] },