Skip to content

Commit

Permalink
docs: restructure and add some more context
Browse files Browse the repository at this point in the history
  • Loading branch information
jokasimr committed Oct 24, 2023
1 parent 302892a commit 43566e8
Showing 1 changed file with 49 additions and 19 deletions.
68 changes: 49 additions & 19 deletions docs/examples/amor.ipynb
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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'})"
]
},
Expand Down

0 comments on commit 43566e8

Please sign in to comment.