diff --git a/docs/user-guide/beer/beer_modulation_mcstas.ipynb b/docs/user-guide/beer/beer_modulation_mcstas.ipynb index e2bf197a..83fe0155 100644 --- a/docs/user-guide/beer/beer_modulation_mcstas.ipynb +++ b/docs/user-guide/beer/beer_modulation_mcstas.ipynb @@ -1,18 +1,8 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "0", - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib ipympl" - ] - }, { "cell_type": "markdown", - "id": "1", + "id": "0", "metadata": {}, "source": [ "# BEER (modulation) McStas data reduction" @@ -21,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -42,7 +32,7 @@ }, { "cell_type": "markdown", - "id": "3", + "id": "2", "metadata": {}, "source": [ "## Beam modulation mode\n", @@ -134,7 +124,7 @@ }, { "cell_type": "markdown", - "id": "4", + "id": "3", "metadata": {}, "source": [ "In the rest of the notebook you will find examples of simulated data for a few different samples measured in the different modulation modes.\n", @@ -147,7 +137,7 @@ }, { "cell_type": "markdown", - "id": "5", + "id": "4", "metadata": {}, "source": [ "## Silicon sample (M2)" @@ -155,7 +145,7 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "5", "metadata": {}, "source": [ "### Intensity distribution in detector" @@ -164,18 +154,18 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "6", "metadata": {}, "outputs": [], "source": [ "wf = BeerModMcStasWorkflowKnownPeaks()\n", "wf[Filename[SampleRun]] = mcstas_silicon_medium_resolution()\n", - "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "8", + "id": "7", "metadata": {}, "source": [ "### Known peaks workflow" @@ -184,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +186,7 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "9", "metadata": {}, "source": [ "### Automatic peak finder workflow" @@ -205,7 +195,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +208,7 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "11", "metadata": {}, "source": [ "#### Data that was excluded because tof could not be computed\n", @@ -229,7 +219,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -237,12 +227,12 @@ "da.masks.clear()\n", "da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n", "\n", - "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "14", + "id": "13", "metadata": {}, "source": [ "## Duplex sample (M1)" @@ -250,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "15", + "id": "14", "metadata": {}, "source": [ "### Intensity distribution in detector" @@ -259,18 +249,18 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "15", "metadata": {}, "outputs": [], "source": [ "wf = BeerModMcStasWorkflowKnownPeaks()\n", "wf[Filename[SampleRun]] = mcstas_duplex(8)\n", - "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-2)" ] }, { "cell_type": "markdown", - "id": "17", + "id": "16", "metadata": {}, "source": [ "### Known peaks workflow" @@ -279,7 +269,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +281,7 @@ }, { "cell_type": "markdown", - "id": "19", + "id": "18", "metadata": {}, "source": [ "### Automatic peak finder workflow" @@ -300,7 +290,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +303,7 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "20", "metadata": {}, "source": [ "#### Data that was excluded because tof could not be computed\n", @@ -324,7 +314,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -332,12 +322,12 @@ "da.masks.clear()\n", "da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n", "\n", - "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "23", + "id": "22", "metadata": {}, "source": [ "## Duplex sample (M2)" @@ -345,7 +335,7 @@ }, { "cell_type": "markdown", - "id": "24", + "id": "23", "metadata": {}, "source": [ "### Intensity distribution in detector" @@ -354,18 +344,18 @@ { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "24", "metadata": {}, "outputs": [], "source": [ "wf = BeerModMcStasWorkflowKnownPeaks()\n", "wf[Filename[SampleRun]] = mcstas_duplex(9)\n", - "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "26", + "id": "25", "metadata": {}, "source": [ "### Known peaks workflow" @@ -374,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -386,7 +376,7 @@ }, { "cell_type": "markdown", - "id": "28", + "id": "27", "metadata": {}, "source": [ "### Automatic peak finder workflow" @@ -395,7 +385,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -408,7 +398,7 @@ }, { "cell_type": "markdown", - "id": "30", + "id": "29", "metadata": {}, "source": [ "#### Data that was excluded because tof could not be computed\n", @@ -419,7 +409,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -427,12 +417,12 @@ "da.masks.clear()\n", "da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n", "\n", - "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "32", + "id": "31", "metadata": {}, "source": [ "## Duplex sample (M3)" @@ -440,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "33", + "id": "32", "metadata": {}, "source": [ "### Intensity distribution in detector" @@ -449,18 +439,18 @@ { "cell_type": "code", "execution_count": null, - "id": "34", + "id": "33", "metadata": {}, "outputs": [], "source": [ "wf = BeerModMcStasWorkflowKnownPeaks()\n", "wf[Filename[SampleRun]] = mcstas_duplex(10)\n", - "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "35", + "id": "34", "metadata": {}, "source": [ "### Known peaks workflow" @@ -469,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -481,7 +471,7 @@ }, { "cell_type": "markdown", - "id": "37", + "id": "36", "metadata": {}, "source": [ "### Automatic peak finder workflow" @@ -490,7 +480,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38", + "id": "37", "metadata": {}, "outputs": [], "source": [ @@ -503,7 +493,7 @@ }, { "cell_type": "markdown", - "id": "39", + "id": "38", "metadata": {}, "source": [ "#### Data that was excluded because tof could not be computed\n", @@ -514,7 +504,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -522,12 +512,12 @@ "da.masks.clear()\n", "da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n", "\n", - "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "41", + "id": "40", "metadata": {}, "source": [ "## Duplex sample (M4)" @@ -535,7 +525,7 @@ }, { "cell_type": "markdown", - "id": "42", + "id": "41", "metadata": {}, "source": [ "### Intensity distribution in detector" @@ -544,18 +534,18 @@ { "cell_type": "code", "execution_count": null, - "id": "43", + "id": "42", "metadata": {}, "outputs": [], "source": [ "wf = BeerModMcStasWorkflowKnownPeaks()\n", "wf[Filename[SampleRun]] = mcstas_duplex(16)\n", - "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] }, { "cell_type": "markdown", - "id": "44", + "id": "43", "metadata": {}, "source": [ "### Known peaks workflow" @@ -564,7 +554,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -576,7 +566,7 @@ }, { "cell_type": "markdown", - "id": "46", + "id": "45", "metadata": {}, "source": [ "### Automatic peak finder workflow" @@ -585,7 +575,7 @@ { "cell_type": "code", "execution_count": null, - "id": "47", + "id": "46", "metadata": {}, "outputs": [], "source": [ @@ -598,7 +588,7 @@ }, { "cell_type": "markdown", - "id": "48", + "id": "47", "metadata": {}, "source": [ "#### Data that was excluded because tof could not be computed\n", @@ -609,7 +599,7 @@ { "cell_type": "code", "execution_count": null, - "id": "49", + "id": "48", "metadata": {}, "outputs": [], "source": [ @@ -617,7 +607,7 @@ "da.masks.clear()\n", "da.bins.masks['too_far_from_center'] = ~da.bins.masks.pop('too_far_from_center')\n", "\n", - "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log')" + "da.bins.concat().hist(two_theta=1000, event_time_offset=1000).plot(norm='log', cmin=1.0e-3)" ] } ], @@ -637,7 +627,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.18" + "version": "3.12.7" } }, "nbformat": 4,