{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "66907835",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:56.040215Z",
"iopub.status.busy": "2026-01-06T13:53:56.036749Z",
"iopub.status.idle": "2026-01-06T13:53:56.067580Z",
"shell.execute_reply": "2026-01-06T13:53:56.051267Z"
},
"tags": [
"hide-in-docs"
]
},
"outputs": [],
"source": [
"# Check if the easydiffraction library is installed.\n",
"# If not, install it with the 'visualization' extras.\n",
"# Needed when running remotely (e.g. Colab) where the lib is absent.\n",
"import builtins\n",
"import importlib.util\n",
"\n",
"if (hasattr(builtins, '__IPYTHON__') and\n",
" importlib.util.find_spec('easydiffraction') is None):\n",
" !pip install 'easydiffraction[visualization]==0.10.1'"
]
},
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Structure Refinement: LBCO, HRPT\n",
"\n",
"This minimalistic example is designed to show how Rietveld refinement\n",
"of a crystal structure can be performed when both the sample model and\n",
"experiment are defined directly in code. Only the experimentally\n",
"measured data is loaded from an external file.\n",
"\n",
"For this example, constant-wavelength neutron powder diffraction data\n",
"for La0.5Ba0.5CoO3 from HRPT at PSI is used.\n",
"\n",
"It does not contain any advanced features or options, and includes no\n",
"comments or explanationsβthese can be found in the other tutorials.\n",
"Default values are used for all parameters if not specified. Only\n",
"essential and self-explanatory code is provided.\n",
"\n",
"The example is intended for users who are already familiar with the\n",
"EasyDiffraction library and want to quickly get started with a simple\n",
"refinement. It is also useful for those who want to see what a\n",
"refinement might look like in code. For a more detailed explanation of\n",
"the code, please refer to the other tutorials."
]
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"## Import Library"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:56.110246Z",
"iopub.status.busy": "2026-01-06T13:53:56.108415Z",
"iopub.status.idle": "2026-01-06T13:53:59.270568Z",
"shell.execute_reply": "2026-01-06T13:53:59.269398Z"
}
},
"outputs": [],
"source": [
"import easydiffraction as ed"
]
},
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
"source": [
"## Step 1: Define Project"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.274617Z",
"iopub.status.busy": "2026-01-06T13:53:59.273353Z",
"iopub.status.idle": "2026-01-06T13:53:59.453863Z",
"shell.execute_reply": "2026-01-06T13:53:59.452776Z"
}
},
"outputs": [],
"source": [
"project = ed.Project()"
]
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"## Step 2: Define Sample Model"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "6",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.458284Z",
"iopub.status.busy": "2026-01-06T13:53:59.457569Z",
"iopub.status.idle": "2026-01-06T13:53:59.468590Z",
"shell.execute_reply": "2026-01-06T13:53:59.467318Z"
}
},
"outputs": [],
"source": [
"project.sample_models.add(name='lbco')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "7",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.471790Z",
"iopub.status.busy": "2026-01-06T13:53:59.470997Z",
"iopub.status.idle": "2026-01-06T13:53:59.479299Z",
"shell.execute_reply": "2026-01-06T13:53:59.477668Z"
}
},
"outputs": [],
"source": [
"sample_model = project.sample_models['lbco']"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "8",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.483829Z",
"iopub.status.busy": "2026-01-06T13:53:59.483006Z",
"iopub.status.idle": "2026-01-06T13:53:59.487638Z",
"shell.execute_reply": "2026-01-06T13:53:59.486472Z"
}
},
"outputs": [],
"source": [
"sample_model.space_group.name_h_m = 'P m -3 m'\n",
"sample_model.space_group.it_coordinate_system_code = '1'"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "9",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.491210Z",
"iopub.status.busy": "2026-01-06T13:53:59.490482Z",
"iopub.status.idle": "2026-01-06T13:53:59.493565Z",
"shell.execute_reply": "2026-01-06T13:53:59.493163Z"
}
},
"outputs": [],
"source": [
"sample_model.cell.length_a = 3.88"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "10",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.495384Z",
"iopub.status.busy": "2026-01-06T13:53:59.495211Z",
"iopub.status.idle": "2026-01-06T13:53:59.503026Z",
"shell.execute_reply": "2026-01-06T13:53:59.502162Z"
}
},
"outputs": [],
"source": [
"sample_model.atom_sites.add(\n",
" label='La',\n",
" type_symbol='La',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" wyckoff_letter='a',\n",
" b_iso=0.5,\n",
" occupancy=0.5,\n",
")\n",
"sample_model.atom_sites.add(\n",
" label='Ba',\n",
" type_symbol='Ba',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" wyckoff_letter='a',\n",
" b_iso=0.5,\n",
" occupancy=0.5,\n",
")\n",
"sample_model.atom_sites.add(\n",
" label='Co',\n",
" type_symbol='Co',\n",
" fract_x=0.5,\n",
" fract_y=0.5,\n",
" fract_z=0.5,\n",
" wyckoff_letter='b',\n",
" b_iso=0.5,\n",
")\n",
"sample_model.atom_sites.add(\n",
" label='O',\n",
" type_symbol='O',\n",
" fract_x=0,\n",
" fract_y=0.5,\n",
" fract_z=0.5,\n",
" wyckoff_letter='c',\n",
" b_iso=0.5,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"## Step 3: Define Experiment"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "12",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.505279Z",
"iopub.status.busy": "2026-01-06T13:53:59.505116Z",
"iopub.status.idle": "2026-01-06T13:53:59.512682Z",
"shell.execute_reply": "2026-01-06T13:53:59.512240Z"
}
},
"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;36m3\u001b[0m: La0.5Ba0.5CoO3, HRPT \u001b[1m(\u001b[0mPSI\u001b[1m)\u001b[0m, \u001b[1;36m300\u001b[0m K\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β
Data #\u001b[1;36m3\u001b[0m already present at \u001b[32m'data/ed-3.xye'\u001b[0m. Keeping existing file.\n"
]
}
],
"source": [
"data_path = ed.download_data(id=3, destination='data')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "13",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:53:59.514648Z",
"iopub.status.busy": "2026-01-06T13:53:59.514274Z",
"iopub.status.idle": "2026-01-06T13:53:59.997400Z",
"shell.execute_reply": "2026-01-06T13:53:59.996441Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mData loaded successfully\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Experiment π¬ \u001b[32m'hrpt'\u001b[0m. Number of data points: \u001b[1;36m3098\u001b[0m\n"
]
}
],
"source": [
"project.experiments.add(\n",
" name='hrpt',\n",
" data_path=data_path,\n",
" sample_form='powder',\n",
" beam_mode='constant wavelength',\n",
" radiation_probe='neutron',\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "14",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.000414Z",
"iopub.status.busy": "2026-01-06T13:54:00.000239Z",
"iopub.status.idle": "2026-01-06T13:54:00.002618Z",
"shell.execute_reply": "2026-01-06T13:54:00.002026Z"
}
},
"outputs": [],
"source": [
"experiment = project.experiments['hrpt']"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "15",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.004944Z",
"iopub.status.busy": "2026-01-06T13:54:00.004804Z",
"iopub.status.idle": "2026-01-06T13:54:00.008177Z",
"shell.execute_reply": "2026-01-06T13:54:00.006731Z"
}
},
"outputs": [],
"source": [
"experiment.instrument.setup_wavelength = 1.494\n",
"experiment.instrument.calib_twotheta_offset = 0.6"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "16",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.010949Z",
"iopub.status.busy": "2026-01-06T13:54:00.010810Z",
"iopub.status.idle": "2026-01-06T13:54:00.013410Z",
"shell.execute_reply": "2026-01-06T13:54:00.013037Z"
}
},
"outputs": [],
"source": [
"experiment.peak.broad_gauss_u = 0.1\n",
"experiment.peak.broad_gauss_v = -0.1\n",
"experiment.peak.broad_gauss_w = 0.1\n",
"experiment.peak.broad_lorentz_y = 0.1"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "17",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.015117Z",
"iopub.status.busy": "2026-01-06T13:54:00.014998Z",
"iopub.status.idle": "2026-01-06T13:54:00.018617Z",
"shell.execute_reply": "2026-01-06T13:54:00.017492Z"
}
},
"outputs": [],
"source": [
"experiment.background.add(id='1', x=10, y=170)\n",
"experiment.background.add(id='2', x=30, y=170)\n",
"experiment.background.add(id='3', x=50, y=170)\n",
"experiment.background.add(id='4', x=110, y=170)\n",
"experiment.background.add(id='5', x=165, y=170)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "18",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.020454Z",
"iopub.status.busy": "2026-01-06T13:54:00.020354Z",
"iopub.status.idle": "2026-01-06T13:54:00.022693Z",
"shell.execute_reply": "2026-01-06T13:54:00.022219Z"
}
},
"outputs": [],
"source": [
"experiment.excluded_regions.add(id='1', start=0, end=5)\n",
"experiment.excluded_regions.add(id='2', start=165, end=180)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "19",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.024353Z",
"iopub.status.busy": "2026-01-06T13:54:00.024252Z",
"iopub.status.idle": "2026-01-06T13:54:00.026403Z",
"shell.execute_reply": "2026-01-06T13:54:00.025853Z"
}
},
"outputs": [],
"source": [
"experiment.linked_phases.add(id='lbco', scale=10.0)"
]
},
{
"cell_type": "markdown",
"id": "20",
"metadata": {},
"source": [
"## Step 4: Perform Analysis"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "21",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.028019Z",
"iopub.status.busy": "2026-01-06T13:54:00.027927Z",
"iopub.status.idle": "2026-01-06T13:54:00.045753Z",
"shell.execute_reply": "2026-01-06T13:54:00.034257Z"
}
},
"outputs": [],
"source": [
"sample_model.cell.length_a.free = True\n",
"\n",
"sample_model.atom_sites['La'].b_iso.free = True\n",
"sample_model.atom_sites['Ba'].b_iso.free = True\n",
"sample_model.atom_sites['Co'].b_iso.free = True\n",
"sample_model.atom_sites['O'].b_iso.free = True"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "22",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.051725Z",
"iopub.status.busy": "2026-01-06T13:54:00.051441Z",
"iopub.status.idle": "2026-01-06T13:54:00.059076Z",
"shell.execute_reply": "2026-01-06T13:54:00.058608Z"
},
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"experiment.instrument.calib_twotheta_offset.free = True\n",
"\n",
"experiment.peak.broad_gauss_u.free = True\n",
"experiment.peak.broad_gauss_v.free = True\n",
"experiment.peak.broad_gauss_w.free = True\n",
"experiment.peak.broad_lorentz_y.free = True\n",
"\n",
"experiment.background['1'].y.free = True\n",
"experiment.background['2'].y.free = True\n",
"experiment.background['3'].y.free = True\n",
"experiment.background['4'].y.free = True\n",
"experiment.background['5'].y.free = True\n",
"\n",
"experiment.linked_phases['lbco'].scale.free = True"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "23",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:00.060968Z",
"iopub.status.busy": "2026-01-06T13:54:00.060864Z",
"iopub.status.idle": "2026-01-06T13:54:16.756417Z",
"shell.execute_reply": "2026-01-06T13:54:16.755180Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mUsing experiment π¬ \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'single'\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",
" iteration | \n",
" ΟΒ² | \n",
" improvement [%] | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" 1 | \n",
" 165.02 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 28 | \n",
" 33.58 | \n",
" 79.7% β | \n",
"
\n",
" \n",
" | 3 | \n",
" 45 | \n",
" 10.82 | \n",
" 67.8% β | \n",
"
\n",
" \n",
" | 4 | \n",
" 63 | \n",
" 6.49 | \n",
" 40.0% β | \n",
"
\n",
" \n",
" | 5 | \n",
" 81 | \n",
" 3.35 | \n",
" 48.4% β | \n",
"
\n",
" \n",
" | 6 | \n",
" 98 | \n",
" 2.24 | \n",
" 33.1% β | \n",
"
\n",
" \n",
" | 7 | \n",
" 116 | \n",
" 1.91 | \n",
" 14.7% β | \n",
"
\n",
" \n",
" | 8 | \n",
" 133 | \n",
" 1.50 | \n",
" 21.3% β | \n",
"
\n",
" \n",
" | 9 | \n",
" 150 | \n",
" 1.45 | \n",
" 3.6% β | \n",
"
\n",
" \n",
" | 10 | \n",
" 167 | \n",
" 1.34 | \n",
" 7.8% β | \n",
"
\n",
" \n",
" | 11 | \n",
" 185 | \n",
" 1.29 | \n",
" 3.4% β | \n",
"
\n",
" \n",
" | 12 | \n",
" 276 | \n",
" 1.29 | \n",
" | \n",
"
\n",
" \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"
},
{
"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;36m1.29\u001b[0m at iteration \u001b[1;36m275\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;36m15.04\u001b[0m seconds\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π Goodness-of-fit \u001b[1m(\u001b[0mreduced ΟΒ²\u001b[1m)\u001b[0m: \u001b[1;36m1.29\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m5.65\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π R-factor squared \u001b[1m(\u001b[0mRfΒ²\u001b[1m)\u001b[0m: \u001b[1;36m5.30\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m4.47\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",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" start | \n",
" fitted | \n",
" uncertainty | \n",
" units | \n",
" change | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" lbco | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 3.8800 | \n",
" 3.8909 | \n",
" 0.0000 | \n",
" Γ
| \n",
" 0.28 % β | \n",
"
\n",
" \n",
" | 2 | \n",
" lbco | \n",
" atom_site | \n",
" La | \n",
" b_iso | \n",
" 0.5000 | \n",
" 0.5052 | \n",
" 3231.4177 | \n",
" Γ
Β² | \n",
" 1.04 % β | \n",
"
\n",
" \n",
" | 3 | \n",
" lbco | \n",
" atom_site | \n",
" Ba | \n",
" b_iso | \n",
" 0.5000 | \n",
" 0.5049 | \n",
" 5252.0523 | \n",
" Γ
Β² | \n",
" 0.97 % β | \n",
"
\n",
" \n",
" | 4 | \n",
" lbco | \n",
" atom_site | \n",
" Co | \n",
" b_iso | \n",
" 0.5000 | \n",
" 0.2370 | \n",
" 0.0611 | \n",
" Γ
Β² | \n",
" 52.60 % β | \n",
"
\n",
" \n",
" | 5 | \n",
" lbco | \n",
" atom_site | \n",
" O | \n",
" b_iso | \n",
" 0.5000 | \n",
" 1.3935 | \n",
" 0.0167 | \n",
" Γ
Β² | \n",
" 178.71 % β | \n",
"
\n",
" \n",
" | 6 | \n",
" hrpt | \n",
" linked_phases | \n",
" lbco | \n",
" scale | \n",
" 10.0000 | \n",
" 9.1351 | \n",
" 0.0642 | \n",
" | \n",
" 8.65 % β | \n",
"
\n",
" \n",
" | 7 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.1000 | \n",
" 0.0816 | \n",
" 0.0031 | \n",
" degΒ² | \n",
" 18.43 % β | \n",
"
\n",
" \n",
" | 8 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.1000 | \n",
" -0.1159 | \n",
" 0.0067 | \n",
" degΒ² | \n",
" 15.93 % β | \n",
"
\n",
" \n",
" | 9 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.1000 | \n",
" 0.1204 | \n",
" 0.0033 | \n",
" degΒ² | \n",
" 20.45 % β | \n",
"
\n",
" \n",
" | 10 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_y | \n",
" 0.1000 | \n",
" 0.0844 | \n",
" 0.0021 | \n",
" deg | \n",
" 15.55 % β | \n",
"
\n",
" \n",
" | 11 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.6000 | \n",
" 0.6226 | \n",
" 0.0010 | \n",
" deg | \n",
" 3.76 % β | \n",
"
\n",
" \n",
" | 12 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 170.0000 | \n",
" 168.5585 | \n",
" 1.3671 | \n",
" | \n",
" 0.85 % β | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 170.0000 | \n",
" 164.3357 | \n",
" 0.9992 | \n",
" | \n",
" 3.33 % β | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 170.0000 | \n",
" 166.8881 | \n",
" 0.7388 | \n",
" | \n",
" 1.83 % β | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 170.0000 | \n",
" 175.4006 | \n",
" 0.6578 | \n",
" | \n",
" 3.18 % β | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 170.0000 | \n",
" 174.2813 | \n",
" 0.9105 | \n",
" | \n",
" 2.52 % β | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.fit()\n",
"project.analysis.show_fit_results()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "24",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:16.759684Z",
"iopub.status.busy": "2026-01-06T13:54:16.759116Z",
"iopub.status.idle": "2026-01-06T13:54:17.130662Z",
"shell.execute_reply": "2026-01-06T13:54:17.130233Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
}
],
"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.13.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}