{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:02.607266Z", "iopub.status.busy": "2026-04-14T14:58:02.606901Z", "iopub.status.idle": "2026-04-14T14:58:02.618898Z", "shell.execute_reply": "2026-04-14T14:58:02.617106Z" }, "tags": [ "hide-in-docs" ] }, "outputs": [], "source": [ "# Check whether easydiffraction is installed; install it if needed.\n", "# Required for remote environments such as Google Colab.\n", "import importlib.util\n", "\n", "if importlib.util.find_spec('easydiffraction') is None:\n", " %pip install easydiffraction==0.13.1" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Joint Refinement: Si, Bragg + PDF\n", "\n", "This example demonstrates a joint refinement of the Si crystal\n", "structure combining Bragg diffraction and pair distribution function\n", "(PDF) analysis. The Bragg experiment uses time-of-flight neutron\n", "powder diffraction data from SEPD at Argonne, while the PDF\n", "experiment uses data from NOMAD at SNS. A single shared Si structure\n", "is refined simultaneously against both datasets." ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "## Import Library" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:02.623168Z", "iopub.status.busy": "2026-04-14T14:58:02.622884Z", "iopub.status.idle": "2026-04-14T14:58:07.879088Z", "shell.execute_reply": "2026-04-14T14:58:07.877945Z" } }, "outputs": [], "source": [ "from easydiffraction import ExperimentFactory\n", "from easydiffraction import Project\n", "from easydiffraction import StructureFactory\n", "from easydiffraction import download_data" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## Define Structure\n", "\n", "A single Si structure is shared between the Bragg and PDF\n", "experiments. Structural parameters refined against both datasets\n", "simultaneously.\n", "\n", "#### Create Structure" ] }, { "cell_type": "code", "execution_count": 3, "id": "5", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.881345Z", "iopub.status.busy": "2026-04-14T14:58:07.880958Z", "iopub.status.idle": "2026-04-14T14:58:07.890916Z", "shell.execute_reply": "2026-04-14T14:58:07.890003Z" } }, "outputs": [], "source": [ "structure = StructureFactory.from_scratch(name='si')" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "#### Set Space Group" ] }, { "cell_type": "code", "execution_count": 4, "id": "7", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.896832Z", "iopub.status.busy": "2026-04-14T14:58:07.896467Z", "iopub.status.idle": "2026-04-14T14:58:07.904574Z", "shell.execute_reply": "2026-04-14T14:58:07.902080Z" } }, "outputs": [], "source": [ "structure.space_group.name_h_m = 'F d -3 m'\n", "structure.space_group.it_coordinate_system_code = '1'" ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "#### Set Unit Cell" ] }, { "cell_type": "code", "execution_count": 5, "id": "9", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.906686Z", "iopub.status.busy": "2026-04-14T14:58:07.906458Z", "iopub.status.idle": "2026-04-14T14:58:07.912648Z", "shell.execute_reply": "2026-04-14T14:58:07.911915Z" } }, "outputs": [], "source": [ "structure.cell.length_a = 5.42" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "#### Set Atom Sites" ] }, { "cell_type": "code", "execution_count": 6, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.915261Z", "iopub.status.busy": "2026-04-14T14:58:07.914915Z", "iopub.status.idle": "2026-04-14T14:58:07.929747Z", "shell.execute_reply": "2026-04-14T14:58:07.927288Z" } }, "outputs": [], "source": [ "structure.atom_sites.create(\n", " label='Si',\n", " type_symbol='Si',\n", " fract_x=0,\n", " fract_y=0,\n", " fract_z=0,\n", " wyckoff_letter='a',\n", " adp_iso=0.2,\n", ")" ] }, { "cell_type": "markdown", "id": "12", "metadata": {}, "source": [ "## Define Experiments\n", "\n", "Two experiments are defined: one for Bragg diffraction and one for\n", "PDF analysis. Both are linked to the same Si structure.\n", "\n", "### Experiment 1: Bragg (SEPD, TOF)\n", "\n", "#### Download Data" ] }, { "cell_type": "code", "execution_count": 7, "id": "13", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.934167Z", "iopub.status.busy": "2026-04-14T14:58:07.933904Z", "iopub.status.idle": "2026-04-14T14:58:07.975919Z", "shell.execute_reply": "2026-04-14T14:58:07.973118Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mGetting data\u001b[0m\u001b[1;34m...\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Data #\u001b[1;36m7\u001b[0m: Si, SEPD \u001b[1m(\u001b[0mArgonne\u001b[1m)\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Data #\u001b[1;36m7\u001b[0m already present at \u001b[32m'data/ed-7.xye'\u001b[0m. Keeping existing file.\n" ] } ], "source": [ "bragg_data_path = download_data(id=7, destination='data')" ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "#### Create Experiment" ] }, { "cell_type": "code", "execution_count": 8, "id": "15", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:07.978620Z", "iopub.status.busy": "2026-04-14T14:58:07.978324Z", "iopub.status.idle": "2026-04-14T14:58:09.208441Z", "shell.execute_reply": "2026-04-14T14:58:09.207394Z" } }, "outputs": [], "source": [ "bragg_expt = ExperimentFactory.from_data_path(\n", " name='sepd', data_path=bragg_data_path, beam_mode='time-of-flight'\n", ")" ] }, { "cell_type": "markdown", "id": "16", "metadata": {}, "source": [ "#### Set Instrument" ] }, { "cell_type": "code", "execution_count": 9, "id": "17", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.211077Z", "iopub.status.busy": "2026-04-14T14:58:09.210767Z", "iopub.status.idle": "2026-04-14T14:58:09.220716Z", "shell.execute_reply": "2026-04-14T14:58:09.220105Z" } }, "outputs": [], "source": [ "bragg_expt.instrument.setup_twotheta_bank = 144.845\n", "bragg_expt.instrument.calib_d_to_tof_offset = -9.2\n", "bragg_expt.instrument.calib_d_to_tof_linear = 7476.91\n", "bragg_expt.instrument.calib_d_to_tof_quad = -1.54" ] }, { "cell_type": "markdown", "id": "18", "metadata": {}, "source": [ "#### Set Peak Profile" ] }, { "cell_type": "code", "execution_count": 10, "id": "19", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.224057Z", "iopub.status.busy": "2026-04-14T14:58:09.223086Z", "iopub.status.idle": "2026-04-14T14:58:09.316759Z", "shell.execute_reply": "2026-04-14T14:58:09.315914Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "⚠️ Switching peak profile type discards existing peak parameters. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mPeak profile type for experiment \u001b[0m\u001b[32m'sepd'\u001b[0m\u001b[1;34m changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "jorgensen\n" ] } ], "source": [ "bragg_expt.peak_profile_type = 'jorgensen'\n", "bragg_expt.peak.broad_gauss_sigma_0 = 5.0\n", "bragg_expt.peak.broad_gauss_sigma_1 = 45.0\n", "bragg_expt.peak.broad_gauss_sigma_2 = 1.0\n", "bragg_expt.peak.exp_decay_beta_0 = 0.04221\n", "bragg_expt.peak.exp_decay_beta_1 = 0.00946\n", "bragg_expt.peak.exp_rise_alpha_0 = 0.0\n", "bragg_expt.peak.exp_rise_alpha_1 = 0.5971" ] }, { "cell_type": "markdown", "id": "20", "metadata": {}, "source": [ "#### Set Background" ] }, { "cell_type": "code", "execution_count": 11, "id": "21", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.319767Z", "iopub.status.busy": "2026-04-14T14:58:09.319503Z", "iopub.status.idle": "2026-04-14T14:58:09.334033Z", "shell.execute_reply": "2026-04-14T14:58:09.333306Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mBackground type for experiment \u001b[0m\u001b[32m'sepd'\u001b[0m\u001b[1;34m already set to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "line-segment\n" ] } ], "source": [ "bragg_expt.background_type = 'line-segment'\n", "for x in range(0, 35000, 5000):\n", " bragg_expt.background.create(id=str(x), x=x, y=200)" ] }, { "cell_type": "markdown", "id": "22", "metadata": {}, "source": [ "#### Set Linked Phases" ] }, { "cell_type": "code", "execution_count": 12, "id": "23", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.342903Z", "iopub.status.busy": "2026-04-14T14:58:09.342612Z", "iopub.status.idle": "2026-04-14T14:58:09.346446Z", "shell.execute_reply": "2026-04-14T14:58:09.345743Z" } }, "outputs": [], "source": [ "bragg_expt.linked_phases.create(id='si', scale=13.0)" ] }, { "cell_type": "markdown", "id": "24", "metadata": {}, "source": [ "### Experiment 2: PDF (NOMAD, TOF)\n", "\n", "#### Download Data" ] }, { "cell_type": "code", "execution_count": 13, "id": "25", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.352685Z", "iopub.status.busy": "2026-04-14T14:58:09.352452Z", "iopub.status.idle": "2026-04-14T14:58:09.363812Z", "shell.execute_reply": "2026-04-14T14:58:09.362967Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mGetting data\u001b[0m\u001b[1;34m...\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Data #\u001b[1;36m5\u001b[0m: NOM_9999_Si_640g_PAC_50_ff_ftfrgr_up-to-\u001b[1;36m50.\u001b[0mgr\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Data #\u001b[1;36m5\u001b[0m already present at \u001b[32m'data/ed-5.gr'\u001b[0m. Keeping existing file.\n" ] } ], "source": [ "pdf_data_path = download_data(id=5, destination='data')" ] }, { "cell_type": "markdown", "id": "26", "metadata": {}, "source": [ "#### Create Experiment" ] }, { "cell_type": "code", "execution_count": 14, "id": "27", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:09.368097Z", "iopub.status.busy": "2026-04-14T14:58:09.367835Z", "iopub.status.idle": "2026-04-14T14:58:10.627727Z", "shell.execute_reply": "2026-04-14T14:58:10.626943Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "⚠️ No uncertainty (sy) column provided. Defaulting to 0.03. \n" ] } ], "source": [ "pdf_expt = ExperimentFactory.from_data_path(\n", " name='nomad',\n", " data_path=pdf_data_path,\n", " beam_mode='time-of-flight',\n", " scattering_type='total',\n", ")" ] }, { "cell_type": "markdown", "id": "28", "metadata": {}, "source": [ "#### Set Peak Profile (PDF Parameters)" ] }, { "cell_type": "code", "execution_count": 15, "id": "29", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:10.633311Z", "iopub.status.busy": "2026-04-14T14:58:10.630464Z", "iopub.status.idle": "2026-04-14T14:58:10.639310Z", "shell.execute_reply": "2026-04-14T14:58:10.638305Z" } }, "outputs": [], "source": [ "pdf_expt.peak.damp_q = 0.02\n", "pdf_expt.peak.broad_q = 0.02\n", "pdf_expt.peak.cutoff_q = 35.0\n", "pdf_expt.peak.sharp_delta_1 = 0.001\n", "pdf_expt.peak.sharp_delta_2 = 4.0\n", "pdf_expt.peak.damp_particle_diameter = 0" ] }, { "cell_type": "markdown", "id": "30", "metadata": {}, "source": [ "#### Set Linked Phases" ] }, { "cell_type": "code", "execution_count": 16, "id": "31", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:10.645339Z", "iopub.status.busy": "2026-04-14T14:58:10.643034Z", "iopub.status.idle": "2026-04-14T14:58:10.652025Z", "shell.execute_reply": "2026-04-14T14:58:10.651038Z" } }, "outputs": [], "source": [ "pdf_expt.linked_phases.create(id='si', scale=1.0)" ] }, { "cell_type": "markdown", "id": "32", "metadata": {}, "source": [ "## Define Project\n", "\n", "The project object manages the shared structure, both experiments,\n", "and the analysis.\n", "\n", "#### Create Project" ] }, { "cell_type": "code", "execution_count": 17, "id": "33", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:10.655077Z", "iopub.status.busy": "2026-04-14T14:58:10.654709Z", "iopub.status.idle": "2026-04-14T14:58:11.413084Z", "shell.execute_reply": "2026-04-14T14:58:11.412173Z" } }, "outputs": [ { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project = Project()" ] }, { "cell_type": "markdown", "id": "34", "metadata": {}, "source": [ "#### Add Structure" ] }, { "cell_type": "code", "execution_count": 18, "id": "35", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:11.418273Z", "iopub.status.busy": "2026-04-14T14:58:11.417949Z", "iopub.status.idle": "2026-04-14T14:58:11.431223Z", "shell.execute_reply": "2026-04-14T14:58:11.425795Z" } }, "outputs": [], "source": [ "project.structures.add(structure)" ] }, { "cell_type": "markdown", "id": "36", "metadata": {}, "source": [ "#### Add Experiments" ] }, { "cell_type": "code", "execution_count": 19, "id": "37", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:11.437690Z", "iopub.status.busy": "2026-04-14T14:58:11.437443Z", "iopub.status.idle": "2026-04-14T14:58:11.447453Z", "shell.execute_reply": "2026-04-14T14:58:11.442787Z" } }, "outputs": [], "source": [ "project.experiments.add(bragg_expt)\n", "project.experiments.add(pdf_expt)" ] }, { "cell_type": "markdown", "id": "38", "metadata": {}, "source": [ "## Perform Analysis\n", "\n", "This section shows the joint analysis process. The calculator is\n", "auto-resolved per experiment: CrysPy for Bragg, PDFfit for PDF.\n", "\n", "#### Set Fit Mode and Weights" ] }, { "cell_type": "code", "execution_count": 20, "id": "39", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:11.449764Z", "iopub.status.busy": "2026-04-14T14:58:11.449520Z", "iopub.status.idle": "2026-04-14T14:58:11.458103Z", "shell.execute_reply": "2026-04-14T14:58:11.457457Z" } }, "outputs": [], "source": [ "project.analysis.fit_mode.mode = 'joint'\n", "project.analysis.joint_fit_experiments.create(id='sepd', weight=0.7)\n", "project.analysis.joint_fit_experiments.create(id='nomad', weight=0.3)" ] }, { "cell_type": "markdown", "id": "40", "metadata": {}, "source": [ "#### Plot Measured vs Calculated (Before Fit)" ] }, { "cell_type": "code", "execution_count": 21, "id": "41", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:11.464520Z", "iopub.status.busy": "2026-04-14T14:58:11.464256Z", "iopub.status.idle": "2026-04-14T14:58:13.041869Z", "shell.execute_reply": "2026-04-14T14:58:13.040989Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.plotter.plot_meas_vs_calc(expt_name='sepd', show_residual=False)" ] }, { "cell_type": "code", "execution_count": 22, "id": "42", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:13.047213Z", "iopub.status.busy": "2026-04-14T14:58:13.046932Z", "iopub.status.idle": "2026-04-14T14:58:13.465738Z", "shell.execute_reply": "2026-04-14T14:58:13.463328Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.plotter.plot_meas_vs_calc(expt_name='nomad', show_residual=False)" ] }, { "cell_type": "markdown", "id": "43", "metadata": {}, "source": [ "#### Set Fitting Parameters\n", "\n", "Shared structural parameters are refined against both datasets\n", "simultaneously." ] }, { "cell_type": "code", "execution_count": 23, "id": "44", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:13.474926Z", "iopub.status.busy": "2026-04-14T14:58:13.474652Z", "iopub.status.idle": "2026-04-14T14:58:13.477899Z", "shell.execute_reply": "2026-04-14T14:58:13.477366Z" } }, "outputs": [], "source": [ "structure.cell.length_a.free = True\n", "structure.atom_sites['Si'].adp_iso.free = True" ] }, { "cell_type": "markdown", "id": "45", "metadata": {}, "source": [ "Bragg experiment parameters." ] }, { "cell_type": "code", "execution_count": 24, "id": "46", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:13.482529Z", "iopub.status.busy": "2026-04-14T14:58:13.481940Z", "iopub.status.idle": "2026-04-14T14:58:13.492877Z", "shell.execute_reply": "2026-04-14T14:58:13.488774Z" } }, "outputs": [], "source": [ "bragg_expt.linked_phases['si'].scale.free = True\n", "bragg_expt.instrument.calib_d_to_tof_offset.free = True\n", "bragg_expt.peak.broad_gauss_sigma_0.free = True\n", "bragg_expt.peak.broad_gauss_sigma_1.free = True\n", "bragg_expt.peak.broad_gauss_sigma_2.free = True\n", "for point in bragg_expt.background:\n", " point.y.free = True" ] }, { "cell_type": "markdown", "id": "47", "metadata": {}, "source": [ "PDF experiment parameters." ] }, { "cell_type": "code", "execution_count": 25, "id": "48", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:13.496046Z", "iopub.status.busy": "2026-04-14T14:58:13.495795Z", "iopub.status.idle": "2026-04-14T14:58:13.503590Z", "shell.execute_reply": "2026-04-14T14:58:13.499971Z" } }, "outputs": [], "source": [ "pdf_expt.linked_phases['si'].scale.free = True\n", "pdf_expt.peak.damp_q.free = True\n", "pdf_expt.peak.broad_q.free = True\n", "pdf_expt.peak.sharp_delta_1.free = True\n", "pdf_expt.peak.sharp_delta_2.free = True" ] }, { "cell_type": "markdown", "id": "49", "metadata": {}, "source": [ "#### Show Free Parameters" ] }, { "cell_type": "code", "execution_count": 26, "id": "50", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:13.506794Z", "iopub.status.busy": "2026-04-14T14:58:13.506537Z", "iopub.status.idle": "2026-04-14T14:58:14.033447Z", "shell.execute_reply": "2026-04-14T14:58:14.032571Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mFree parameters for both structures \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🧩 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m and experiments \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🔬 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\n" ] }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
 datablockcategoryentryparametervalueuncertaintyminmaxunits
1sicelllength_a5.42000-infinfÅ
2siatom_siteSiadp_iso0.20000-infinfŲ
3sepdlinked_phasessiscale13.00000-infinf
4sepdpeakgauss_sigma_05.00000-infinfμs²
5sepdpeakgauss_sigma_145.00000-infinfμs/Å
6sepdpeakgauss_sigma_21.00000-infinfμs²/Ų
7sepdinstrumentd_to_tof_offset-9.20000-infinfμs
8sepdbackground0y200.00000-infinf
9sepdbackground5000y200.00000-infinf
10sepdbackground10000y200.00000-infinf
11sepdbackground15000y200.00000-infinf
12sepdbackground20000y200.00000-infinf
13sepdbackground25000y200.00000-infinf
14sepdbackground30000y200.00000-infinf
15nomadlinked_phasessiscale1.00000-infinf
16nomadpeakdamp_q0.02000-infinfÅ⁻¹
17nomadpeakbroad_q0.02000-infinfÅ⁻²
18nomadpeaksharp_delta_10.00100-infinfÅ
19nomadpeaksharp_delta_24.00000-infinfŲ
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.display.free_params()" ] }, { "cell_type": "markdown", "id": "51", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 27, "id": "52", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T14:58:14.039314Z", "iopub.status.busy": "2026-04-14T14:58:14.035861Z", "iopub.status.idle": "2026-04-14T15:01:01.635278Z", "shell.execute_reply": "2026-04-14T15:01:01.633898Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mUsing all experiments 🔬 \u001b[0m\u001b[1;34m[\u001b[0m\u001b[32m'sepd'\u001b[0m\u001b[1;34m, \u001b[0m\u001b[32m'nomad'\u001b[0m\u001b[1;34m]\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'joint'\u001b[0m\u001b[1;34m fitting\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "🚀 Starting fit process with \u001b[32m'lmfit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mleastsq\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[33m...\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📈 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m change:\n" ] }, { "data": { "text/html": [ "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
 iterationχ²improvement [%]
113378.13
223844.3375.0% ↓
343267.0168.4% ↓
46359.9877.5% ↓
58352.5812.3% ↓
610351.891.3% ↓
717051.87
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "🏆 Best goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m is \u001b[1;36m51.87\u001b[0m at iteration \u001b[1;36m153\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Fitting complete.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;34mFit results\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Success: \u001b[3;92mTrue\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "⏱️ Fitting time: \u001b[1;36m164.15\u001b[0m seconds\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📏 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m: \u001b[1;36m51.87\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📏 R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m10.50\u001b[0m%\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📏 R-factor squared \u001b[1m(\u001b[0mRf²\u001b[1m)\u001b[0m: \u001b[1;36m9.32\u001b[0m%\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📏 Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m8.30\u001b[0m%\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "📈 Fitted parameters:\n" ] }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
 datablockcategoryentryparameterstartfitteduncertaintyunitschange
1sicelllength_a5.42005.43060.0000Å0.20 % ↑
2siatom_siteSiadp_iso0.20000.70410.0037Ų252.05 % ↑
3sepdlinked_phasessiscale13.000016.05690.100823.51 % ↑
4sepdpeakgauss_sigma_05.0000-1.96301.2495μs²139.26 % ↓
5sepdpeakgauss_sigma_145.000050.39132.4601μs/Å11.98 % ↑
6sepdpeakgauss_sigma_21.00000.21550.4974μs²/Ų78.45 % ↓
7sepdinstrumentd_to_tof_offset-9.2000-8.24240.0950μs10.41 % ↓
8sepdbackground0y200.0000280.60643.229140.30 % ↑
9sepdbackground5000y200.0000148.72361.352525.64 % ↓
10sepdbackground10000y200.0000118.29951.419140.85 % ↓
11sepdbackground15000y200.0000135.85292.703632.07 % ↓
12sepdbackground20000y200.0000132.68494.736933.66 % ↓
13sepdbackground25000y200.0000174.98509.520112.51 % ↓
14sepdbackground30000y200.0000180.582119.36489.71 % ↓
15nomadlinked_phasessiscale1.00001.27130.001027.13 % ↑
16nomadpeakdamp_q0.02000.02500.0001Å⁻¹25.16 % ↑
17nomadpeakbroad_q0.02000.01880.0002Å⁻²5.92 % ↓
18nomadpeaksharp_delta_10.00102.43990.0382Å243887.89 % ↑
19nomadpeaksharp_delta_24.0000-1.52820.0898Ų138.21 % ↓
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "⚠️ \u001b[31mRed uncertainty:\u001b[0m exceeds the fitted value (consider adding constraints) \n" ] }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.fit()\n", "project.analysis.display.fit_results()\n", "project.plotter.plot_param_correlations()" ] }, { "cell_type": "markdown", "id": "53", "metadata": {}, "source": [ "#### Plot Measured vs Calculated (After Fit)" ] }, { "cell_type": "code", "execution_count": 28, "id": "54", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T15:01:01.642340Z", "iopub.status.busy": "2026-04-14T15:01:01.638696Z", "iopub.status.idle": "2026-04-14T15:01:01.713039Z", "shell.execute_reply": "2026-04-14T15:01:01.712278Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.plotter.plot_meas_vs_calc(expt_name='sepd', show_residual=False)" ] }, { "cell_type": "code", "execution_count": 29, "id": "55", "metadata": { "execution": { "iopub.execute_input": "2026-04-14T15:01:01.715741Z", "iopub.status.busy": "2026-04-14T15:01:01.715496Z", "iopub.status.idle": "2026-04-14T15:01:01.770765Z", "shell.execute_reply": "2026-04-14T15:01:01.766532Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.plotter.plot_meas_vs_calc(expt_name='nomad', show_residual=False)" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", "main_language": "python", "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.4" } }, "nbformat": 4, "nbformat_minor": 5 }