|
46 | 46 | "from easyreflectometry.model import Model\n", |
47 | 47 | "from easyreflectometry.model import LinearSpline\n", |
48 | 48 | "from easyreflectometry.model import PercentageFwhm\n", |
| 49 | + "from easyreflectometry.model import Pointwise\n", |
49 | 50 | "from easyreflectometry.sample import Layer\n", |
50 | 51 | "from easyreflectometry.sample import Material\n", |
51 | 52 | "from easyreflectometry.sample import Multilayer\n", |
|
115 | 116 | "dict_reference['10'] = load(file_path_10)" |
116 | 117 | ] |
117 | 118 | }, |
| 119 | + { |
| 120 | + "cell_type": "code", |
| 121 | + "execution_count": null, |
| 122 | + "id": "e5f65ed7", |
| 123 | + "metadata": {}, |
| 124 | + "outputs": [], |
| 125 | + "source": [ |
| 126 | + "dict_reference['0']" |
| 127 | + ] |
| 128 | + }, |
118 | 129 | { |
119 | 130 | "cell_type": "markdown", |
120 | 131 | "id": "1ab3a164-62c8-4bd3-b0d8-e6f22c83dc74", |
|
251 | 262 | "id": "defd6dd5-c618-4af6-a5c7-17532207f0a0", |
252 | 263 | "metadata": {}, |
253 | 264 | "source": [ |
254 | | - "## Resolution functions\n", |
255 | | - "\n", |
256 | | - "We now define the different resoultion functions. " |
| 265 | + "## Resolution functions " |
| 266 | + ] |
| 267 | + }, |
| 268 | + { |
| 269 | + "cell_type": "markdown", |
| 270 | + "id": "c9d903db", |
| 271 | + "metadata": {}, |
| 272 | + "source": [ |
| 273 | + "We can now define the different resoultion functions. " |
257 | 274 | ] |
258 | 275 | }, |
259 | 276 | { |
|
376 | 393 | "plt.yscale('log')\n", |
377 | 394 | "plt.show()" |
378 | 395 | ] |
| 396 | + }, |
| 397 | + { |
| 398 | + "cell_type": "code", |
| 399 | + "execution_count": null, |
| 400 | + "id": "43881642", |
| 401 | + "metadata": {}, |
| 402 | + "outputs": [], |
| 403 | + "source": [ |
| 404 | + "key = '1'\n", |
| 405 | + "reference_coords = dict_reference[key]['coords']['Qz_0'].values\n", |
| 406 | + "reference_variances = dict_reference[key]['coords']['Qz_0'].variances\n", |
| 407 | + "reference_data = dict_reference[key]['data']['R_0'].values\n", |
| 408 | + "model_coords = np.linspace(\n", |
| 409 | + " start=min(reference_coords),\n", |
| 410 | + " stop=max(reference_coords),\n", |
| 411 | + " num=1000,\n", |
| 412 | + ")\n", |
| 413 | + "\n", |
| 414 | + "model.resolution_function = resolution_function_dict[key]\n", |
| 415 | + "model_data = model.interface().reflectity_profile(\n", |
| 416 | + " model_coords,\n", |
| 417 | + " model.unique_name,\n", |
| 418 | + ")\n", |
| 419 | + "plt.plot(model_coords, model_data, 'k-', label=f'Variable', linewidth=5)\n", |
| 420 | + "data_points = []\n", |
| 421 | + "data_points.append(reference_coords) # Qz\n", |
| 422 | + "data_points.append(reference_data) # R\n", |
| 423 | + "data_points.append(reference_variances) # sQz\n", |
| 424 | + "model.resolution_function = Pointwise(q_data_points=data_points)\n", |
| 425 | + "model_data = model.interface().reflectity_profile(\n", |
| 426 | + " model_coords,\n", |
| 427 | + " model.unique_name,\n", |
| 428 | + ")\n", |
| 429 | + "plt.plot(model_coords, model_data, 'r-', label=f'Pointwise')\n", |
| 430 | + "\n", |
| 431 | + "ax = plt.gca()\n", |
| 432 | + "ax.set_xlim([-0.01, 0.45])\n", |
| 433 | + "ax.set_ylim([1e-10, 2.5])\n", |
| 434 | + "plt.legend()\n", |
| 435 | + "plt.yscale('log')\n", |
| 436 | + "plt.show()" |
| 437 | + ] |
379 | 438 | } |
380 | 439 | ], |
381 | 440 | "metadata": { |
382 | 441 | "kernelspec": { |
383 | | - "display_name": "easyref", |
| 442 | + "display_name": "erl", |
384 | 443 | "language": "python", |
385 | 444 | "name": "python3" |
386 | 445 | }, |
|
394 | 453 | "name": "python", |
395 | 454 | "nbconvert_exporter": "python", |
396 | 455 | "pygments_lexer": "ipython3", |
397 | | - "version": "3.12.9" |
| 456 | + "version": "3.12.10" |
398 | 457 | } |
399 | 458 | }, |
400 | 459 | "nbformat": 4, |
|
0 commit comments