{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "0",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:23.685313Z",
"iopub.status.busy": "2026-06-04T16:27:23.685146Z",
"iopub.status.idle": "2026-06-04T16:27:23.688902Z",
"shell.execute_reply": "2026-06-04T16:27:23.688208Z"
},
"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.18.0"
]
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"# Structure Refinement: Co2SiO4, D20\n",
"\n",
"This example demonstrates a Rietveld refinement of Co2SiO4 crystal\n",
"structure using constant wavelength neutron powder diffraction data\n",
"from D20 at ILL.\n",
"\n",
"It also shows different ways to set free parameters: standard\n",
"one-by-one and batch setting."
]
},
{
"cell_type": "markdown",
"id": "2",
"metadata": {},
"source": [
"## 🛠️ Import Library"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "3",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:23.690261Z",
"iopub.status.busy": "2026-06-04T16:27:23.690116Z",
"iopub.status.idle": "2026-06-04T16:27:26.255273Z",
"shell.execute_reply": "2026-06-04T16:27:26.254474Z"
}
},
"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",
"This section shows how to add structures and modify their\n",
"parameters.\n",
"\n",
"### Create Structure"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "5",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.256960Z",
"iopub.status.busy": "2026-06-04T16:27:26.256696Z",
"iopub.status.idle": "2026-06-04T16:27:26.261160Z",
"shell.execute_reply": "2026-06-04T16:27:26.260422Z"
}
},
"outputs": [],
"source": [
"structure = StructureFactory.from_scratch(name='cosio')"
]
},
{
"cell_type": "markdown",
"id": "6",
"metadata": {},
"source": [
"### Set Space Group"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.262533Z",
"iopub.status.busy": "2026-06-04T16:27:26.262363Z",
"iopub.status.idle": "2026-06-04T16:27:26.265262Z",
"shell.execute_reply": "2026-06-04T16:27:26.264583Z"
}
},
"outputs": [],
"source": [
"structure.space_group.name_h_m = 'P n m a'\n",
"structure.space_group.it_coordinate_system_code = 'abc'"
]
},
{
"cell_type": "markdown",
"id": "8",
"metadata": {},
"source": [
"### Set Unit Cell"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "9",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.266600Z",
"iopub.status.busy": "2026-06-04T16:27:26.266406Z",
"iopub.status.idle": "2026-06-04T16:27:26.269525Z",
"shell.execute_reply": "2026-06-04T16:27:26.268684Z"
}
},
"outputs": [],
"source": [
"structure.cell.length_a = 10.3\n",
"structure.cell.length_b = 6.0\n",
"structure.cell.length_c = 4.8"
]
},
{
"cell_type": "markdown",
"id": "10",
"metadata": {},
"source": [
"### Set Atom Sites"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "11",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.270839Z",
"iopub.status.busy": "2026-06-04T16:27:26.270673Z",
"iopub.status.idle": "2026-06-04T16:27:26.278625Z",
"shell.execute_reply": "2026-06-04T16:27:26.277893Z"
}
},
"outputs": [],
"source": [
"structure.atom_sites.create(\n",
" label='Co1',\n",
" type_symbol='Co',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" adp_iso=0.5,\n",
")\n",
"structure.atom_sites.create(\n",
" label='Co2',\n",
" type_symbol='Co',\n",
" fract_x=0.279,\n",
" fract_y=0.25,\n",
" fract_z=0.985,\n",
" adp_iso=0.5,\n",
")\n",
"structure.atom_sites.create(\n",
" label='Si',\n",
" type_symbol='Si',\n",
" fract_x=0.094,\n",
" fract_y=0.25,\n",
" fract_z=0.429,\n",
" adp_iso=0.5,\n",
")\n",
"structure.atom_sites.create(\n",
" label='O1',\n",
" type_symbol='O',\n",
" fract_x=0.091,\n",
" fract_y=0.25,\n",
" fract_z=0.771,\n",
" adp_iso=0.5,\n",
")\n",
"structure.atom_sites.create(\n",
" label='O2',\n",
" type_symbol='O',\n",
" fract_x=0.448,\n",
" fract_y=0.25,\n",
" fract_z=0.217,\n",
" adp_iso=0.5,\n",
")\n",
"structure.atom_sites.create(\n",
" label='O3',\n",
" type_symbol='O',\n",
" fract_x=0.164,\n",
" fract_y=0.032,\n",
" fract_z=0.28,\n",
" adp_iso=0.5,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "12",
"metadata": {},
"source": [
"## 🔬 Define Experiment\n",
"\n",
"This section shows how to add experiments, configure their parameters,\n",
"and link the structures defined in the previous step.\n",
"\n",
"### Download Data"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "13",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.280034Z",
"iopub.status.busy": "2026-06-04T16:27:26.279869Z",
"iopub.status.idle": "2026-06-04T16:27:26.448356Z",
"shell.execute_reply": "2026-06-04T16:27:26.447591Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mGetting data\u001b[0m\u001b[1;36m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data #\u001b[1;36m12\u001b[0m: Co2SiO4, D20 \u001b[1m(\u001b[0mILL\u001b[1m)\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Data #\u001b[1;36m12\u001b[0m downloaded to \u001b[32m'../../../data/ed-12.xye'\u001b[0m\n"
]
}
],
"source": [
"data_path = download_data(id=12, 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-06-04T16:27:26.449844Z",
"iopub.status.busy": "2026-06-04T16:27:26.449663Z",
"iopub.status.idle": "2026-06-04T16:27:26.610580Z",
"shell.execute_reply": "2026-06-04T16:27:26.609922Z"
}
},
"outputs": [],
"source": [
"expt = ExperimentFactory.from_data_path(name='d20', data_path=data_path)"
]
},
{
"cell_type": "markdown",
"id": "16",
"metadata": {},
"source": [
"### Set Instrument"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "17",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.612456Z",
"iopub.status.busy": "2026-06-04T16:27:26.612292Z",
"iopub.status.idle": "2026-06-04T16:27:26.615232Z",
"shell.execute_reply": "2026-06-04T16:27:26.614632Z"
}
},
"outputs": [],
"source": [
"expt.instrument.setup_wavelength = 1.87\n",
"expt.instrument.calib_twotheta_offset = 0.1"
]
},
{
"cell_type": "markdown",
"id": "18",
"metadata": {},
"source": [
"### Set Peak Profile"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "19",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.616551Z",
"iopub.status.busy": "2026-06-04T16:27:26.616378Z",
"iopub.status.idle": "2026-06-04T16:27:26.624447Z",
"shell.execute_reply": "2026-06-04T16:27:26.623772Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mPeak types\u001b[0m\n"
]
},
{
"data": {
"text/html": [
"
| | Type | Description |
|---|
| 1 | * | pseudo-voigt | CWL pseudo-Voigt profile |
|---|
| 2 | | pseudo-voigt + empirical asymmetry | CWL pseudo-Voigt profile with empirical asymmetry correction. |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"expt.peak.show_supported()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "20",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.625885Z",
"iopub.status.busy": "2026-06-04T16:27:26.625722Z",
"iopub.status.idle": "2026-06-04T16:27:26.631981Z",
"shell.execute_reply": "2026-06-04T16:27:26.631286Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Switching peak profile type adds these settings with defaults: \n",
" • asym_empir_1=0.0 \n",
" • asym_empir_2=0.0 \n",
" • asym_empir_3=0.0 \n",
" • asym_empir_4=0.0 \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mPeak profile type for experiment \u001b[0m\u001b[32m'd20'\u001b[0m\u001b[1;36m changed to\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"pseudo-voigt + empirical asymmetry\n"
]
}
],
"source": [
"expt.peak.type = 'pseudo-voigt + empirical asymmetry'"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "21",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.633305Z",
"iopub.status.busy": "2026-06-04T16:27:26.633142Z",
"iopub.status.idle": "2026-06-04T16:27:26.636124Z",
"shell.execute_reply": "2026-06-04T16:27:26.635396Z"
}
},
"outputs": [],
"source": [
"expt.peak.broad_gauss_u = 0.3\n",
"expt.peak.broad_gauss_v = -0.5\n",
"expt.peak.broad_gauss_w = 0.4"
]
},
{
"cell_type": "markdown",
"id": "22",
"metadata": {},
"source": [
"### Set Background"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "23",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.637804Z",
"iopub.status.busy": "2026-06-04T16:27:26.637592Z",
"iopub.status.idle": "2026-06-04T16:27:26.643767Z",
"shell.execute_reply": "2026-06-04T16:27:26.643033Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mBackground types\u001b[0m\n"
]
},
{
"data": {
"text/html": [
" | | Type | Description |
|---|
| 1 | | chebyshev | Chebyshev polynomial background |
|---|
| 2 | * | line-segment | Linear interpolation between points |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"expt.background.show_supported()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "24",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.645152Z",
"iopub.status.busy": "2026-06-04T16:27:26.645000Z",
"iopub.status.idle": "2026-06-04T16:27:26.651982Z",
"shell.execute_reply": "2026-06-04T16:27:26.651357Z"
}
},
"outputs": [],
"source": [
"expt.background.create(id='1', x=8, y=500)\n",
"expt.background.create(id='2', x=9, y=500)\n",
"expt.background.create(id='3', x=10, y=500)\n",
"expt.background.create(id='4', x=11, y=500)\n",
"expt.background.create(id='5', x=12, y=500)\n",
"expt.background.create(id='6', x=15, y=500)\n",
"expt.background.create(id='7', x=25, y=500)\n",
"expt.background.create(id='8', x=30, y=500)\n",
"expt.background.create(id='9', x=50, y=500)\n",
"expt.background.create(id='10', x=70, y=500)\n",
"expt.background.create(id='11', x=90, y=500)\n",
"expt.background.create(id='12', x=110, y=500)\n",
"expt.background.create(id='13', x=130, y=500)\n",
"expt.background.create(id='14', x=150, y=500)"
]
},
{
"cell_type": "markdown",
"id": "25",
"metadata": {},
"source": [
"### Set Linked Phases"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "26",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.653325Z",
"iopub.status.busy": "2026-06-04T16:27:26.653143Z",
"iopub.status.idle": "2026-06-04T16:27:26.656011Z",
"shell.execute_reply": "2026-06-04T16:27:26.655309Z"
}
},
"outputs": [],
"source": [
"expt.linked_phases.create(id='cosio', scale=1.0)"
]
},
{
"cell_type": "markdown",
"id": "27",
"metadata": {},
"source": [
"## 📦 Define Project\n",
"\n",
"The project object is used to manage the structure, experiment, and\n",
"analysis.\n",
"\n",
"### Create Project"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "28",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:26.657322Z",
"iopub.status.busy": "2026-06-04T16:27:26.657182Z",
"iopub.status.idle": "2026-06-04T16:27:27.140553Z",
"shell.execute_reply": "2026-06-04T16:27:27.139870Z"
}
},
"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(name='cosio_d20')"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "29",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:27.142069Z",
"iopub.status.busy": "2026-06-04T16:27:27.141908Z",
"iopub.status.idle": "2026-06-04T16:27:27.190503Z",
"shell.execute_reply": "2026-06-04T16:27:27.189779Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mSaving project 📦 \u001b[0m\u001b[32m'cosio_d20'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_5_cosio_d20'\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📄 project.cif\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 structures/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 experiments/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 analysis/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"│ └── 📄 analysis.cif\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"└── 📁 reports/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" └── 📄 cosio_d20.html\n"
]
}
],
"source": [
"project.save_as(dir_path='projects/ed_5_cosio_d20')"
]
},
{
"cell_type": "markdown",
"id": "30",
"metadata": {},
"source": [
"### Add Structure"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "31",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:27.191885Z",
"iopub.status.busy": "2026-06-04T16:27:27.191721Z",
"iopub.status.idle": "2026-06-04T16:27:27.194271Z",
"shell.execute_reply": "2026-06-04T16:27:27.193656Z"
}
},
"outputs": [],
"source": [
"project.structures.add(structure)"
]
},
{
"cell_type": "markdown",
"id": "32",
"metadata": {},
"source": [
"### Add Experiment"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "33",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:27.195702Z",
"iopub.status.busy": "2026-06-04T16:27:27.195529Z",
"iopub.status.idle": "2026-06-04T16:27:27.197976Z",
"shell.execute_reply": "2026-06-04T16:27:27.197293Z"
}
},
"outputs": [],
"source": [
"project.experiments.add(expt)"
]
},
{
"cell_type": "markdown",
"id": "34",
"metadata": {},
"source": [
"## 🚀 Perform Analysis\n",
"\n",
"This section shows the analysis process, including how to set up\n",
"calculation and fitting engines.\n",
"\n",
"### Display Structure"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "35",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:27.199342Z",
"iopub.status.busy": "2026-06-04T16:27:27.199175Z",
"iopub.status.idle": "2026-06-04T16:27:27.503137Z",
"shell.execute_reply": "2026-06-04T16:27:27.502542Z"
}
},
"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"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'cosio'\u001b[0m\u001b[1;36m \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mAtom view type: \u001b[0m\u001b[32m'covalent'\u001b[0m\u001b[1;36m)\u001b[0m\n"
]
},
{
"data": {
"text/html": [
"\n",
"
\n",
"
Loading plot…
\n",
"
\n",
"
\n",
"
\n",
"
drag = rotate
wheel = zoom
right-drag = pan
\n",
"
\n",
"
\n",
"\n",
"\n",
"\n",
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.structure(struct_name='cosio')"
]
},
{
"cell_type": "markdown",
"id": "36",
"metadata": {},
"source": [
"### Display Pattern"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "37",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:27.504895Z",
"iopub.status.busy": "2026-06-04T16:27:27.504734Z",
"iopub.status.idle": "2026-06-04T16:27:28.710988Z",
"shell.execute_reply": "2026-06-04T16:27:28.710295Z"
}
},
"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"
},
{
"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": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='d20')"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "38",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:28.713524Z",
"iopub.status.busy": "2026-06-04T16:27:28.713355Z",
"iopub.status.idle": "2026-06-04T16:27:29.574137Z",
"shell.execute_reply": "2026-06-04T16:27:29.573363Z"
}
},
"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"
},
{
"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": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='d20', x_min=41, x_max=54)"
]
},
{
"cell_type": "markdown",
"id": "39",
"metadata": {},
"source": [
"### Set Free Parameters"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "40",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.575631Z",
"iopub.status.busy": "2026-06-04T16:27:29.575437Z",
"iopub.status.idle": "2026-06-04T16:27:29.585908Z",
"shell.execute_reply": "2026-06-04T16:27:29.585151Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.Co1.fract_x' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.Co1.fract_y' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.Co1.fract_z' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.Co2.fract_y' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.Si.fract_y' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.O1.fract_y' is constrained by symmetry. Ignoring free=True. \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚠️ Parameter 'cosio.atom_site.O2.fract_y' is constrained by symmetry. Ignoring free=True. \n"
]
}
],
"source": [
"structure.cell.length_a.free = True\n",
"structure.cell.length_b.free = True\n",
"structure.cell.length_c.free = True\n",
"\n",
"for atom_site in structure.atom_sites:\n",
" for parameter in ('fract_x', 'fract_y', 'fract_z'):\n",
" getattr(atom_site, parameter).free = True\n",
"\n",
"for atom_site in structure.atom_sites:\n",
" atom_site.adp_iso.free = True\n",
"\n",
"for label in ('O1', 'O2', 'O3'):\n",
" atom_site = structure.atom_sites[label]\n",
" atom_site.occupancy.free = True"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "41",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.587251Z",
"iopub.status.busy": "2026-06-04T16:27:29.587099Z",
"iopub.status.idle": "2026-06-04T16:27:29.590997Z",
"shell.execute_reply": "2026-06-04T16:27:29.590262Z"
}
},
"outputs": [],
"source": [
"expt.linked_phases['cosio'].scale.free = True\n",
"\n",
"expt.instrument.calib_twotheta_offset.free = True\n",
"\n",
"expt.peak.broad_gauss_u.free = True\n",
"expt.peak.broad_gauss_v.free = True\n",
"expt.peak.broad_gauss_w.free = True\n",
"expt.peak.broad_lorentz_y.free = True\n",
"\n",
"expt.peak.asym_empir_2.free = True\n",
"\n",
"for point in expt.background:\n",
" point.y.free = True"
]
},
{
"cell_type": "markdown",
"id": "42",
"metadata": {},
"source": [
"Show free parameters after selection."
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "43",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.592301Z",
"iopub.status.busy": "2026-06-04T16:27:29.592149Z",
"iopub.status.idle": "2026-06-04T16:27:29.626195Z",
"shell.execute_reply": "2026-06-04T16:27:29.625483Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mFree parameters for both structures \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36m🧩 data blocks\u001b[0m\u001b[1;36m)\u001b[0m\u001b[1;36m and experiments \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36m🔬 data blocks\u001b[0m\u001b[1;36m)\u001b[0m\n"
]
},
{
"data": {
"text/html": [
" | datablock | category | entry | parameter | value | uncertainty | min | max | units |
|---|
| 1 | cosio | cell | | length_a | 10.30000 | | -inf | inf | Å |
|---|
| 2 | cosio | cell | | length_b | 6.00000 | | -inf | inf | Å |
|---|
| 3 | cosio | cell | | length_c | 4.80000 | | -inf | inf | Å |
|---|
| 4 | cosio | atom_site | Co1 | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 5 | cosio | atom_site | Co2 | fract_x | 0.27900 | | -inf | inf | |
|---|
| 6 | cosio | atom_site | Co2 | fract_z | 0.98500 | | -inf | inf | |
|---|
| 7 | cosio | atom_site | Co2 | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 8 | cosio | atom_site | Si | fract_x | 0.09400 | | -inf | inf | |
|---|
| 9 | cosio | atom_site | Si | fract_z | 0.42900 | | -inf | inf | |
|---|
| 10 | cosio | atom_site | Si | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 11 | cosio | atom_site | O1 | fract_x | 0.09100 | | -inf | inf | |
|---|
| 12 | cosio | atom_site | O1 | fract_z | 0.77100 | | -inf | inf | |
|---|
| 13 | cosio | atom_site | O1 | occupancy | 1.00000 | | -inf | inf | |
|---|
| 14 | cosio | atom_site | O1 | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 15 | cosio | atom_site | O2 | fract_x | 0.44800 | | -inf | inf | |
|---|
| 16 | cosio | atom_site | O2 | fract_z | 0.21700 | | -inf | inf | |
|---|
| 17 | cosio | atom_site | O2 | occupancy | 1.00000 | | -inf | inf | |
|---|
| 18 | cosio | atom_site | O2 | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 19 | cosio | atom_site | O3 | fract_x | 0.16400 | | -inf | inf | |
|---|
| 20 | cosio | atom_site | O3 | fract_y | 0.03200 | | -inf | inf | |
|---|
| 21 | cosio | atom_site | O3 | fract_z | 0.28000 | | -inf | inf | |
|---|
| 22 | cosio | atom_site | O3 | occupancy | 1.00000 | | -inf | inf | |
|---|
| 23 | cosio | atom_site | O3 | adp_iso | 0.50000 | | -inf | inf | Ų |
|---|
| 24 | d20 | linked_phases | cosio | scale | 1.00000 | | -inf | inf | |
|---|
| 25 | d20 | peak | | asym_empir_2 | 0.00000 | | -inf | inf | |
|---|
| 26 | d20 | peak | | broad_gauss_u | 0.30000 | | -inf | inf | deg² |
|---|
| 27 | d20 | peak | | broad_gauss_v | -0.50000 | | -inf | inf | deg² |
|---|
| 28 | d20 | peak | | broad_gauss_w | 0.40000 | | -inf | inf | deg² |
|---|
| 29 | d20 | peak | | broad_lorentz_y | 0.00000 | | -inf | inf | deg |
|---|
| 30 | d20 | instrument | | twotheta_offset | 0.10000 | | -inf | inf | deg |
|---|
| 31 | d20 | background | 1 | y | 500.00000 | | -inf | inf | |
|---|
| 32 | d20 | background | 2 | y | 500.00000 | | -inf | inf | |
|---|
| 33 | d20 | background | 3 | y | 500.00000 | | -inf | inf | |
|---|
| 34 | d20 | background | 4 | y | 500.00000 | | -inf | inf | |
|---|
| 35 | d20 | background | 5 | y | 500.00000 | | -inf | inf | |
|---|
| 36 | d20 | background | 6 | y | 500.00000 | | -inf | inf | |
|---|
| 37 | d20 | background | 7 | y | 500.00000 | | -inf | inf | |
|---|
| 38 | d20 | background | 8 | y | 500.00000 | | -inf | inf | |
|---|
| 39 | d20 | background | 9 | y | 500.00000 | | -inf | inf | |
|---|
| 40 | d20 | background | 10 | y | 500.00000 | | -inf | inf | |
|---|
| 41 | d20 | background | 11 | y | 500.00000 | | -inf | inf | |
|---|
| 42 | d20 | background | 12 | y | 500.00000 | | -inf | inf | |
|---|
| 43 | d20 | background | 13 | y | 500.00000 | | -inf | inf | |
|---|
| 44 | d20 | background | 14 | y | 500.00000 | | -inf | inf | |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.parameters.free()"
]
},
{
"cell_type": "markdown",
"id": "44",
"metadata": {},
"source": [
"### Set Constraints\n",
"\n",
"Set aliases for parameters."
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "45",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.627591Z",
"iopub.status.busy": "2026-06-04T16:27:29.627413Z",
"iopub.status.idle": "2026-06-04T16:27:29.630583Z",
"shell.execute_reply": "2026-06-04T16:27:29.629995Z"
}
},
"outputs": [],
"source": [
"project.analysis.aliases.create(\n",
" label='biso_Co1',\n",
" param=project.structures['cosio'].atom_sites['Co1'].adp_iso,\n",
")\n",
"project.analysis.aliases.create(\n",
" label='biso_Co2',\n",
" param=project.structures['cosio'].atom_sites['Co2'].adp_iso,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "46",
"metadata": {},
"source": [
"Set constraints."
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "47",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.631885Z",
"iopub.status.busy": "2026-06-04T16:27:29.631735Z",
"iopub.status.idle": "2026-06-04T16:27:29.634522Z",
"shell.execute_reply": "2026-06-04T16:27:29.633836Z"
},
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"project.analysis.constraints.create(expression='biso_Co2 = biso_Co1')"
]
},
{
"cell_type": "markdown",
"id": "48",
"metadata": {},
"source": [
"### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "49",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:27:29.635834Z",
"iopub.status.busy": "2026-06-04T16:27:29.635687Z",
"iopub.status.idle": "2026-06-04T16:28:53.890069Z",
"shell.execute_reply": "2026-06-04T16:28:53.889349Z"
}
},
"outputs": [
{
"data": {
"text/html": [],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"(function() {\n",
" const button = document.getElementById('ed-fit-stop-78a68c029ca048758a0e74415c433a98-button');\n",
" const status = document.getElementById('ed-fit-stop-78a68c029ca048758a0e74415c433a98-status');\n",
" const kernelId = '';\n",
" if (!button) {\n",
" return;\n",
" }\n",
"\n",
" function setStatus(text) {\n",
" if (status) {\n",
" status.textContent = text;\n",
" }\n",
" }\n",
"\n",
" function pageConfig() {\n",
" const element = document.getElementById('jupyter-config-data');\n",
" if (!element || !element.textContent) {\n",
" return {};\n",
" }\n",
" try {\n",
" return JSON.parse(element.textContent);\n",
" } catch (error) {\n",
" return {};\n",
" }\n",
" }\n",
"\n",
" function baseUrl(config) {\n",
" const configured = config.baseUrl || config.base_url ||\n",
" (window.Jupyter && Jupyter.notebook && Jupyter.notebook.base_url);\n",
" if (configured) {\n",
" return configured.endsWith('/') ? configured : configured + '/';\n",
" }\n",
" const markers = ['/lab/', '/notebooks/', '/tree/'];\n",
" for (const marker of markers) {\n",
" const index = window.location.pathname.indexOf(marker);\n",
" if (index >= 0) {\n",
" return window.location.pathname.slice(0, index + 1);\n",
" }\n",
" }\n",
" return '/';\n",
" }\n",
"\n",
" function token(config) {\n",
" return config.token || new URLSearchParams(window.location.search).get('token') || '';\n",
" }\n",
"\n",
" function cookie(name) {\n",
" const prefix = name + '=';\n",
" for (const part of document.cookie.split(';')) {\n",
" const trimmed = part.trim();\n",
" if (trimmed.startsWith(prefix)) {\n",
" return decodeURIComponent(trimmed.slice(prefix.length));\n",
" }\n",
" }\n",
" return '';\n",
" }\n",
"\n",
" function notebookPath() {\n",
" const decoded = decodeURIComponent(window.location.pathname);\n",
" const markers = ['/lab/tree/', '/notebooks/', '/tree/'];\n",
" for (const marker of markers) {\n",
" const index = decoded.indexOf(marker);\n",
" if (index >= 0) {\n",
" return decoded.slice(index + marker.length);\n",
" }\n",
" }\n",
" return '';\n",
" }\n",
"\n",
" async function kernelFromSessions(config) {\n",
" const url = new URL(baseUrl(config) + 'api/sessions', window.location.origin);\n",
" const authToken = token(config);\n",
" if (authToken) {\n",
" url.searchParams.set('token', authToken);\n",
" }\n",
" const response = await fetch(url, {credentials: 'same-origin'});\n",
" if (!response.ok) {\n",
" return '';\n",
" }\n",
" const sessions = await response.json();\n",
" const path = notebookPath();\n",
" const session = sessions.find((item) => item.path === path) || sessions[0];\n",
" return session && session.kernel ? session.kernel.id : '';\n",
" }\n",
"\n",
" async function interruptKernel(config, resolvedKernelId) {\n",
" const url = new URL(\n",
" baseUrl(config) + 'api/kernels/' + resolvedKernelId + '/interrupt',\n",
" window.location.origin\n",
" );\n",
" const authToken = token(config);\n",
" if (authToken) {\n",
" url.searchParams.set('token', authToken);\n",
" }\n",
" const xsrfToken = cookie('_xsrf');\n",
" const headers = {};\n",
" if (xsrfToken) {\n",
" headers['X-XSRFToken'] = xsrfToken;\n",
" }\n",
" const response = await fetch(url, {\n",
" method: 'POST',\n",
" credentials: 'same-origin',\n",
" headers: headers\n",
" });\n",
" return response.ok;\n",
" }\n",
"\n",
" button.addEventListener('click', async function() {\n",
" button.disabled = true;\n",
" setStatus('Stopping...');\n",
" const config = pageConfig();\n",
" try {\n",
" const resolvedKernelId = kernelId || await kernelFromSessions(config);\n",
" if (!resolvedKernelId) {\n",
" throw new Error('Could not resolve the current kernel id.');\n",
" }\n",
" const interrupted = await interruptKernel(config, resolvedKernelId);\n",
" if (!interrupted) {\n",
" throw new Error('Jupyter Server rejected the interrupt request.');\n",
" }\n",
" setStatus('Interrupt sent...');\n",
" } catch (error) {\n",
" button.disabled = false;\n",
" setStatus('Use Kernel > Interrupt to stop this fit.');\n",
" }\n",
" });\n",
"})();\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mStandard fitting\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📋 Using experiment 🔬 \u001b[32m'd20'\u001b[0m for \u001b[32m'single'\u001b[0m fitting\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 progress:\n"
]
},
{
"data": {
"text/html": [
" | iteration | time (s) | χ² | change / status |
|---|
| 1 | 1 | 0.28 | 424.43 | |
|---|
| 2 | 35 | 5.40 | 424.43 | |
|---|
| 3 | 47 | 7.52 | 73.78 | 82.6% ↓ |
|---|
| 4 | 75 | 12.63 | 73.78 | |
|---|
| 5 | 91 | 15.33 | 39.41 | 46.6% ↓ |
|---|
| 6 | 117 | 20.37 | 39.41 | |
|---|
| 7 | 136 | 23.30 | 19.47 | 50.6% ↓ |
|---|
| 8 | 165 | 28.37 | 19.47 | |
|---|
| 9 | 180 | 31.21 | 17.19 | 11.7% ↓ |
|---|
| 10 | 211 | 36.34 | 17.19 | |
|---|
| 11 | 224 | 38.44 | 11.03 | 35.8% ↓ |
|---|
| 12 | 267 | 43.52 | 11.03 | |
|---|
| 13 | 268 | 43.63 | 7.94 | 28.0% ↓ |
|---|
| 14 | 309 | 48.71 | 7.94 | |
|---|
| 15 | 312 | 49.01 | 4.67 | 41.2% ↓ |
|---|
| 16 | 354 | 54.10 | 4.67 | |
|---|
| 17 | 356 | 54.30 | 4.38 | 6.2% ↓ |
|---|
| 18 | 395 | 59.36 | 4.38 | |
|---|
| 19 | 435 | 64.55 | 4.38 | |
|---|
| 20 | 477 | 69.85 | 4.38 | |
|---|
| 21 | 519 | 75.02 | 4.38 | |
|---|
| 22 | 562 | 80.33 | 4.38 | |
|---|
| 23 | 577 | 83.31 | 4.38 | |
|---|
"
],
"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;36m4.38\u001b[0m at iteration \u001b[1;36m560\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Fitting complete.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mSaving project 📦 \u001b[0m\u001b[32m'cosio_d20'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_5_cosio_d20'\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📄 project.cif\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 structures/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"│ └── 📄 cosio.cif\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 experiments/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"│ └── 📄 d20.cif\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"├── 📁 analysis/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"│ └── 📄 analysis.cif\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": {
"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": [
"└── 📁 reports/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" └── 📄 cosio_d20.html\n"
]
}
],
"source": [
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "50",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:28:53.891838Z",
"iopub.status.busy": "2026-06-04T16:28:53.891665Z",
"iopub.status.idle": "2026-06-04T16:28:54.287045Z",
"shell.execute_reply": "2026-06-04T16:28:54.286375Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"⚙️ Settings used:\n"
]
},
{
"data": {
"text/html": [
" | Name | Value | Description |
|---|
| 1 | max_iterations | 1000 | Maximum solver iterations. |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📋 Least-squares fit results:\n"
]
},
{
"data": {
"text/html": [
" | Metric | Value |
|---|
| 1 | 🧪 Minimizer | lmfit (leastsq) |
|---|
| 2 | ✅ Overall status | success |
|---|
| 3 | ⏱️ Fitting time (seconds) | 83.31 |
|---|
| 4 | 🔁 Iterations | 574 |
|---|
| 5 | 📏 Goodness-of-fit (reduced χ²) | 4.38 |
|---|
| 6 | 📏 R-factor (Rf, %) | 2.99 |
|---|
| 7 | 📏 R-factor squared (Rf², %) | 4.32 |
|---|
| 8 | 📏 Weighted R-factor (wR, %) | 4.54 |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Refined parameters:\n"
]
},
{
"data": {
"text/html": [
" | datablock | category | entry | parameter | units | start | value | s.u. | change |
|---|
| 1 | cosio | cell | | length_a | Å | 10.3000 | 10.3084 | 0.0003 | 0.08 % ↑ |
|---|
| 2 | cosio | cell | | length_b | Å | 6.0000 | 6.0036 | 0.0002 | 0.06 % ↑ |
|---|
| 3 | cosio | cell | | length_c | Å | 4.8000 | 4.7864 | 0.0001 | 0.28 % ↓ |
|---|
| 4 | cosio | atom_site | Co1 | adp_iso | Ų | 0.5000 | 0.6716 | 0.1079 | 34.32 % ↑ |
|---|
| 5 | cosio | atom_site | Co2 | fract_x | | 0.2790 | 0.2792 | 0.0007 | 0.06 % ↑ |
|---|
| 6 | cosio | atom_site | Co2 | fract_z | | 0.9850 | 0.9850 | 0.0014 | 0.00 % ↓ |
|---|
| 7 | cosio | atom_site | Si | fract_x | | 0.0940 | 0.0938 | 0.0004 | 0.25 % ↓ |
|---|
| 8 | cosio | atom_site | Si | fract_z | | 0.4290 | 0.4293 | 0.0008 | 0.08 % ↑ |
|---|
| 9 | cosio | atom_site | Si | adp_iso | Ų | 0.5000 | 0.6856 | 0.0885 | 37.11 % ↑ |
|---|
| 10 | cosio | atom_site | O1 | fract_x | | 0.0910 | 0.0911 | 0.0003 | 0.14 % ↑ |
|---|
| 11 | cosio | atom_site | O1 | fract_z | | 0.7710 | 0.7715 | 0.0006 | 0.07 % ↑ |
|---|
| 12 | cosio | atom_site | O1 | occupancy | | 1.0000 | 0.9149 | 0.0136 | 8.51 % ↓ |
|---|
| 13 | cosio | atom_site | O1 | adp_iso | Ų | 0.5000 | 0.4655 | 0.0776 | 6.90 % ↓ |
|---|
| 14 | cosio | atom_site | O2 | fract_x | | 0.4480 | 0.4482 | 0.0003 | 0.04 % ↑ |
|---|
| 15 | cosio | atom_site | O2 | fract_z | | 0.2170 | 0.2171 | 0.0007 | 0.04 % ↑ |
|---|
| 16 | cosio | atom_site | O2 | occupancy | | 1.0000 | 0.9589 | 0.0135 | 4.11 % ↓ |
|---|
| 17 | cosio | atom_site | O2 | adp_iso | Ų | 0.5000 | 0.6701 | 0.0795 | 34.03 % ↑ |
|---|
| 18 | cosio | atom_site | O3 | fract_x | | 0.1640 | 0.1636 | 0.0002 | 0.24 % ↓ |
|---|
| 19 | cosio | atom_site | O3 | fract_y | | 0.0320 | 0.0315 | 0.0003 | 1.47 % ↓ |
|---|
| 20 | cosio | atom_site | O3 | fract_z | | 0.2800 | 0.2802 | 0.0005 | 0.07 % ↑ |
|---|
| 21 | cosio | atom_site | O3 | occupancy | | 1.0000 | 0.9549 | 0.0118 | 4.51 % ↓ |
|---|
| 22 | cosio | atom_site | O3 | adp_iso | Ų | 0.5000 | 0.8491 | 0.0614 | 69.83 % ↑ |
|---|
| 23 | d20 | linked_phases | cosio | scale | | 1.0000 | 1.3308 | 0.0289 | 33.08 % ↑ |
|---|
| 24 | d20 | peak | | asym_empir_2 | | 0.0000 | -0.0087 | 0.0019 | N/A |
|---|
| 25 | d20 | peak | | broad_gauss_u | deg² | 0.3000 | 0.2420 | 0.0066 | 19.32 % ↓ |
|---|
| 26 | d20 | peak | | broad_gauss_v | deg² | -0.5000 | -0.5306 | 0.0143 | 6.11 % ↑ |
|---|
| 27 | d20 | peak | | broad_gauss_w | deg² | 0.4000 | 0.3881 | 0.0089 | 2.98 % ↓ |
|---|
| 28 | d20 | peak | | broad_lorentz_y | deg | 0.0000 | 0.0137 | 0.0044 | N/A |
|---|
| 29 | d20 | instrument | | twotheta_offset | deg | 0.1000 | 0.2762 | 0.0033 | 176.23 % ↑ |
|---|
| 30 | d20 | background | 1 | y | | 500.0000 | 608.7247 | 14.2455 | 21.74 % ↑ |
|---|
| 31 | d20 | background | 2 | y | | 500.0000 | 580.6999 | 9.5299 | 16.14 % ↑ |
|---|
| 32 | d20 | background | 3 | y | | 500.0000 | 562.9608 | 9.0541 | 12.59 % ↑ |
|---|
| 33 | d20 | background | 4 | y | | 500.0000 | 540.3572 | 8.5911 | 8.07 % ↑ |
|---|
| 34 | d20 | background | 5 | y | | 500.0000 | 519.8448 | 5.9267 | 3.97 % ↑ |
|---|
| 35 | d20 | background | 6 | y | | 500.0000 | 507.5406 | 3.4171 | 1.51 % ↑ |
|---|
| 36 | d20 | background | 7 | y | | 500.0000 | 462.8842 | 3.1447 | 7.42 % ↓ |
|---|
| 37 | d20 | background | 8 | y | | 500.0000 | 430.7947 | 2.4268 | 13.84 % ↓ |
|---|
| 38 | d20 | background | 9 | y | | 500.0000 | 451.5176 | 2.2116 | 9.70 % ↓ |
|---|
| 39 | d20 | background | 10 | y | | 500.0000 | 429.1040 | 1.9992 | 14.18 % ↓ |
|---|
| 40 | d20 | background | 11 | y | | 500.0000 | 413.5987 | 2.2203 | 17.28 % ↓ |
|---|
| 41 | d20 | background | 12 | y | | 500.0000 | 362.0222 | 2.0545 | 27.60 % ↓ |
|---|
| 42 | d20 | background | 13 | y | | 500.0000 | 292.8711 | 1.9349 | 41.43 % ↓ |
|---|
| 43 | d20 | background | 14 | y | | 500.0000 | 241.1480 | 2.9203 | 51.77 % ↓ |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
" • start = parameter value before refinement
• value = refined value from least-squares minimization
• s.u. = standard uncertainty (one sigma), from the covariance matrix
• change = relative change from start, in %; ↑ = increase, ↓ = decrease
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.fit.results()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "51",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:28:54.288990Z",
"iopub.status.busy": "2026-06-04T16:28:54.288681Z",
"iopub.status.idle": "2026-06-04T16:28:55.138658Z",
"shell.execute_reply": "2026-06-04T16:28:55.137841Z"
}
},
"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"
},
{
"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": {
"text/html": [
"\n",
"\n",
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.fit.correlations()"
]
},
{
"cell_type": "markdown",
"id": "52",
"metadata": {},
"source": [
"### Display Pattern"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "53",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:28:55.140280Z",
"iopub.status.busy": "2026-06-04T16:28:55.140108Z",
"iopub.status.idle": "2026-06-04T16:28:56.043991Z",
"shell.execute_reply": "2026-06-04T16:28:56.043126Z"
}
},
"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"
},
{
"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": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='d20')"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "54",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-04T16:28:56.047708Z",
"iopub.status.busy": "2026-06-04T16:28:56.047513Z",
"iopub.status.idle": "2026-06-04T16:28:56.981288Z",
"shell.execute_reply": "2026-06-04T16:28:56.980468Z"
}
},
"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"
},
{
"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": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='d20', x_min=42, x_max=52)"
]
},
{
"cell_type": "markdown",
"id": "55",
"metadata": {},
"source": [
"## 📊 Report\n",
"\n",
"The HTML report is written automatically when the project is saved;\n",
"enable `project.report.pdf` as well for a PDF version."
]
}
],
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}