Skip to content

Commit 1655902

Browse files
authored
docs: accidentally cut out one case (#197)
1 parent cdea781 commit 1655902

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

docs/user-guide/beer/beer_modulation_mcstas.ipynb

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,101 @@
527527
"\n",
528528
"da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
529529
]
530+
},
531+
{
532+
"cell_type": "markdown",
533+
"id": "41",
534+
"metadata": {},
535+
"source": [
536+
"## Duplex sample (M4)"
537+
]
538+
},
539+
{
540+
"cell_type": "markdown",
541+
"id": "42",
542+
"metadata": {},
543+
"source": [
544+
"### Intensity distribution in detector"
545+
]
546+
},
547+
{
548+
"cell_type": "code",
549+
"execution_count": null,
550+
"id": "43",
551+
"metadata": {},
552+
"outputs": [],
553+
"source": [
554+
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
555+
"wf[Filename[SampleRun]] = mcstas_duplex(16)\n",
556+
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
557+
]
558+
},
559+
{
560+
"cell_type": "markdown",
561+
"id": "44",
562+
"metadata": {},
563+
"source": [
564+
"### Known peaks workflow"
565+
]
566+
},
567+
{
568+
"cell_type": "code",
569+
"execution_count": null,
570+
"id": "45",
571+
"metadata": {},
572+
"outputs": [],
573+
"source": [
574+
"wf[DHKLList] = duplex_peaks_array()\n",
575+
"da = wf.compute(DetectorTofData[SampleRun])\n",
576+
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
577+
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
578+
]
579+
},
580+
{
581+
"cell_type": "markdown",
582+
"id": "46",
583+
"metadata": {},
584+
"source": [
585+
"### Automatic peak finder workflow"
586+
]
587+
},
588+
{
589+
"cell_type": "code",
590+
"execution_count": null,
591+
"id": "47",
592+
"metadata": {},
593+
"outputs": [],
594+
"source": [
595+
"wf = BeerModMcStasWorkflow()\n",
596+
"wf[Filename[SampleRun]] = mcstas_duplex(16)\n",
597+
"da = wf.compute(DetectorTofData[SampleRun])\n",
598+
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
599+
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
600+
]
601+
},
602+
{
603+
"cell_type": "markdown",
604+
"id": "48",
605+
"metadata": {},
606+
"source": [
607+
"#### Data that was excluded because tof could not be computed\n",
608+
"\n",
609+
"The most common reason this happens is overlap between nearby peaks."
610+
]
611+
},
612+
{
613+
"cell_type": "code",
614+
"execution_count": null,
615+
"id": "49",
616+
"metadata": {},
617+
"outputs": [],
618+
"source": [
619+
"da = da['bank2'].copy()\n",
620+
"da.masks.clear()\n",
621+
"da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n",
622+
"\n",
623+
"da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
624+
]
530625
}
531626
],
532627
"metadata": {

0 commit comments

Comments
 (0)