Skip to content

Commit 0297493

Browse files
committed
cache reference result in Amor simple notebook to avoid computing it many times
1 parent c5237b4 commit 0297493

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/user-guide/amor/amor-reduction.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@
8484
"## Setting the reference run\n",
8585
"\n",
8686
"The reference represents the intensity reflected by the super-mirror.\n",
87-
"The same run is used for normalizing all sample runs."
87+
"The same run is used for normalizing all sample runs,\n",
88+
"and it thus only needs to be reduced once.\n",
89+
"\n",
90+
"In this subsection, we reduce the reference run and cache it onto the workflow to speed-up subsequent processing."
8891
]
8992
},
9093
{
@@ -96,7 +99,10 @@
9699
"workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n",
97100
"\n",
98101
"# The sample rotation value in the file is slightly off, so we set it manually\n",
99-
"workflow[SampleRotationOffset[ReferenceRun]] = sc.scalar(0.05, unit='deg')"
102+
"workflow[SampleRotationOffset[ReferenceRun]] = sc.scalar(0.05, unit='deg')\n",
103+
"\n",
104+
"# Set the result back onto the pipeline to cache it\n",
105+
"workflow[ReducedReference] = workflow.compute(ReducedReference)"
100106
]
101107
},
102108
{

0 commit comments

Comments
 (0)