|
37 | 37 | "id": "2",
|
38 | 38 | "metadata": {},
|
39 | 39 | "source": [
|
40 |
| - "## Load the data\n", |
| 40 | + "## Load the detector geometry\n", |
41 | 41 | "\n",
|
42 |
| - "We load a dataset from a Geant4 simulation only to get access to the detector geometry." |
| 42 | + "We load a dataset from a Geant4 simulation **only** to get access to the detector geometry.\n", |
| 43 | + "The neutron intensity distribution is not used in this visualization.\n", |
| 44 | + "This visualization only displays the absorption correction at each pixel in the detector." |
43 | 45 | ]
|
44 | 46 | },
|
45 | 47 | {
|
|
69 | 71 | "id": "5",
|
70 | 72 | "metadata": {},
|
71 | 73 | "source": [
|
72 |
| - "### Rod-like sample oriented along x-axis" |
| 74 | + "### Rod-like sample oriented along y-axis" |
73 | 75 | ]
|
74 | 76 | },
|
75 | 77 | {
|
|
87 | 89 | "# The shape determines the shape and the orientation of the sample\n",
|
88 | 90 | "rod_shape = Cylinder(\n",
|
89 | 91 | " radius=sc.scalar(1, unit='cm'),\n",
|
90 |
| - " height=(height := sc.scalar(5., unit='cm')),\n", |
91 |
| - " # Cylinder is oriented along the x-axis\n", |
92 |
| - " symmetry_line=(symmetry_line := sc.vector([1, 0, 0])),\n", |
| 92 | + " height=(height := sc.scalar(10., unit='cm')),\n", |
| 93 | + " # Cylinder is oriented along the y-axis\n", |
| 94 | + " symmetry_line=(symmetry_line := sc.vector([0, 1, 0])),\n", |
93 | 95 | " center_of_base=-height * symmetry_line / 2,\n",
|
94 | 96 | ")"
|
95 | 97 | ]
|
|
105 | 107 | " rod_shape,\n",
|
106 | 108 | " vanadium,\n",
|
107 | 109 | " beam_direction=sc.vector([0, 0, 1]),\n",
|
108 |
| - " wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n", |
| 110 | + " wavelength=sc.geomspace('wavelength', 0.5, 4, 20, unit='angstrom'),\n", |
109 | 111 | " # To make it faster, don't compute the transmission fraction for every detector pixel, it's not necessary for the visualization.\n",
|
110 | 112 | " detector_position=dg['mantle'].coords['position']['strip', ::4]['wire', ::2].copy(),\n",
|
111 | 113 | " quadrature_kind='cheap',\n",
|
112 | 114 | ")\n",
|
113 | 115 | "\n",
|
114 |
| - "# The visualization expects the `position` coord to denote detector positions, and `wavelength` to be the last dimension.\n", |
| 116 | + "# The visualization expects the `position` coord to denote detector positions\n", |
115 | 117 | "transmission_fraction_mantle.coords['position'] = transmission_fraction_mantle.coords.pop('detector_position')\n",
|
116 | 118 | "dream.instrument_view(transmission_fraction_mantle, dim='wavelength', pixel_size=20.0)"
|
117 | 119 | ]
|
|
130 | 132 | "cell_type": "markdown",
|
131 | 133 | "id": "9",
|
132 | 134 | "metadata": {},
|
133 |
| - "source": [ |
134 |
| - "## Disk-like sample oriented along x-axis" |
135 |
| - ] |
136 |
| - }, |
137 |
| - { |
138 |
| - "cell_type": "code", |
139 |
| - "execution_count": null, |
140 |
| - "id": "10", |
141 |
| - "metadata": {}, |
142 |
| - "outputs": [], |
143 |
| - "source": [ |
144 |
| - "disk_shape = Cylinder(\n", |
145 |
| - " radius=sc.scalar(5, unit='cm'),\n", |
146 |
| - " height=(height := sc.scalar(1., unit='cm')),\n", |
147 |
| - " # Cylinder is oriented along the x-axis\n", |
148 |
| - " symmetry_line=(symmetry_line := sc.vector([1, 0, 0])),\n", |
149 |
| - " center_of_base=-height * symmetry_line / 2,\n", |
150 |
| - ")\n", |
151 |
| - "\n", |
152 |
| - "transmission_fraction_mantle = compute_transmission_map(\n", |
153 |
| - " disk_shape,\n", |
154 |
| - " vanadium,\n", |
155 |
| - " beam_direction=sc.vector([0, 0, 1]),\n", |
156 |
| - " wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n", |
157 |
| - " # To make it faster, don't compute the transmission fraction for every detector pixel, it's not necessary for the visualization.\n", |
158 |
| - " detector_position=dg['mantle'].coords['position']['strip', ::4]['wire', ::2].copy(),\n", |
159 |
| - " quadrature_kind='cheap',\n", |
160 |
| - ")\n", |
161 |
| - "\n", |
162 |
| - "# The visualization expects the `position` coord to denote detector positions, and `wavelength` to be the last dimension.\n", |
163 |
| - "transmission_fraction_mantle.coords['position'] = transmission_fraction_mantle.coords.pop('detector_position')\n", |
164 |
| - "dream.instrument_view(transmission_fraction_mantle, dim='wavelength', pixel_size=20.0)" |
165 |
| - ] |
166 |
| - }, |
167 |
| - { |
168 |
| - "cell_type": "markdown", |
169 |
| - "id": "11", |
170 |
| - "metadata": {}, |
171 | 135 | "source": [
|
172 | 136 | "## Does absorption influence the intensity in the endcap detector?"
|
173 | 137 | ]
|
174 | 138 | },
|
175 | 139 | {
|
176 | 140 | "cell_type": "code",
|
177 | 141 | "execution_count": null,
|
178 |
| - "id": "12", |
| 142 | + "id": "10", |
179 | 143 | "metadata": {},
|
180 | 144 | "outputs": [],
|
181 | 145 | "source": [
|
182 | 146 | "transmission_fraction_endcap = compute_transmission_map(\n",
|
183 | 147 | " rod_shape,\n",
|
184 | 148 | " vanadium,\n",
|
185 | 149 | " beam_direction=sc.vector([0, 0, 1]),\n",
|
186 |
| - " wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n", |
| 150 | + " wavelength=sc.geomspace('wavelength', 0.5, 4, 20, unit='angstrom'),\n", |
187 | 151 | " detector_position=dg['endcap_backward'].coords['position']['strip', 0].copy(),\n",
|
188 | 152 | " quadrature_kind='cheap',\n",
|
189 | 153 | ")\n",
|
190 | 154 | "\n",
|
191 | 155 | "transmission_fraction_endcap.coords['position'] = transmission_fraction_endcap.coords.pop('detector_position')\n",
|
192 | 156 | "dream.instrument_view(transmission_fraction_endcap, dim='wavelength', pixel_size=20.0)"
|
193 | 157 | ]
|
194 |
| - }, |
195 |
| - { |
196 |
| - "cell_type": "markdown", |
197 |
| - "id": "13", |
198 |
| - "metadata": {}, |
199 |
| - "source": [ |
200 |
| - "As expected the impact of absorption on on the intensity in the endcap detector is close to uniform." |
201 |
| - ] |
202 | 158 | }
|
203 | 159 | ],
|
204 | 160 | "metadata": {
|
|
0 commit comments