{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:04.336111Z", "iopub.status.busy": "2026-06-04T16:26:04.335915Z", "iopub.status.idle": "2026-06-04T16:26:04.341315Z", "shell.execute_reply": "2026-06-04T16:26:04.340369Z" }, "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: LBCO, HRPT\n", "\n", "This example demonstrates how to use the EasyDiffraction API in a\n", "simplified, user-friendly manner that closely follows the GUI workflow\n", "for a Rietveld refinement of La0.5Ba0.5CoO3 crystal structure using\n", "constant wavelength neutron powder diffraction data from HRPT at PSI.\n", "\n", "It is intended for users with minimal programming experience who want\n", "to learn how to perform standard crystal structure fitting using\n", "diffraction data. This script covers creating a project, adding\n", "crystal structures and experiments, performing analysis, and refining\n", "parameters.\n", "\n", "Only a single import of `easydiffraction` is required, and all\n", "operations are performed through high-level components of the\n", "`project` object, such as `project.structures`,\n", "`project.experiments`, and `project.analysis`. The `project` object is\n", "the main container for all information." ] }, { "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:26:04.345128Z", "iopub.status.busy": "2026-06-04T16:26:04.344914Z", "iopub.status.idle": "2026-06-04T16:26:08.251373Z", "shell.execute_reply": "2026-06-04T16:26:08.250475Z" } }, "outputs": [], "source": [ "import easydiffraction as ed" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## πŸ“¦ Define Project\n", "\n", "This section explains how to create a project and define its metadata." ] }, { "cell_type": "markdown", "id": "5", "metadata": {}, "source": [ "### Create Project" ] }, { "cell_type": "code", "execution_count": 3, "id": "6", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:08.253369Z", "iopub.status.busy": "2026-06-04T16:26:08.252998Z", "iopub.status.idle": "2026-06-04T16:26:08.915208Z", "shell.execute_reply": "2026-06-04T16:26:08.911873Z" } }, "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 = ed.Project(name='lbco_hrpt')" ] }, { "cell_type": "markdown", "id": "7", "metadata": {}, "source": [ "### Set Project Metadata" ] }, { "cell_type": "code", "execution_count": 4, "id": "8", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:08.917232Z", "iopub.status.busy": "2026-06-04T16:26:08.916864Z", "iopub.status.idle": "2026-06-04T16:26:08.924846Z", "shell.execute_reply": "2026-06-04T16:26:08.921521Z" } }, "outputs": [], "source": [ "project.info.title = 'La0.5Ba0.5CoO3 at HRPT@PSI'\n", "project.info.description = \"\"\"This project demonstrates a standard\n", "refinement of La0.5Ba0.5CoO3, which crystallizes in a perovskite-type\n", "structure, using neutron powder diffraction data collected in constant\n", "wavelength mode at the HRPT diffractometer (PSI).\"\"\"" ] }, { "cell_type": "markdown", "id": "9", "metadata": {}, "source": [ "### Show Project Metadata as CIF" ] }, { "cell_type": "code", "execution_count": 5, "id": "10", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:08.926728Z", "iopub.status.busy": "2026-06-04T16:26:08.926503Z", "iopub.status.idle": "2026-06-04T16:26:08.959159Z", "shell.execute_reply": "2026-06-04T16:26:08.957362Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mProject πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m info as CIF\u001b[0m\n" ] }, { "data": { "text/html": [ "
CIF
1_project.id lbco_hrpt
2_project.title "La0.5Ba0.5CoO3 at HRPT@PSI"
3_project.description
4;
5This project demonstrates a standard refinement of
6La0.5Ba0.5CoO3, which crystallizes in a perovskite-type
7structure, using neutron powder diffraction data collected
8in constant wavelength mode at the HRPT diffractometer
9(PSI).
10;
11_project.created "04 Jun 2026 16:26:08"
12_project.last_modified "04 Jun 2026 16:26:08"
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.info.show_as_cif()" ] }, { "cell_type": "markdown", "id": "11", "metadata": {}, "source": [ "### Save Project\n", "\n", "When saving the project for the first time, you need to specify the\n", "directory path." ] }, { "cell_type": "code", "execution_count": 6, "id": "12", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:08.961382Z", "iopub.status.busy": "2026-06-04T16:26:08.961168Z", "iopub.status.idle": "2026-06-04T16:26:09.058905Z", "shell.execute_reply": "2026-06-04T16:26:09.057220Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ " └── πŸ“„ lbco_hrpt.html\n" ] } ], "source": [ "project.save_as(dir_path='projects/ed_3_lbco_hrpt')" ] }, { "cell_type": "markdown", "id": "13", "metadata": {}, "source": [ "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters." ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "### Add Structure" ] }, { "cell_type": "code", "execution_count": 7, "id": "15", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.061400Z", "iopub.status.busy": "2026-06-04T16:26:09.061193Z", "iopub.status.idle": "2026-06-04T16:26:09.065831Z", "shell.execute_reply": "2026-06-04T16:26:09.064776Z" } }, "outputs": [], "source": [ "project.structures.create(name='lbco')" ] }, { "cell_type": "markdown", "id": "16", "metadata": {}, "source": [ "### Show Defined Structures\n", "\n", "Show the names of the crystal structures added. These names are used\n", "to access the structure using the syntax:\n", "`project.structures[name]`. All structure parameters can be accessed\n", "via the `project` object." ] }, { "cell_type": "code", "execution_count": 8, "id": "17", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.068067Z", "iopub.status.busy": "2026-06-04T16:26:09.067212Z", "iopub.status.idle": "2026-06-04T16:26:09.074533Z", "shell.execute_reply": "2026-06-04T16:26:09.073433Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mDefined structures 🧩\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1m[\u001b[0m\u001b[32m'lbco'\u001b[0m\u001b[1m]\u001b[0m\n" ] } ], "source": [ "project.structures.show_names()" ] }, { "cell_type": "markdown", "id": "18", "metadata": {}, "source": [ "### Set Space Group\n", "\n", "Modify the default space group parameters." ] }, { "cell_type": "code", "execution_count": 9, "id": "19", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.076279Z", "iopub.status.busy": "2026-06-04T16:26:09.076106Z", "iopub.status.idle": "2026-06-04T16:26:09.082131Z", "shell.execute_reply": "2026-06-04T16:26:09.081604Z" } }, "outputs": [], "source": [ "project.structures['lbco'].space_group.name_h_m = 'P m -3 m'\n", "project.structures['lbco'].space_group.it_coordinate_system_code = '1'" ] }, { "cell_type": "markdown", "id": "20", "metadata": {}, "source": [ "### Set Unit Cell\n", "\n", "Modify the default unit cell parameters." ] }, { "cell_type": "code", "execution_count": 10, "id": "21", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.084212Z", "iopub.status.busy": "2026-06-04T16:26:09.084018Z", "iopub.status.idle": "2026-06-04T16:26:09.090901Z", "shell.execute_reply": "2026-06-04T16:26:09.090396Z" } }, "outputs": [], "source": [ "project.structures['lbco'].cell.length_a = 3.88" ] }, { "cell_type": "markdown", "id": "22", "metadata": {}, "source": [ "### Set Atom Sites\n", "\n", "Add atom sites to the structure." ] }, { "cell_type": "code", "execution_count": 11, "id": "23", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.092903Z", "iopub.status.busy": "2026-06-04T16:26:09.092711Z", "iopub.status.idle": "2026-06-04T16:26:09.110853Z", "shell.execute_reply": "2026-06-04T16:26:09.109542Z" } }, "outputs": [], "source": [ "project.structures['lbco'].atom_sites.create(\n", " label='La',\n", " type_symbol='La',\n", " fract_x=0,\n", " fract_y=0,\n", " fract_z=0,\n", " adp_iso=0.5,\n", " occupancy=0.5,\n", ")\n", "project.structures['lbco'].atom_sites.create(\n", " label='Ba',\n", " type_symbol='Ba',\n", " fract_x=0,\n", " fract_y=0,\n", " fract_z=0,\n", " adp_iso=0.5,\n", " occupancy=0.5,\n", ")\n", "project.structures['lbco'].atom_sites.create(\n", " label='Co',\n", " type_symbol='Co',\n", " fract_x=0.5,\n", " fract_y=0.5,\n", " fract_z=0.5,\n", " adp_iso=0.5,\n", ")\n", "project.structures['lbco'].atom_sites.create(\n", " label='O',\n", " type_symbol='O',\n", " fract_x=0,\n", " fract_y=0.5,\n", " fract_z=0.5,\n", " adp_iso=0.5,\n", ")" ] }, { "cell_type": "markdown", "id": "24", "metadata": {}, "source": [ "### Show Structure as CIF" ] }, { "cell_type": "code", "execution_count": 12, "id": "25", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.112922Z", "iopub.status.busy": "2026-06-04T16:26:09.112739Z", "iopub.status.idle": "2026-06-04T16:26:09.592657Z", "shell.execute_reply": "2026-06-04T16:26:09.592060Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'lbco'\u001b[0m\u001b[1;36m as cif\u001b[0m\n" ] }, { "data": { "text/html": [ "
CIF
1data_lbco
2
3_cell.length_a 3.88
4_cell.length_b 3.88
5_cell.length_c 3.88
6_cell.angle_alpha 90.
7_cell.angle_beta 90.
8_cell.angle_gamma 90.
9
10_space_group.name_H-M_alt "P m -3 m"
11_space_group.IT_coordinate_system_code 1
12
13_geom.min_bond_distance_cutoff 0.
14_geom.bond_distance_incr 0.25
15
16loop_
17_atom_site.label
18_atom_site.type_symbol
19_atom_site.fract_x
20_atom_site.fract_y
21_atom_site.fract_z
22_atom_site.Wyckoff_symbol
23_atom_site.site_symmetry_multiplicity
24_atom_site.occupancy
25_atom_site.B_iso_or_equiv
26_atom_site.ADP_type
27La La 0. 0. 0. a 1 0.5 0.5 Biso
28Ba Ba 0. 0. 0. a 1 0.5 0.5 Biso
29Co Co 0.5 0.5 0.5 b 1 1. 0.5 Biso
30O O 0. 0.5 0.5 c 3 1. 0.5 Biso
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.structures['lbco'].show_as_cif()" ] }, { "cell_type": "markdown", "id": "26", "metadata": {}, "source": [ "### Display Structure\n", "\n", "EasyDiffraction can draw the structure that has just been defined. The\n", "renderer engine is selected through `project.rendering_structure`. The default `auto`\n", "engine resolves to an interactive `threejs` view inside Jupyter and a\n", "compact `ascii` schematic in a terminal." ] }, { "cell_type": "code", "execution_count": 13, "id": "27", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.597672Z", "iopub.status.busy": "2026-06-04T16:26:09.597431Z", "iopub.status.idle": "2026-06-04T16:26:09.614753Z", "shell.execute_reply": "2026-06-04T16:26:09.610932Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mRendering Structure types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1*autoEnvironment default structure-view engine
2asciiConsole ASCII schematic structure view
3threejsInteractive Three.js 3D structure view
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.rendering_structure.show_supported()" ] }, { "cell_type": "markdown", "id": "28", "metadata": {}, "source": [ "Show all public attributes of the structure rendering engine." ] }, { "cell_type": "code", "execution_count": 14, "id": "29", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.620763Z", "iopub.status.busy": "2026-06-04T16:26:09.620586Z", "iopub.status.idle": "2026-06-04T16:26:09.632865Z", "shell.execute_reply": "2026-06-04T16:26:09.632217Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mProperties\u001b[0m\n" ] }, { "data": { "text/html": [ "
NameWritableDescription
1as_cifReturn the CIF text for this rendering_structure category.
2parametersAll GenericDescriptorBase instances on this item.
3typeβœ“Active factory tag for this category.
4unique_nameFully qualified name: datablock, category, entry.
5viewerLive structure-view facade bound to the active engine.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mMethods\u001b[0m\n" ] }, { "data": { "text/html": [ "
NameDescription
1from_cif()Populate this category from a CIF block, rebinding engine.
2help()Print parameters, other properties, and methods.
3show_supported()Print supported types and mark the active one.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.rendering_structure.help()" ] }, { "cell_type": "markdown", "id": "30", "metadata": {}, "source": [ "Visual styling β€” the atom view and colour scheme β€” is configured on\n", "`project.structure_style`." ] }, { "cell_type": "code", "execution_count": 15, "id": "31", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.634870Z", "iopub.status.busy": "2026-06-04T16:26:09.634687Z", "iopub.status.idle": "2026-06-04T16:26:09.644601Z", "shell.execute_reply": "2026-06-04T16:26:09.643862Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mAtom View types\u001b[0m\n" ] }, { "data": { "text/html": [ "
ValueDescription
1vdwVan der Waals radius balls
2*covalentCovalent radius balls
3ionicIonic (Shannon) radius balls
4adpADP probability surfaces (spheres / ellipsoids)
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mColor Scheme types\u001b[0m\n" ] }, { "data": { "text/html": [ "
ValueDescription
1*jmolJmol / CPK colour scheme
2vestaVESTA colour scheme
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.structure_style.atom_view.show_supported()\n", "project.structure_style.color_scheme.show_supported()" ] }, { "cell_type": "code", "execution_count": 16, "id": "32", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.646368Z", "iopub.status.busy": "2026-06-04T16:26:09.646180Z", "iopub.status.idle": "2026-06-04T16:26:09.649149Z", "shell.execute_reply": "2026-06-04T16:26:09.648546Z" } }, "outputs": [], "source": [ "project.structure_style.atom_view = 'adp'\n", "project.structure_style.color_scheme = 'jmol'" ] }, { "cell_type": "markdown", "id": "33", "metadata": {}, "source": [ "Bonds are generated automatically between atoms whose separation lies\n", "within the per-structure cutoffs stored on `structure.geom`." ] }, { "cell_type": "code", "execution_count": 17, "id": "34", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.650793Z", "iopub.status.busy": "2026-06-04T16:26:09.650389Z", "iopub.status.idle": "2026-06-04T16:26:09.653770Z", "shell.execute_reply": "2026-06-04T16:26:09.653095Z" } }, "outputs": [], "source": [ "project.structures['lbco'].geom.min_bond_distance_cutoff = 0.5\n", "project.structures['lbco'].geom.bond_distance_incr = 0.25" ] }, { "cell_type": "markdown", "id": "35", "metadata": {}, "source": [ "List which features the structure data and the active engine can draw." ] }, { "cell_type": "code", "execution_count": 18, "id": "36", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.655302Z", "iopub.status.busy": "2026-06-04T16:26:09.655122Z", "iopub.status.idle": "2026-06-04T16:26:09.671172Z", "shell.execute_reply": "2026-06-04T16:26:09.670598Z" } }, "outputs": [ { "data": { "text/html": [ "
OptionDescriptionAvailableAuto
1atomsAtoms as spheres, occupancy wedges, or ADP ellipsoids.yesyes
2bondsBonds between atoms within the per-structure cutoffs.yesyes
3cellUnit-cell edges.yesyes
4axesThe a/b/c axis triad.yesyes
5momentsMagnetic-moment arrows (no moment data in version 1).nono
6labelsAtom labels at each site.yesno
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.show_structure_options(struct_name='lbco')" ] }, { "cell_type": "markdown", "id": "37", "metadata": {}, "source": [ "Draw the structure. With `include='auto'` (the default) every available\n", "feature is shown; a specific tuple such as `('atoms', 'bonds', 'cell')`\n", "can be requested instead." ] }, { "cell_type": "code", "execution_count": 19, "id": "38", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.673257Z", "iopub.status.busy": "2026-06-04T16:26:09.673054Z", "iopub.status.idle": "2026-06-04T16:26:09.962667Z", "shell.execute_reply": "2026-06-04T16:26:09.961943Z" } }, "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'lbco'\u001b[0m\u001b[1;36m \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mAtom view type: \u001b[0m\u001b[32m'adp'\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='lbco')" ] }, { "cell_type": "markdown", "id": "39", "metadata": {}, "source": [ "For a quick text schematic, switch to the `ascii` engine explicitly,\n", "then restore the automatic default." ] }, { "cell_type": "code", "execution_count": 20, "id": "40", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.965974Z", "iopub.status.busy": "2026-06-04T16:26:09.965729Z", "iopub.status.idle": "2026-06-04T16:26:09.976846Z", "shell.execute_reply": "2026-06-04T16:26:09.976308Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCurrent engine changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32m'ascii'\u001b[0m\n" ] } ], "source": [ "project.rendering_structure.type = 'ascii'" ] }, { "cell_type": "code", "execution_count": 21, "id": "41", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:09.979298Z", "iopub.status.busy": "2026-06-04T16:26:09.978923Z", "iopub.status.idle": "2026-06-04T16:26:10.023674Z", "shell.execute_reply": "2026-06-04T16:26:10.022976Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'lbco'\u001b[0m\u001b[1;36m \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mAtom view type: \u001b[0m\u001b[32m'adp'\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " b\n", " ↑\n", "\n", " \u001b[38;5;117m●\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;196m●\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;117m●\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;196m●\u001b[0m \u001b[38;5;196m●\u001b[0m \u001b[38;5;196m●\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;145mβ”‚\u001b[0m \u001b[38;5;145mβ”‚\u001b[0m\n", " \u001b[38;5;117m●\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;196m●\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;145m─\u001b[0m\u001b[38;5;117m●\u001b[0m β†’ a\n", "\n", "\n", "\n", "Legend: \u001b[38;5;217m● Co\u001b[0m \u001b[38;5;196m● O\u001b[0m \u001b[38;5;117m● La/Ba\u001b[0m\n" ] } ], "source": [ "project.display.structure(struct_name='lbco')" ] }, { "cell_type": "code", "execution_count": 22, "id": "42", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.025399Z", "iopub.status.busy": "2026-06-04T16:26:10.025164Z", "iopub.status.idle": "2026-06-04T16:26:10.030186Z", "shell.execute_reply": "2026-06-04T16:26:10.029688Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCurrent engine changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32m'threejs'\u001b[0m\n" ] } ], "source": [ "project.rendering_structure.type = 'auto'" ] }, { "cell_type": "markdown", "id": "43", "metadata": {}, "source": [ "### Save Project State\n", "\n", "Save the project state after adding the structure. This ensures\n", "that all changes are stored and can be accessed later. The project\n", "state is saved in the directory specified during project creation." ] }, { "cell_type": "code", "execution_count": 23, "id": "44", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.031927Z", "iopub.status.busy": "2026-06-04T16:26:10.031767Z", "iopub.status.idle": "2026-06-04T16:26:10.129223Z", "shell.execute_reply": "2026-06-04T16:26:10.128602Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\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": [ " └── πŸ“„ lbco_hrpt.html\n" ] } ], "source": [ "project.save()" ] }, { "cell_type": "markdown", "id": "45", "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." ] }, { "cell_type": "markdown", "id": "46", "metadata": {}, "source": [ "### Download Data\n", "\n", "Download the data file from the EasyDiffraction repository on GitHub." ] }, { "cell_type": "code", "execution_count": 24, "id": "47", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.133413Z", "iopub.status.busy": "2026-06-04T16:26:10.133197Z", "iopub.status.idle": "2026-06-04T16:26:10.145349Z", "shell.execute_reply": "2026-06-04T16:26:10.143991Z" } }, "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;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.\n" ] } ], "source": [ "data_path = ed.download_data(id=3, destination='data')" ] }, { "cell_type": "markdown", "id": "48", "metadata": {}, "source": [ "### Create Experiment" ] }, { "cell_type": "code", "execution_count": 25, "id": "49", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.147135Z", "iopub.status.busy": "2026-06-04T16:26:10.146932Z", "iopub.status.idle": "2026-06-04T16:26:10.855475Z", "shell.execute_reply": "2026-06-04T16:26:10.854553Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mData 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_from_data_path(\n", " name='hrpt',\n", " data_path=data_path,\n", " sample_form='powder',\n", " beam_mode='constant wavelength',\n", " radiation_probe='neutron',\n", ")" ] }, { "cell_type": "markdown", "id": "50", "metadata": {}, "source": [ "### Show Defined Experiments" ] }, { "cell_type": "code", "execution_count": 26, "id": "51", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.857190Z", "iopub.status.busy": "2026-06-04T16:26:10.856995Z", "iopub.status.idle": "2026-06-04T16:26:10.866791Z", "shell.execute_reply": "2026-06-04T16:26:10.864752Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mDefined experiments πŸ”¬\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1m[\u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1m]\u001b[0m\n" ] } ], "source": [ "project.experiments.show_names()" ] }, { "cell_type": "markdown", "id": "52", "metadata": {}, "source": [ "### Show Measured Data" ] }, { "cell_type": "code", "execution_count": 27, "id": "53", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:10.869365Z", "iopub.status.busy": "2026-06-04T16:26:10.869159Z", "iopub.status.idle": "2026-06-04T16:26:13.079553Z", "shell.execute_reply": "2026-06-04T16:26:13.078734Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Warning: No linked phases defined. Returning empty pattern.\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" }, { "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": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "markdown", "id": "54", "metadata": {}, "source": [ "### Set Instrument\n", "\n", "Modify the default instrument parameters." ] }, { "cell_type": "code", "execution_count": 28, "id": "55", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.081261Z", "iopub.status.busy": "2026-06-04T16:26:13.081054Z", "iopub.status.idle": "2026-06-04T16:26:13.086106Z", "shell.execute_reply": "2026-06-04T16:26:13.085359Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].instrument.setup_wavelength = 1.494\n", "project.experiments['hrpt'].instrument.calib_twotheta_offset = 0.6" ] }, { "cell_type": "markdown", "id": "56", "metadata": {}, "source": [ "### Set Peak Profile\n", "\n", "Show supported peak profile types." ] }, { "cell_type": "code", "execution_count": 29, "id": "57", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.088209Z", "iopub.status.busy": "2026-06-04T16:26:13.087997Z", "iopub.status.idle": "2026-06-04T16:26:13.101069Z", "shell.execute_reply": "2026-06-04T16:26:13.100362Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mPeak types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1*pseudo-voigtCWL pseudo-Voigt profile
2pseudo-voigt + empirical asymmetryCWL pseudo-Voigt profile with empirical asymmetry correction.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.experiments['hrpt'].peak.show_supported()" ] }, { "cell_type": "markdown", "id": "58", "metadata": {}, "source": [ "Select the desired peak profile type." ] }, { "cell_type": "code", "execution_count": 30, "id": "59", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.105022Z", "iopub.status.busy": "2026-06-04T16:26:13.104815Z", "iopub.status.idle": "2026-06-04T16:26:13.115995Z", "shell.execute_reply": "2026-06-04T16:26:13.115209Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mPeak profile type for experiment \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;36m changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "pseudo-voigt\n" ] } ], "source": [ "project.experiments['hrpt'].peak.type = 'pseudo-voigt'" ] }, { "cell_type": "markdown", "id": "60", "metadata": {}, "source": [ "Modify default peak profile parameters." ] }, { "cell_type": "code", "execution_count": 31, "id": "61", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.119069Z", "iopub.status.busy": "2026-06-04T16:26:13.118860Z", "iopub.status.idle": "2026-06-04T16:26:13.125914Z", "shell.execute_reply": "2026-06-04T16:26:13.125384Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].peak.broad_gauss_u = 0.1\n", "project.experiments['hrpt'].peak.broad_gauss_v = -0.1\n", "project.experiments['hrpt'].peak.broad_gauss_w = 0.1\n", "project.experiments['hrpt'].peak.broad_lorentz_x = 0\n", "project.experiments['hrpt'].peak.broad_lorentz_y = 0.1" ] }, { "cell_type": "markdown", "id": "62", "metadata": {}, "source": [ "### Set Background" ] }, { "cell_type": "markdown", "id": "63", "metadata": {}, "source": [ "Show supported background types." ] }, { "cell_type": "code", "execution_count": 32, "id": "64", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.128133Z", "iopub.status.busy": "2026-06-04T16:26:13.127814Z", "iopub.status.idle": "2026-06-04T16:26:13.141498Z", "shell.execute_reply": "2026-06-04T16:26:13.140706Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mBackground types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1chebyshevChebyshev polynomial background
2*line-segmentLinear interpolation between points
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.experiments['hrpt'].background.show_supported()" ] }, { "cell_type": "markdown", "id": "65", "metadata": {}, "source": [ "Select the desired background type." ] }, { "cell_type": "code", "execution_count": 33, "id": "66", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.145204Z", "iopub.status.busy": "2026-06-04T16:26:13.145013Z", "iopub.status.idle": "2026-06-04T16:26:13.151285Z", "shell.execute_reply": "2026-06-04T16:26:13.150609Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mBackground type for experiment \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;36m already set to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "line-segment\n" ] } ], "source": [ "project.experiments['hrpt'].background.type = 'line-segment'" ] }, { "cell_type": "markdown", "id": "67", "metadata": {}, "source": [ "Add background points." ] }, { "cell_type": "code", "execution_count": 34, "id": "68", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.153065Z", "iopub.status.busy": "2026-06-04T16:26:13.152877Z", "iopub.status.idle": "2026-06-04T16:26:13.158907Z", "shell.execute_reply": "2026-06-04T16:26:13.158044Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].background.create(id='10', x=10, y=170)\n", "project.experiments['hrpt'].background.create(id='30', x=30, y=170)\n", "project.experiments['hrpt'].background.create(id='50', x=50, y=170)\n", "project.experiments['hrpt'].background.create(id='110', x=110, y=170)\n", "project.experiments['hrpt'].background.create(id='165', x=165, y=170)" ] }, { "cell_type": "markdown", "id": "69", "metadata": {}, "source": [ "Show current background points." ] }, { "cell_type": "code", "execution_count": 35, "id": "70", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.160382Z", "iopub.status.busy": "2026-06-04T16:26:13.160212Z", "iopub.status.idle": "2026-06-04T16:26:13.166394Z", "shell.execute_reply": "2026-06-04T16:26:13.165714Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mLine-segment background points\u001b[0m\n" ] }, { "data": { "text/html": [ "
XIntensity
110170
230170
350170
4110170
5165170
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.experiments['hrpt'].background.show()" ] }, { "cell_type": "markdown", "id": "71", "metadata": {}, "source": [ "### Set Linked Phases\n", "\n", "Link the structure defined in the previous step to the experiment." ] }, { "cell_type": "code", "execution_count": 36, "id": "72", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.168105Z", "iopub.status.busy": "2026-06-04T16:26:13.167940Z", "iopub.status.idle": "2026-06-04T16:26:13.171058Z", "shell.execute_reply": "2026-06-04T16:26:13.170425Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].linked_phases.create(id='lbco', scale=10.0)" ] }, { "cell_type": "markdown", "id": "73", "metadata": {}, "source": [ "### Show Experiment as CIF" ] }, { "cell_type": "code", "execution_count": 37, "id": "74", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.172743Z", "iopub.status.busy": "2026-06-04T16:26:13.172556Z", "iopub.status.idle": "2026-06-04T16:26:13.603903Z", "shell.execute_reply": "2026-06-04T16:26:13.603280Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mExperiment πŸ”¬ \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;36m as cif\u001b[0m\n" ] }, { "data": { "text/html": [ "
CIF
1data_hrpt
2
3_expt_type.sample_form powder
4_expt_type.beam_mode "constant wavelength"
5_expt_type.radiation_probe neutron
6_expt_type.scattering_type bragg
7
8_diffrn.ambient_temperature ?
9_diffrn.ambient_pressure ?
10_diffrn.ambient_magnetic_field ?
11_diffrn.ambient_electric_field ?
12
13_calculator.type cryspy
14
15_peak.broad_gauss_u 0.1
16_peak.broad_gauss_v -0.1
17_peak.broad_gauss_w 0.1
18_peak.broad_lorentz_x 0.
19_peak.broad_lorentz_y 0.1
20_peak.type cwl-pseudo-voigt
21
22_instr.wavelength 1.494
23_instr.2theta_offset 0.6
24
25loop_
26_pd_phase_block.id
27_pd_phase_block.scale
28lbco 10.
29
30_background.type line-segment
31
32loop_
33_pd_background.id
34_pd_background.line_segment_X
35_pd_background.line_segment_intensity
3610 10 170
3730 30 170
3850 50 170
39110 110 170
40165 165 170
41
42loop_
43_pd_proc.2theta_scan
44_pd_data.point_id
45_pd_proc.d_spacing
46_pd_meas.intensity_total
47_pd_meas.intensity_total_su
48_pd_calc.intensity_total
49_pd_calc.intensity_bkg
50_pd_data.refinement_status
5110. 1 8.57086379 167. 12.6 172.32780248 170. incl
5210.05 2 8.52833125 157. 12.5 172.30859914 170. incl
5310.1 3 8.48622036 187. 13.3 172.28969336 170. incl
5410.15 4 8.4445249 197. 14. 172.27107915 170. incl
5510.2 5 8.40323875 164. 12.5 172.25275064 170. incl
5610.25 6 8.36235592 171. 13. 172.23470212 170. incl
5710.3 7 8.32187055 190. 13.4 172.21692803 170. incl
5810.35 8 8.28177687 182. 13.5 172.19942295 170. incl
5910.4 9 8.24206922 166. 12.6 172.18218159 170. incl
6010.45 10 8.20274208 203. 14.3 172.1651988 170. incl
61...
62164.4 3089 0.75397591 202. 18.5 172.60037118 170. incl
63164.45 3090 0.75393091 178. 20.4 172.59695823 170. incl
64164.5 3091 0.75388607 153. 18. 172.59381336 170. incl
65164.55 3092 0.75384138 197. 25.3 172.59093099 170. incl
66164.6 3093 0.75379684 153. 20.7 172.58830579 170. incl
67164.65 3094 0.75375244 173. 30.1 172.58593268 170. incl
68164.7 3095 0.75370819 187. 27.9 172.5838068 170. incl
69164.75 3096 0.7536641 175. 38.2 172.58192354 170. incl
70164.8 3097 0.75362015 168. 30.9 172.58027848 170. incl
71164.85 3098 0.75357634 109. 41.2 172.57886743 170. incl
72
73loop_
74_refln.id
75_refln.phase_id
76_refln.d_spacing
77_refln.sin_theta_over_lambda
78_refln.index_h
79_refln.index_k
80_refln.index_l
81_refln.f_calc
82_refln.f_squared_calc
83_refln.two_theta
841 lbco 3.88 0.12886598 1 0 0 0.16244556 0.02638856 22.80044453
852 lbco 2.74357431 0.18224402 1 1 0 0.32869596 0.10804103 32.19908449
863 lbco 2.24011904 0.22320242 1 1 1 2.1043237 4.42817823 39.5583744
874 lbco 1.94 0.25773196 2 0 0 2.56865501 6.59798858 45.89388073
885 lbco 1.73518875 0.28815309 2 1 0 0.15713889 0.02469263 51.5986821
896 lbco 1.58400337 0.31565589 2 1 1 0.31795832 0.10109749 56.8751008
907 lbco 1.37178716 0.36448803 2 2 0 2.48474376 6.17395156 66.58716829
918 lbco 1.29333333 0.38659794 2 2 1 0.15200557 0.02310569 71.16064798
929 lbco 1.29333333 0.38659794 3 0 0 0.15200557 0.02310569 71.16064798
9310 lbco 1.22696373 0.40751001 3 1 0 0.30757145 0.0946002 75.60845321
94...
9519 lbco 0.91452477 0.54673205 4 1 1 0.28780456 0.08283147 110.13497669
9620 lbco 0.89013305 0.56171378 3 3 1 1.84253549 3.39493703 114.71155759
9721 lbco 0.86759438 0.57630618 4 2 0 2.24910171 5.0584585 119.45842061
9822 lbco 0.84668541 0.59053811 4 2 1 0.13759004 0.01893102 124.43335485
9923 lbco 0.82721878 0.60443502 3 3 2 0.27840274 0.07750809 129.7174128
10024 lbco 0.79200168 0.63131179 4 2 2 2.17562943 4.73336341 141.78522183
10125 lbco 0.776 0.6443299 4 3 0 0.13309533 0.01771437 149.17338292
10226 lbco 0.776 0.6443299 5 0 0 0.13309533 0.01771437 149.17338292
10327 lbco 0.7609306 0.65709014 4 3 1 0.26930805 0.07252683 158.63936579
10428 lbco 0.7609306 0.65709014 5 1 0 0.26930805 0.07252683 158.63936579
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.experiments['hrpt'].show_as_cif()" ] }, { "cell_type": "markdown", "id": "75", "metadata": {}, "source": [ "### Save Project State" ] }, { "cell_type": "code", "execution_count": 38, "id": "76", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:13.608629Z", "iopub.status.busy": "2026-06-04T16:26:13.608182Z", "iopub.status.idle": "2026-06-04T16:26:14.714072Z", "shell.execute_reply": "2026-06-04T16:26:14.712592Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] } ], "source": [ "project.save()" ] }, { "cell_type": "markdown", "id": "77", "metadata": {}, "source": [ "## πŸš€ Perform Analysis\n", "\n", "This section explains the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", "### Set Calculator\n", "\n", "Show supported calculation engines for this experiment." ] }, { "cell_type": "code", "execution_count": 39, "id": "78", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:14.717450Z", "iopub.status.busy": "2026-06-04T16:26:14.717217Z", "iopub.status.idle": "2026-06-04T16:26:14.730594Z", "shell.execute_reply": "2026-06-04T16:26:14.729834Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCalculator types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1crysfmlCrysFML library for crystallographic calculations
2*cryspyCrysPy library for crystallographic calculations
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.experiments['hrpt'].calculator.show_supported()" ] }, { "cell_type": "markdown", "id": "79", "metadata": {}, "source": [ "Select the desired calculation engine." ] }, { "cell_type": "code", "execution_count": 40, "id": "80", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:14.733456Z", "iopub.status.busy": "2026-06-04T16:26:14.733243Z", "iopub.status.idle": "2026-06-04T16:26:14.743259Z", "shell.execute_reply": "2026-06-04T16:26:14.742348Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCalculator for experiment \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;36m already set to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "cryspy\n" ] } ], "source": [ "project.experiments['hrpt'].calculator.type = 'cryspy'" ] }, { "cell_type": "markdown", "id": "81", "metadata": {}, "source": [ "### Set Plotting Engine\n", "\n", "EasyDiffraction can plot the measured and calculated patterns using different rendering engines.\n", "The default `auto` engine resolves to an interactive `plotly` view inside Jupyter and a\n", "static `asciichartpy` plot for schematic representation in a terminal.\n", "\n", "Show supported data plotting engines." ] }, { "cell_type": "code", "execution_count": 41, "id": "82", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:14.750158Z", "iopub.status.busy": "2026-06-04T16:26:14.749906Z", "iopub.status.idle": "2026-06-04T16:26:14.764615Z", "shell.execute_reply": "2026-06-04T16:26:14.763666Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mRendering Plot types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1*autoEnvironment default rendering_plot engine
2asciichartpyConsole ASCII line charts
3plotlyInteractive browser-based graphing library
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.rendering_plot.show_supported()" ] }, { "cell_type": "markdown", "id": "83", "metadata": {}, "source": [ "Show all public attributes of the data rendering engine." ] }, { "cell_type": "code", "execution_count": 42, "id": "84", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:14.766995Z", "iopub.status.busy": "2026-06-04T16:26:14.766791Z", "iopub.status.idle": "2026-06-04T16:26:14.780153Z", "shell.execute_reply": "2026-06-04T16:26:14.777685Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mProperties\u001b[0m\n" ] }, { "data": { "text/html": [ "
NameWritableDescription
1as_cifReturn CIF representation of this object.
2parametersAll GenericDescriptorBase instances on this item.
3plotterLive plotting facade bound to the owning project.
4typeβœ“Active factory tag for this category.
5unique_nameFully qualified name: datablock, category, entry.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mMethods\u001b[0m\n" ] }, { "data": { "text/html": [ "
NameDescription
1from_cif()Populate this rendering_plot category from a CIF block.
2help()Print parameters, other properties, and methods.
3show_supported()Print supported types and mark the active one.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.rendering_plot.help()" ] }, { "cell_type": "markdown", "id": "85", "metadata": {}, "source": [ "### Display Pattern" ] }, { "cell_type": "code", "execution_count": 43, "id": "86", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:14.782678Z", "iopub.status.busy": "2026-06-04T16:26:14.782414Z", "iopub.status.idle": "2026-06-04T16:26:15.721160Z", "shell.execute_reply": "2026-06-04T16:26:15.720409Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 44, "id": "87", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:15.727740Z", "iopub.status.busy": "2026-06-04T16:26:15.727528Z", "iopub.status.idle": "2026-06-04T16:26:16.642019Z", "shell.execute_reply": "2026-06-04T16:26:16.641487Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "88", "metadata": {}, "source": [ "### Display Parameters\n", "\n", "Show all parameters of the project." ] }, { "cell_type": "code", "execution_count": 45, "id": "89", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.645377Z", "iopub.status.busy": "2026-06-04T16:26:16.645173Z", "iopub.status.idle": "2026-06-04T16:26:16.788871Z", "shell.execute_reply": "2026-06-04T16:26:16.788102Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mAll parameters for all structures \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36m🧩 data blocks\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparametervaluefittable
1lbcocelllength_a3.88000True
2lbcocelllength_b3.88000False
3lbcocelllength_c3.88000False
4lbcocellangle_alpha90.00000False
5lbcocellangle_beta90.00000False
6lbcocellangle_gamma90.00000False
7lbcospace_groupname_h_mP m -3 mFalse
8lbcospace_groupit_coordinate_system_code1False
9lbcoatom_siteLalabelLaFalse
10lbcoatom_siteLatype_symbolLaFalse
11lbcoatom_siteLafract_x0.00000False
12lbcoatom_siteLafract_y0.00000False
13lbcoatom_siteLafract_z0.00000False
14lbcoatom_siteLawyckoff_letteraFalse
15lbcoatom_siteLamultiplicity1False
16lbcoatom_siteLaoccupancy0.50000True
17lbcoatom_siteLaadp_iso0.50000True
18lbcoatom_siteLaadp_typeBisoFalse
19lbcoatom_siteBalabelBaFalse
20lbcoatom_siteBatype_symbolBaFalse
21lbcoatom_siteBafract_x0.00000False
22lbcoatom_siteBafract_y0.00000False
23lbcoatom_siteBafract_z0.00000False
24lbcoatom_siteBawyckoff_letteraFalse
25lbcoatom_siteBamultiplicity1False
26lbcoatom_siteBaoccupancy0.50000True
27lbcoatom_siteBaadp_iso0.50000True
28lbcoatom_siteBaadp_typeBisoFalse
29lbcoatom_siteColabelCoFalse
30lbcoatom_siteCotype_symbolCoFalse
31lbcoatom_siteCofract_x0.50000False
32lbcoatom_siteCofract_y0.50000False
33lbcoatom_siteCofract_z0.50000False
34lbcoatom_siteCowyckoff_letterbFalse
35lbcoatom_siteComultiplicity1False
36lbcoatom_siteCooccupancy1.00000True
37lbcoatom_siteCoadp_iso0.50000True
38lbcoatom_siteCoadp_typeBisoFalse
39lbcoatom_siteOlabelOFalse
40lbcoatom_siteOtype_symbolOFalse
41lbcoatom_siteOfract_x0.00000False
42lbcoatom_siteOfract_y0.50000False
43lbcoatom_siteOfract_z0.50000False
44lbcoatom_siteOwyckoff_lettercFalse
45lbcoatom_siteOmultiplicity3False
46lbcoatom_siteOoccupancy1.00000True
47lbcoatom_siteOadp_iso0.50000True
48lbcoatom_siteOadp_typeBisoFalse
49lbcogeommin_bond_distance_cutoff0.50000False
50lbcogeombond_distance_incr0.25000False
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mAll parameters for all experiments \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mπŸ”¬ data blocks\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparametervaluefittable
1hrptexpt_typesample_formpowderFalse
2hrptexpt_typebeam_modeconstant wavelengthFalse
3hrptexpt_typeradiation_probeneutronFalse
4hrptexpt_typescattering_typebraggFalse
5hrptdiffrnambient_temperatureFalse
6hrptdiffrnambient_pressureFalse
7hrptdiffrnambient_magnetic_fieldFalse
8hrptdiffrnambient_electric_fieldFalse
9hrptcalculatortypecryspyFalse
10hrptlinked_phaseslbcoidlbcoFalse
11hrptlinked_phaseslbcoscale10.00000True
12hrptpeakbroad_gauss_u0.10000True
13hrptpeakbroad_gauss_v-0.10000True
14hrptpeakbroad_gauss_w0.10000True
15hrptpeakbroad_lorentz_x0.00000True
16hrptpeakbroad_lorentz_y0.10000True
17hrptpeaktypecwl-pseudo-voigtFalse
18hrptinstrumentwavelength1.49400True
19hrptinstrumenttwotheta_offset0.60000True
20hrptbackground10id10False
21hrptbackground10x10False
22hrptbackground10y170True
23hrptbackground30id30False
24hrptbackground30x30False
25hrptbackground30y170True
26hrptbackground50id50False
27hrptbackground50x50False
28hrptbackground50y170True
29hrptbackground110id110False
30hrptbackground110x110False
31hrptbackground110y170True
32hrptbackground165id165False
33hrptbackground165x165False
34hrptbackground165y170True
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.all()" ] }, { "cell_type": "markdown", "id": "90", "metadata": {}, "source": [ "Show all fittable parameters." ] }, { "cell_type": "code", "execution_count": 46, "id": "91", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.790725Z", "iopub.status.busy": "2026-06-04T16:26:16.790532Z", "iopub.status.idle": "2026-06-04T16:26:16.848771Z", "shell.execute_reply": "2026-06-04T16:26:16.845457Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mFittable parameters for all structures \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36m🧩 data blocks\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparametervalueuncertaintyunitsfree
1lbcocelllength_a3.88000Γ…False
2lbcoatom_siteLaoccupancy0.50000False
3lbcoatom_siteLaadp_iso0.50000Γ…Β²False
4lbcoatom_siteBaoccupancy0.50000False
5lbcoatom_siteBaadp_iso0.50000Γ…Β²False
6lbcoatom_siteCooccupancy1.00000False
7lbcoatom_siteCoadp_iso0.50000Γ…Β²False
8lbcoatom_siteOoccupancy1.00000False
9lbcoatom_siteOadp_iso0.50000Γ…Β²False
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mFittable parameters for all experiments \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mπŸ”¬ data blocks\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparametervalueuncertaintyunitsfree
1hrptlinked_phaseslbcoscale10.00000False
2hrptpeakbroad_gauss_u0.10000degΒ²False
3hrptpeakbroad_gauss_v-0.10000degΒ²False
4hrptpeakbroad_gauss_w0.10000degΒ²False
5hrptpeakbroad_lorentz_x0.00000degFalse
6hrptpeakbroad_lorentz_y0.10000degFalse
7hrptinstrumentwavelength1.49400Γ…False
8hrptinstrumenttwotheta_offset0.60000degFalse
9hrptbackground10y170.00000False
10hrptbackground30y170.00000False
11hrptbackground50y170.00000False
12hrptbackground110y170.00000False
13hrptbackground165y170.00000False
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.fittable()" ] }, { "cell_type": "markdown", "id": "92", "metadata": {}, "source": [ "Show only free parameters." ] }, { "cell_type": "code", "execution_count": 47, "id": "93", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.853101Z", "iopub.status.busy": "2026-06-04T16:26:16.852884Z", "iopub.status.idle": "2026-06-04T16:26:16.893863Z", "shell.execute_reply": "2026-06-04T16:26:16.892741Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "⚠️ No free parameters found. \n" ] } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "94", "metadata": {}, "source": [ "Show how to access parameters in the code." ] }, { "cell_type": "code", "execution_count": 48, "id": "95", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.896318Z", "iopub.status.busy": "2026-06-04T16:26:16.895552Z", "iopub.status.idle": "2026-06-04T16:26:16.959022Z", "shell.execute_reply": "2026-06-04T16:26:16.958004Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mHow to access parameters\u001b[0m\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterHow to Access in Python Code
1lbcocelllength_aproject.structures['lbco'].cell.length_a
2lbcocelllength_bproject.structures['lbco'].cell.length_b
3lbcocelllength_cproject.structures['lbco'].cell.length_c
4lbcocellangle_alphaproject.structures['lbco'].cell.angle_alpha
5lbcocellangle_betaproject.structures['lbco'].cell.angle_beta
6lbcocellangle_gammaproject.structures['lbco'].cell.angle_gamma
7lbcospace_groupname_h_mproject.structures['lbco'].space_group.name_h_m
8lbcospace_groupit_coordinate_system_codeproject.structures['lbco'].space_group.it_coordinate_system_code
9lbcoatom_siteLalabelproject.structures['lbco'].atom_site['La'].label
10lbcoatom_siteLatype_symbolproject.structures['lbco'].atom_site['La'].type_symbol
11lbcoatom_siteLafract_xproject.structures['lbco'].atom_site['La'].fract_x
12lbcoatom_siteLafract_yproject.structures['lbco'].atom_site['La'].fract_y
13lbcoatom_siteLafract_zproject.structures['lbco'].atom_site['La'].fract_z
14lbcoatom_siteLawyckoff_letterproject.structures['lbco'].atom_site['La'].wyckoff_letter
15lbcoatom_siteLamultiplicityproject.structures['lbco'].atom_site['La'].multiplicity
16lbcoatom_siteLaoccupancyproject.structures['lbco'].atom_site['La'].occupancy
17lbcoatom_siteLaadp_isoproject.structures['lbco'].atom_site['La'].adp_iso
18lbcoatom_siteLaadp_typeproject.structures['lbco'].atom_site['La'].adp_type
19lbcoatom_siteBalabelproject.structures['lbco'].atom_site['Ba'].label
20lbcoatom_siteBatype_symbolproject.structures['lbco'].atom_site['Ba'].type_symbol
21lbcoatom_siteBafract_xproject.structures['lbco'].atom_site['Ba'].fract_x
22lbcoatom_siteBafract_yproject.structures['lbco'].atom_site['Ba'].fract_y
23lbcoatom_siteBafract_zproject.structures['lbco'].atom_site['Ba'].fract_z
24lbcoatom_siteBawyckoff_letterproject.structures['lbco'].atom_site['Ba'].wyckoff_letter
25lbcoatom_siteBamultiplicityproject.structures['lbco'].atom_site['Ba'].multiplicity
26lbcoatom_siteBaoccupancyproject.structures['lbco'].atom_site['Ba'].occupancy
27lbcoatom_siteBaadp_isoproject.structures['lbco'].atom_site['Ba'].adp_iso
28lbcoatom_siteBaadp_typeproject.structures['lbco'].atom_site['Ba'].adp_type
29lbcoatom_siteColabelproject.structures['lbco'].atom_site['Co'].label
30lbcoatom_siteCotype_symbolproject.structures['lbco'].atom_site['Co'].type_symbol
31lbcoatom_siteCofract_xproject.structures['lbco'].atom_site['Co'].fract_x
32lbcoatom_siteCofract_yproject.structures['lbco'].atom_site['Co'].fract_y
33lbcoatom_siteCofract_zproject.structures['lbco'].atom_site['Co'].fract_z
34lbcoatom_siteCowyckoff_letterproject.structures['lbco'].atom_site['Co'].wyckoff_letter
35lbcoatom_siteComultiplicityproject.structures['lbco'].atom_site['Co'].multiplicity
36lbcoatom_siteCooccupancyproject.structures['lbco'].atom_site['Co'].occupancy
37lbcoatom_siteCoadp_isoproject.structures['lbco'].atom_site['Co'].adp_iso
38lbcoatom_siteCoadp_typeproject.structures['lbco'].atom_site['Co'].adp_type
39lbcoatom_siteOlabelproject.structures['lbco'].atom_site['O'].label
40lbcoatom_siteOtype_symbolproject.structures['lbco'].atom_site['O'].type_symbol
41lbcoatom_siteOfract_xproject.structures['lbco'].atom_site['O'].fract_x
42lbcoatom_siteOfract_yproject.structures['lbco'].atom_site['O'].fract_y
43lbcoatom_siteOfract_zproject.structures['lbco'].atom_site['O'].fract_z
44lbcoatom_siteOwyckoff_letterproject.structures['lbco'].atom_site['O'].wyckoff_letter
45lbcoatom_siteOmultiplicityproject.structures['lbco'].atom_site['O'].multiplicity
46lbcoatom_siteOoccupancyproject.structures['lbco'].atom_site['O'].occupancy
47lbcoatom_siteOadp_isoproject.structures['lbco'].atom_site['O'].adp_iso
48lbcoatom_siteOadp_typeproject.structures['lbco'].atom_site['O'].adp_type
49lbcogeommin_bond_distance_cutoffproject.structures['lbco'].geom.min_bond_distance_cutoff
50lbcogeombond_distance_incrproject.structures['lbco'].geom.bond_distance_incr
51hrptexpt_typesample_formproject.experiments['hrpt'].expt_type.sample_form
52hrptexpt_typebeam_modeproject.experiments['hrpt'].expt_type.beam_mode
53hrptexpt_typeradiation_probeproject.experiments['hrpt'].expt_type.radiation_probe
54hrptexpt_typescattering_typeproject.experiments['hrpt'].expt_type.scattering_type
55hrptdiffrnambient_temperatureproject.experiments['hrpt'].diffrn.ambient_temperature
56hrptdiffrnambient_pressureproject.experiments['hrpt'].diffrn.ambient_pressure
57hrptdiffrnambient_magnetic_fieldproject.experiments['hrpt'].diffrn.ambient_magnetic_field
58hrptdiffrnambient_electric_fieldproject.experiments['hrpt'].diffrn.ambient_electric_field
59hrptcalculatortypeproject.experiments['hrpt'].calculator.type
60hrptlinked_phaseslbcoidproject.experiments['hrpt'].linked_phases['lbco'].id
61hrptlinked_phaseslbcoscaleproject.experiments['hrpt'].linked_phases['lbco'].scale
62hrptpeakbroad_gauss_uproject.experiments['hrpt'].peak.broad_gauss_u
63hrptpeakbroad_gauss_vproject.experiments['hrpt'].peak.broad_gauss_v
64hrptpeakbroad_gauss_wproject.experiments['hrpt'].peak.broad_gauss_w
65hrptpeakbroad_lorentz_xproject.experiments['hrpt'].peak.broad_lorentz_x
66hrptpeakbroad_lorentz_yproject.experiments['hrpt'].peak.broad_lorentz_y
67hrptpeaktypeproject.experiments['hrpt'].peak.type
68hrptinstrumentwavelengthproject.experiments['hrpt'].instrument.wavelength
69hrptinstrumenttwotheta_offsetproject.experiments['hrpt'].instrument.twotheta_offset
70hrptbackground10idproject.experiments['hrpt'].background['10'].id
71hrptbackground10xproject.experiments['hrpt'].background['10'].x
72hrptbackground10yproject.experiments['hrpt'].background['10'].y
73hrptbackground30idproject.experiments['hrpt'].background['30'].id
74hrptbackground30xproject.experiments['hrpt'].background['30'].x
75hrptbackground30yproject.experiments['hrpt'].background['30'].y
76hrptbackground50idproject.experiments['hrpt'].background['50'].id
77hrptbackground50xproject.experiments['hrpt'].background['50'].x
78hrptbackground50yproject.experiments['hrpt'].background['50'].y
79hrptbackground110idproject.experiments['hrpt'].background['110'].id
80hrptbackground110xproject.experiments['hrpt'].background['110'].x
81hrptbackground110yproject.experiments['hrpt'].background['110'].y
82hrptbackground165idproject.experiments['hrpt'].background['165'].id
83hrptbackground165xproject.experiments['hrpt'].background['165'].x
84hrptbackground165yproject.experiments['hrpt'].background['165'].y
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.access()" ] }, { "cell_type": "markdown", "id": "96", "metadata": {}, "source": [ "### Set Fit Mode\n", "\n", "Show supported fit modes." ] }, { "cell_type": "code", "execution_count": 49, "id": "97", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.960734Z", "iopub.status.busy": "2026-06-04T16:26:16.960530Z", "iopub.status.idle": "2026-06-04T16:26:16.971030Z", "shell.execute_reply": "2026-06-04T16:26:16.967943Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mFitting Mode types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1*singleFit one experiment at a time.
2jointFit several experiments together with shared parameters.
3sequentialFit one experiment against a series of data files.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.fitting_mode.show_supported()" ] }, { "cell_type": "markdown", "id": "98", "metadata": {}, "source": [ "Select desired fit mode." ] }, { "cell_type": "code", "execution_count": 50, "id": "99", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.973382Z", "iopub.status.busy": "2026-06-04T16:26:16.972604Z", "iopub.status.idle": "2026-06-04T16:26:16.981094Z", "shell.execute_reply": "2026-06-04T16:26:16.980311Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mFitting mode changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "single\n" ] } ], "source": [ "project.analysis.fitting_mode.type = 'single'" ] }, { "cell_type": "markdown", "id": "100", "metadata": {}, "source": [ "### Set Minimizer\n", "\n", "Show supported fitting engines." ] }, { "cell_type": "code", "execution_count": 51, "id": "101", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.982642Z", "iopub.status.busy": "2026-06-04T16:26:16.982441Z", "iopub.status.idle": "2026-06-04T16:26:16.989054Z", "shell.execute_reply": "2026-06-04T16:26:16.988243Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mMinimizer types\u001b[0m\n" ] }, { "data": { "text/html": [ "
TypeDescription
1bumpsBUMPS library using the default Levenberg-Marquardt method
2bumps (amoeba)BUMPS library with Nelder-Mead simplex method
3bumps (de)BUMPS library with differential evolution method
4bumps (dream)BUMPS library with DREAM Bayesian sampling
5bumps (lm)BUMPS library with Levenberg-Marquardt method
6dfolsDFO-LS library for derivative-free least-squares optimization
7emceeemcee affine-invariant ensemble Bayesian sampling
8lmfitLMFIT library using the default Levenberg-Marquardt method
9lmfit (least_squares)LMFIT library with SciPy's trust region reflective algorithm
10*lmfit (leastsq)LMFIT library with Levenberg-Marquardt least squares method
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.minimizer.show_supported()" ] }, { "cell_type": "markdown", "id": "102", "metadata": {}, "source": [ "Select desired fitting engine." ] }, { "cell_type": "code", "execution_count": 52, "id": "103", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.990503Z", "iopub.status.busy": "2026-06-04T16:26:16.990354Z", "iopub.status.idle": "2026-06-04T16:26:16.995298Z", "shell.execute_reply": "2026-06-04T16:26:16.994679Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCurrent minimizer changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "lmfit\n" ] } ], "source": [ "project.analysis.minimizer.type = 'lmfit'" ] }, { "cell_type": "markdown", "id": "104", "metadata": {}, "source": [ "### Perform Fit 1/5\n", "\n", "Set structure parameters to be refined." ] }, { "cell_type": "code", "execution_count": 53, "id": "105", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:16.996947Z", "iopub.status.busy": "2026-06-04T16:26:16.996797Z", "iopub.status.idle": "2026-06-04T16:26:17.000017Z", "shell.execute_reply": "2026-06-04T16:26:16.998923Z" } }, "outputs": [], "source": [ "project.structures['lbco'].cell.length_a.free = True" ] }, { "cell_type": "markdown", "id": "106", "metadata": {}, "source": [ "Set experiment parameters to be refined." ] }, { "cell_type": "code", "execution_count": 54, "id": "107", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:17.001597Z", "iopub.status.busy": "2026-06-04T16:26:17.001418Z", "iopub.status.idle": "2026-06-04T16:26:17.005126Z", "shell.execute_reply": "2026-06-04T16:26:17.004194Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].linked_phases['lbco'].scale.free = True\n", "project.experiments['hrpt'].instrument.calib_twotheta_offset.free = True\n", "project.experiments['hrpt'].background['10'].y.free = True\n", "project.experiments['hrpt'].background['30'].y.free = True\n", "project.experiments['hrpt'].background['50'].y.free = True\n", "project.experiments['hrpt'].background['110'].y.free = True\n", "project.experiments['hrpt'].background['165'].y.free = True" ] }, { "cell_type": "markdown", "id": "108", "metadata": {}, "source": [ "Show free parameters after selection." ] }, { "cell_type": "code", "execution_count": 55, "id": "109", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:17.006731Z", "iopub.status.busy": "2026-06-04T16:26:17.006488Z", "iopub.status.idle": "2026-06-04T16:26:17.043932Z", "shell.execute_reply": "2026-06-04T16:26:17.042784Z" } }, "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": [ "
datablockcategoryentryparametervalueuncertaintyminmaxunits
1lbcocelllength_a3.88000-infinfΓ…
2hrptlinked_phaseslbcoscale10.00000-infinf
3hrptinstrumenttwotheta_offset0.60000-infinfdeg
4hrptbackground10y170.00000-infinf
5hrptbackground30y170.00000-infinf
6hrptbackground50y170.00000-infinf
7hrptbackground110y170.00000-infinf
8hrptbackground165y170.00000-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "110", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 56, "id": "111", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:17.045459Z", "iopub.status.busy": "2026-06-04T16:26:17.045289Z", "iopub.status.idle": "2026-06-04T16:26:22.191780Z", "shell.execute_reply": "2026-06-04T16:26:22.191280Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-66be24c5cb2f49e18ea7e8187f51ef6f-button');\n", " const status = document.getElementById('ed-fit-stop-66be24c5cb2f49e18ea7e8187f51ef6f-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'hrpt'\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": [ "
iterationtime (s)χ²change / status
110.11164.59
2120.6233.4379.7% ↓
3211.0313.2260.4% ↓
4301.445.7856.3% ↓
5391.833.1545.6% ↓
6773.843.14
" ], "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;36m3.14\u001b[0m at iteration \u001b[1;36m69\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'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βš™οΈ Settings used:\n" ] }, { "data": { "text/html": [ "
NameValueDescription
1max_iterations1000Maximum solver iterations.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“‹ Least-squares fit results:\n" ] }, { "data": { "text/html": [ "
MetricValue
1πŸ§ͺ Minimizerlmfit
2βœ… Overall statussuccess
3⏱️ Fitting time (seconds)3.84
4πŸ” Iterations74
5πŸ“ Goodness-of-fit (reduced χ²)3.14
6πŸ“ R-factor (Rf, %)8.42
7πŸ“ R-factor squared (RfΒ², %)11.79
8πŸ“ Weighted R-factor (wR, %)11.62
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lbcocelllength_aΓ…3.88003.89100.00010.28 % ↑
2hrptlinked_phaseslbcoscale10.00007.34090.035026.59 % ↓
3hrptinstrumenttwotheta_offsetdeg0.60000.62430.00184.05 % ↑
4hrptbackground10y170.0000167.70662.13001.35 % ↓
5hrptbackground30y170.0000166.03381.54042.33 % ↓
6hrptbackground50y170.0000169.94951.10250.03 % ↓
7hrptbackground110y170.0000170.08020.97880.05 % ↑
8hrptbackground165y170.0000179.66561.32895.69 % ↑
" ], "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.analysis.fit()\n", "project.display.fit.results()" ] }, { "cell_type": "markdown", "id": "112", "metadata": {}, "source": [ "#### Display Pattern" ] }, { "cell_type": "code", "execution_count": 57, "id": "113", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:22.195145Z", "iopub.status.busy": "2026-06-04T16:26:22.194962Z", "iopub.status.idle": "2026-06-04T16:26:23.112425Z", "shell.execute_reply": "2026-06-04T16:26:23.111888Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 58, "id": "114", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:23.126321Z", "iopub.status.busy": "2026-06-04T16:26:23.126128Z", "iopub.status.idle": "2026-06-04T16:26:24.056190Z", "shell.execute_reply": "2026-06-04T16:26:24.055429Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "115", "metadata": {}, "source": [ "### Perform Fit 2/5\n", "\n", "Set more parameters to be refined." ] }, { "cell_type": "code", "execution_count": 59, "id": "116", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:24.059824Z", "iopub.status.busy": "2026-06-04T16:26:24.059651Z", "iopub.status.idle": "2026-06-04T16:26:24.064922Z", "shell.execute_reply": "2026-06-04T16:26:24.062391Z" } }, "outputs": [], "source": [ "project.experiments['hrpt'].peak.broad_gauss_u.free = True\n", "project.experiments['hrpt'].peak.broad_gauss_v.free = True\n", "project.experiments['hrpt'].peak.broad_gauss_w.free = True\n", "project.experiments['hrpt'].peak.broad_lorentz_y.free = True" ] }, { "cell_type": "markdown", "id": "117", "metadata": {}, "source": [ "Show free parameters after selection." ] }, { "cell_type": "code", "execution_count": 60, "id": "118", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:24.066483Z", "iopub.status.busy": "2026-06-04T16:26:24.066321Z", "iopub.status.idle": "2026-06-04T16:26:24.128212Z", "shell.execute_reply": "2026-06-04T16:26:24.127501Z" } }, "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": [ "
datablockcategoryentryparametervalueuncertaintyminmaxunits
1lbcocelllength_a3.890990.00006-infinfΓ…
2hrptlinked_phaseslbcoscale7.340880.03496-infinf
3hrptpeakbroad_gauss_u0.10000-infinfdegΒ²
4hrptpeakbroad_gauss_v-0.10000-infinfdegΒ²
5hrptpeakbroad_gauss_w0.10000-infinfdegΒ²
6hrptpeakbroad_lorentz_y0.10000-infinfdeg
7hrptinstrumenttwotheta_offset0.624320.00181-infinfdeg
8hrptbackground10y167.706622.13004-infinf
9hrptbackground30y166.033831.54041-infinf
10hrptbackground50y169.949491.10249-infinf
11hrptbackground110y170.080230.97879-infinf
12hrptbackground165y179.665571.32895-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "119", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 61, "id": "120", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:24.129613Z", "iopub.status.busy": "2026-06-04T16:26:24.129428Z", "iopub.status.idle": "2026-06-04T16:26:29.079288Z", "shell.execute_reply": "2026-06-04T16:26:29.078753Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-a97044bbd56748c7951f4f272ecbf89f-button');\n", " const status = document.getElementById('ed-fit-stop-a97044bbd56748c7951f4f272ecbf89f-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'hrpt'\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": [ "
iterationtime (s)χ²change / status
110.063.14
2160.792.859.1% ↓
3693.552.85
" ], "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;36m2.85\u001b[0m at iteration \u001b[1;36m68\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'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βš™οΈ Settings used:\n" ] }, { "data": { "text/html": [ "
NameValueDescription
1max_iterations1000Maximum solver iterations.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“‹ Least-squares fit results:\n" ] }, { "data": { "text/html": [ "
MetricValue
1πŸ§ͺ Minimizerlmfit
2βœ… Overall statussuccess
3⏱️ Fitting time (seconds)3.55
4πŸ” Iterations66
5πŸ“ Goodness-of-fit (reduced χ²)2.85
6πŸ“ R-factor (Rf, %)8.30
7πŸ“ R-factor squared (RfΒ², %)11.85
8πŸ“ Weighted R-factor (wR, %)11.91
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lbcocelllength_aΓ…3.89103.89090.00010.00 % ↓
2hrptlinked_phaseslbcoscale7.34097.21200.04061.76 % ↓
3hrptpeakbroad_gauss_udegΒ²0.10000.08030.004719.74 % ↓
4hrptpeakbroad_gauss_vdegΒ²-0.1000-0.10290.01042.93 % ↑
5hrptpeakbroad_gauss_wdegΒ²0.10000.10770.00517.66 % ↑
6hrptpeakbroad_lorentz_ydeg0.10000.08930.003210.67 % ↓
7hrptinstrumenttwotheta_offsetdeg0.62430.62310.00170.19 % ↓
8hrptbackground10y167.7066167.51672.03110.11 % ↓
9hrptbackground30y166.0338166.76271.47940.44 % ↑
10hrptbackground50y169.9495170.83301.08080.52 % ↑
11hrptbackground110y170.0802172.25460.96601.28 % ↑
12hrptbackground165y179.6656180.64051.27370.54 % ↑
" ], "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.analysis.fit()\n", "project.display.fit.results()" ] }, { "cell_type": "markdown", "id": "121", "metadata": {}, "source": [ "#### Display Pattern" ] }, { "cell_type": "code", "execution_count": 62, "id": "122", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:29.081267Z", "iopub.status.busy": "2026-06-04T16:26:29.081096Z", "iopub.status.idle": "2026-06-04T16:26:29.987551Z", "shell.execute_reply": "2026-06-04T16:26:29.986883Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 63, "id": "123", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:29.991976Z", "iopub.status.busy": "2026-06-04T16:26:29.991801Z", "iopub.status.idle": "2026-06-04T16:26:30.866986Z", "shell.execute_reply": "2026-06-04T16:26:30.864308Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "124", "metadata": {}, "source": [ "#### Save Project State" ] }, { "cell_type": "code", "execution_count": 64, "id": "125", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:30.870414Z", "iopub.status.busy": "2026-06-04T16:26:30.870232Z", "iopub.status.idle": "2026-06-04T16:26:31.838984Z", "shell.execute_reply": "2026-06-04T16:26:31.838469Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] } ], "source": [ "project.save()" ] }, { "cell_type": "markdown", "id": "126", "metadata": {}, "source": [ "### Perform Fit 3/5\n", "\n", "Set more parameters to be refined." ] }, { "cell_type": "code", "execution_count": 65, "id": "127", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:31.840950Z", "iopub.status.busy": "2026-06-04T16:26:31.840785Z", "iopub.status.idle": "2026-06-04T16:26:31.843929Z", "shell.execute_reply": "2026-06-04T16:26:31.843259Z" } }, "outputs": [], "source": [ "project.structures['lbco'].atom_sites['La'].adp_iso.free = True\n", "project.structures['lbco'].atom_sites['Ba'].adp_iso.free = True\n", "project.structures['lbco'].atom_sites['Co'].adp_iso.free = True\n", "project.structures['lbco'].atom_sites['O'].adp_iso.free = True" ] }, { "cell_type": "markdown", "id": "128", "metadata": {}, "source": [ "Show free parameters after selection." ] }, { "cell_type": "code", "execution_count": 66, "id": "129", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:31.845656Z", "iopub.status.busy": "2026-06-04T16:26:31.845485Z", "iopub.status.idle": "2026-06-04T16:26:31.873634Z", "shell.execute_reply": "2026-06-04T16:26:31.872966Z" } }, "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": [ "
datablockcategoryentryparametervalueuncertaintyminmaxunits
1lbcocelllength_a3.890910.00005-infinfΓ…
2lbcoatom_siteLaadp_iso0.50000-infinfΓ…Β²
3lbcoatom_siteBaadp_iso0.50000-infinfΓ…Β²
4lbcoatom_siteCoadp_iso0.50000-infinfΓ…Β²
5lbcoatom_siteOadp_iso0.50000-infinfΓ…Β²
6hrptlinked_phaseslbcoscale7.211990.04057-infinf
7hrptpeakbroad_gauss_u0.080260.00472-infinfdegΒ²
8hrptpeakbroad_gauss_v-0.102930.01036-infinfdegΒ²
9hrptpeakbroad_gauss_w0.107660.00515-infinfdegΒ²
10hrptpeakbroad_lorentz_y0.089330.00320-infinfdeg
11hrptinstrumenttwotheta_offset0.623140.00167-infinfdeg
12hrptbackground10y167.516692.03112-infinf
13hrptbackground30y166.762681.47937-infinf
14hrptbackground50y170.833051.08080-infinf
15hrptbackground110y172.254580.96599-infinf
16hrptbackground165y180.640541.27368-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "130", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 67, "id": "131", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:31.875640Z", "iopub.status.busy": "2026-06-04T16:26:31.875464Z", "iopub.status.idle": "2026-06-04T16:26:43.442583Z", "shell.execute_reply": "2026-06-04T16:26:43.441364Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-6abd658ea63042c3ac79ca942d41da7b-button');\n", " const status = document.getElementById('ed-fit-stop-6abd658ea63042c3ac79ca942d41da7b-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'hrpt'\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": [ "
iterationtime (s)χ²change / status
110.052.85
2281.712.2819.9% ↓
3452.531.6228.9% ↓
4623.351.479.6% ↓
5794.171.367.0% ↓
6975.031.295.4% ↓
720010.051.29
820410.321.29
" ], "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;36m187\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'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βš™οΈ Settings used:\n" ] }, { "data": { "text/html": [ "
NameValueDescription
1max_iterations1000Maximum solver iterations.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“‹ Least-squares fit results:\n" ] }, { "data": { "text/html": [ "
MetricValue
1πŸ§ͺ Minimizerlmfit
2βœ… Overall statussuccess
3⏱️ Fitting time (seconds)10.32
4πŸ” Iterations201
5πŸ“ Goodness-of-fit (reduced χ²)1.29
6πŸ“ R-factor (Rf, %)5.63
7πŸ“ R-factor squared (RfΒ², %)5.27
8πŸ“ Weighted R-factor (wR, %)4.41
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lbcocelllength_aΓ…3.89093.89090.00000.00 % ↓
2lbcoatom_siteLaadp_isoΓ…Β²0.50000.50511216.74091.02 % ↑
3lbcoatom_siteBaadp_isoΓ…Β²0.50000.50481977.30280.96 % ↑
4lbcoatom_siteCoadp_isoΓ…Β²0.50000.23710.061252.59 % ↓
5lbcoatom_siteOadp_isoΓ…Β²0.50001.39350.0167178.71 % ↑
6hrptlinked_phaseslbcoscale7.21209.13500.064126.66 % ↑
7hrptpeakbroad_gauss_udegΒ²0.08030.08160.00311.63 % ↑
8hrptpeakbroad_gauss_vdegΒ²-0.1029-0.11590.006712.62 % ↑
9hrptpeakbroad_gauss_wdegΒ²0.10770.12040.003311.88 % ↑
10hrptpeakbroad_lorentz_ydeg0.08930.08440.00215.47 % ↓
11hrptinstrumenttwotheta_offsetdeg0.62310.62260.00100.09 % ↓
12hrptbackground10y167.5167168.55851.36710.62 % ↑
13hrptbackground30y166.7627164.33570.99921.46 % ↓
14hrptbackground50y170.8330166.88810.73882.31 % ↓
15hrptbackground110y172.2546175.40040.65711.83 % ↑
16hrptbackground165y180.6405174.28110.91133.52 % ↓
" ], "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" }, { "data": { "text/html": [ "
⚠️ Red s.u.: exceeds the refined value (consider adding constraints)
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.fit()\n", "project.display.fit.results()" ] }, { "cell_type": "markdown", "id": "132", "metadata": {}, "source": [ "#### Display Pattern" ] }, { "cell_type": "code", "execution_count": 68, "id": "133", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:43.444304Z", "iopub.status.busy": "2026-06-04T16:26:43.444085Z", "iopub.status.idle": "2026-06-04T16:26:44.604916Z", "shell.execute_reply": "2026-06-04T16:26:44.604099Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 69, "id": "134", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:44.610127Z", "iopub.status.busy": "2026-06-04T16:26:44.609917Z", "iopub.status.idle": "2026-06-04T16:26:45.481094Z", "shell.execute_reply": "2026-06-04T16:26:45.480319Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "135", "metadata": {}, "source": [ "### Perform Fit 4/5\n", "\n", "#### Set Constraints\n", "\n", "Set aliases for parameters." ] }, { "cell_type": "code", "execution_count": 70, "id": "136", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:45.482907Z", "iopub.status.busy": "2026-06-04T16:26:45.482739Z", "iopub.status.idle": "2026-06-04T16:26:45.486069Z", "shell.execute_reply": "2026-06-04T16:26:45.485273Z" } }, "outputs": [], "source": [ "project.analysis.aliases.create(\n", " label='biso_La',\n", " param=project.structures['lbco'].atom_sites['La'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " label='biso_Ba',\n", " param=project.structures['lbco'].atom_sites['Ba'].adp_iso,\n", ")" ] }, { "cell_type": "markdown", "id": "137", "metadata": {}, "source": [ "Set constraints." ] }, { "cell_type": "code", "execution_count": 71, "id": "138", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:45.487503Z", "iopub.status.busy": "2026-06-04T16:26:45.487344Z", "iopub.status.idle": "2026-06-04T16:26:45.490538Z", "shell.execute_reply": "2026-06-04T16:26:45.489517Z" } }, "outputs": [], "source": [ "project.analysis.constraints.create(expression='biso_Ba = biso_La')" ] }, { "cell_type": "markdown", "id": "139", "metadata": {}, "source": [ "Show defined constraints." ] }, { "cell_type": "code", "execution_count": 72, "id": "140", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:45.492173Z", "iopub.status.busy": "2026-06-04T16:26:45.491959Z", "iopub.status.idle": "2026-06-04T16:26:45.500046Z", "shell.execute_reply": "2026-06-04T16:26:45.499199Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mUser defined constraints\u001b[0m\n" ] }, { "data": { "text/html": [ "
idexpression
1biso_Babiso_Ba = biso_La
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Constraints enabled: \u001b[3;92mTrue\u001b[0m\n" ] } ], "source": [ "project.analysis.constraints.show()" ] }, { "cell_type": "markdown", "id": "141", "metadata": {}, "source": [ "Show free parameters." ] }, { "cell_type": "code", "execution_count": 73, "id": "142", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:45.501709Z", "iopub.status.busy": "2026-06-04T16:26:45.501523Z", "iopub.status.idle": "2026-06-04T16:26:45.532001Z", "shell.execute_reply": "2026-06-04T16:26:45.531368Z" } }, "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": [ "
datablockcategoryentryparametervalueuncertaintyminmaxunits
1lbcocelllength_a3.890870.00004-infinfΓ…
2lbcoatom_siteLaadp_iso0.505091216.74090-infinfΓ…Β²
3lbcoatom_siteBaadp_iso0.504811977.30283-infinfΓ…Β²
4lbcoatom_siteCoadp_iso0.237070.06119-infinfΓ…Β²
5lbcoatom_siteOadp_iso1.393540.01668-infinfΓ…Β²
6hrptlinked_phaseslbcoscale9.135030.06407-infinf
7hrptpeakbroad_gauss_u0.081570.00314-infinfdegΒ²
8hrptpeakbroad_gauss_v-0.115920.00672-infinfdegΒ²
9hrptpeakbroad_gauss_w0.120450.00328-infinfdegΒ²
10hrptpeakbroad_lorentz_y0.084450.00215-infinfdeg
11hrptinstrumenttwotheta_offset0.622580.00104-infinfdeg
12hrptbackground10y168.558491.36709-infinf
13hrptbackground30y164.335710.99917-infinf
14hrptbackground50y166.888140.73884-infinf
15hrptbackground110y175.400400.65706-infinf
16hrptbackground165y174.281130.91128-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "143", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 74, "id": "144", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:45.533885Z", "iopub.status.busy": "2026-06-04T16:26:45.533682Z", "iopub.status.idle": "2026-06-04T16:26:47.715666Z", "shell.execute_reply": "2026-06-04T16:26:47.714863Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-4cc51e28e3fd4d34a322afcf514db941-button');\n", " const status = document.getElementById('ed-fit-stop-4cc51e28e3fd4d34a322afcf514db941-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'hrpt'\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": [ "
iterationtime (s)χ²change / status
110.051.29
2200.941.29
" ], "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;36m19\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'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βš™οΈ Settings used:\n" ] }, { "data": { "text/html": [ "
NameValueDescription
1max_iterations1000Maximum solver iterations.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“‹ Least-squares fit results:\n" ] }, { "data": { "text/html": [ "
MetricValue
1πŸ§ͺ Minimizerlmfit
2βœ… Overall statussuccess
3⏱️ Fitting time (seconds)0.94
4πŸ” Iterations17
5πŸ“ Goodness-of-fit (reduced χ²)1.29
6πŸ“ R-factor (Rf, %)5.63
7πŸ“ R-factor squared (RfΒ², %)5.27
8πŸ“ Weighted R-factor (wR, %)4.41
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lbcocelllength_aΓ…3.89093.89090.00000.00 % ↑
2lbcoatom_siteLaadp_isoΓ…Β²0.50510.50510.02780.00 % ↓
3lbcoatom_siteCoadp_isoΓ…Β²0.23710.23700.05640.03 % ↓
4lbcoatom_siteOadp_isoΓ…Β²1.39351.39350.01600.00 % ↑
5hrptlinked_phaseslbcoscale9.13509.13510.05380.00 % ↑
6hrptpeakbroad_gauss_udegΒ²0.08160.08160.00310.00 % ↑
7hrptpeakbroad_gauss_vdegΒ²-0.1159-0.11590.00660.00 % ↑
8hrptpeakbroad_gauss_wdegΒ²0.12040.12040.00320.00 % ↑
9hrptpeakbroad_lorentz_ydeg0.08440.08440.00210.00 % ↓
10hrptinstrumenttwotheta_offsetdeg0.62260.62260.00100.00 % ↑
11hrptbackground10y168.5585168.55851.36690.00 % ↓
12hrptbackground30y164.3357164.33570.99900.00 % ↓
13hrptbackground50y166.8881166.88810.73860.00 % ↓
14hrptbackground110y175.4004175.40060.64880.00 % ↑
15hrptbackground165y174.2811174.28120.89440.00 % ↑
" ], "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.analysis.fit()\n", "project.display.fit.results()" ] }, { "cell_type": "markdown", "id": "145", "metadata": {}, "source": [ "#### Display Pattern" ] }, { "cell_type": "code", "execution_count": 75, "id": "146", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:47.717257Z", "iopub.status.busy": "2026-06-04T16:26:47.717083Z", "iopub.status.idle": "2026-06-04T16:26:48.596700Z", "shell.execute_reply": "2026-06-04T16:26:48.595841Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 76, "id": "147", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:48.601031Z", "iopub.status.busy": "2026-06-04T16:26:48.600865Z", "iopub.status.idle": "2026-06-04T16:26:49.480799Z", "shell.execute_reply": "2026-06-04T16:26:49.479970Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "148", "metadata": {}, "source": [ "### Perform Fit 5/5\n", "\n", "#### Set Constraints\n", "\n", "Set more aliases for parameters." ] }, { "cell_type": "code", "execution_count": 77, "id": "149", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.482362Z", "iopub.status.busy": "2026-06-04T16:26:49.482198Z", "iopub.status.idle": "2026-06-04T16:26:49.485707Z", "shell.execute_reply": "2026-06-04T16:26:49.484934Z" } }, "outputs": [], "source": [ "project.analysis.aliases.create(\n", " label='occ_La',\n", " param=project.structures['lbco'].atom_sites['La'].occupancy,\n", ")\n", "project.analysis.aliases.create(\n", " label='occ_Ba',\n", " param=project.structures['lbco'].atom_sites['Ba'].occupancy,\n", ")" ] }, { "cell_type": "markdown", "id": "150", "metadata": {}, "source": [ "Set more constraints." ] }, { "cell_type": "code", "execution_count": 78, "id": "151", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.487121Z", "iopub.status.busy": "2026-06-04T16:26:49.486973Z", "iopub.status.idle": "2026-06-04T16:26:49.489837Z", "shell.execute_reply": "2026-06-04T16:26:49.489045Z" } }, "outputs": [], "source": [ "project.analysis.constraints.create(\n", " expression='occ_Ba = 1 - occ_La',\n", ")" ] }, { "cell_type": "markdown", "id": "152", "metadata": {}, "source": [ "Show defined constraints." ] }, { "cell_type": "code", "execution_count": 79, "id": "153", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.491245Z", "iopub.status.busy": "2026-06-04T16:26:49.491083Z", "iopub.status.idle": "2026-06-04T16:26:49.497922Z", "shell.execute_reply": "2026-06-04T16:26:49.497187Z" }, "lines_to_next_cell": 2 }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mUser defined constraints\u001b[0m\n" ] }, { "data": { "text/html": [ "
idexpression
1biso_Babiso_Ba = biso_La
2occ_Baocc_Ba = 1 - occ_La
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Constraints enabled: \u001b[3;92mTrue\u001b[0m\n" ] } ], "source": [ "project.analysis.constraints.show()" ] }, { "cell_type": "markdown", "id": "154", "metadata": {}, "source": [ "Set structure parameters to be refined." ] }, { "cell_type": "code", "execution_count": 80, "id": "155", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.499300Z", "iopub.status.busy": "2026-06-04T16:26:49.499155Z", "iopub.status.idle": "2026-06-04T16:26:49.501950Z", "shell.execute_reply": "2026-06-04T16:26:49.501211Z" } }, "outputs": [], "source": [ "project.structures['lbco'].atom_sites['La'].occupancy.free = True" ] }, { "cell_type": "markdown", "id": "156", "metadata": {}, "source": [ "Show free parameters after selection." ] }, { "cell_type": "code", "execution_count": 81, "id": "157", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.503418Z", "iopub.status.busy": "2026-06-04T16:26:49.503272Z", "iopub.status.idle": "2026-06-04T16:26:49.529320Z", "shell.execute_reply": "2026-06-04T16:26:49.528645Z" } }, "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": [ "
datablockcategoryentryparametervalueuncertaintyminmaxunits
1lbcocelllength_a3.890870.00004-infinfΓ…
2lbcoatom_siteLaoccupancy0.50000-infinf
3lbcoatom_siteLaadp_iso0.505080.02777-infinfΓ…Β²
4lbcoatom_siteCoadp_iso0.236990.05643-infinfΓ…Β²
5lbcoatom_siteOadp_iso1.393550.01599-infinfΓ…Β²
6hrptlinked_phaseslbcoscale9.135090.05380-infinf
7hrptpeakbroad_gauss_u0.081570.00310-infinfdegΒ²
8hrptpeakbroad_gauss_v-0.115930.00664-infinfdegΒ²
9hrptpeakbroad_gauss_w0.120450.00325-infinfdegΒ²
10hrptpeakbroad_lorentz_y0.084450.00214-infinfdeg
11hrptinstrumenttwotheta_offset0.622580.00103-infinfdeg
12hrptbackground10y168.558491.36685-infinf
13hrptbackground30y164.335690.99900-infinf
14hrptbackground50y166.888080.73857-infinf
15hrptbackground110y175.400560.64879-infinf
16hrptbackground165y174.281240.89439-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "158", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 82, "id": "159", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:49.530864Z", "iopub.status.busy": "2026-06-04T16:26:49.530703Z", "iopub.status.idle": "2026-06-04T16:26:54.361714Z", "shell.execute_reply": "2026-06-04T16:26:54.360961Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-3e3fb0950b8544d093659a92b1fe9778-button');\n", " const status = document.getElementById('ed-fit-stop-3e3fb0950b8544d093659a92b1fe9778-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'hrpt'\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": [ "
iterationtime (s)χ²change / status
110.051.29
2552.511.28
" ], "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.28\u001b[0m at iteration \u001b[1;36m54\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'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " └── πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βš™οΈ Settings used:\n" ] }, { "data": { "text/html": [ "
NameValueDescription
1max_iterations1000Maximum solver iterations.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“‹ Least-squares fit results:\n" ] }, { "data": { "text/html": [ "
MetricValue
1πŸ§ͺ Minimizerlmfit
2βœ… Overall statussuccess
3⏱️ Fitting time (seconds)2.51
4πŸ” Iterations52
5πŸ“ Goodness-of-fit (reduced χ²)1.28
6πŸ“ R-factor (Rf, %)5.61
7πŸ“ R-factor squared (RfΒ², %)5.25
8πŸ“ Weighted R-factor (wR, %)4.39
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lbcocelllength_aΓ…3.89093.89090.00000.00 % ↑
2lbcoatom_siteLaoccupancy0.50000.58400.020316.81 % ↑
3lbcoatom_siteLaadp_isoΓ…Β²0.50510.59830.035518.46 % ↑
4lbcoatom_siteCoadp_isoΓ…Β²0.23700.16650.058029.74 % ↓
5lbcoatom_siteOadp_isoΓ…Β²1.39351.34910.01923.19 % ↓
6hrptlinked_phaseslbcoscale9.13518.90570.07612.51 % ↓
7hrptpeakbroad_gauss_udegΒ²0.08160.08120.00310.43 % ↓
8hrptpeakbroad_gauss_vdegΒ²-0.1159-0.11540.00660.48 % ↓
9hrptpeakbroad_gauss_wdegΒ²0.12040.12030.00320.14 % ↓
10hrptpeakbroad_lorentz_ydeg0.08440.08460.00210.18 % ↑
11hrptinstrumenttwotheta_offsetdeg0.62260.62260.00100.00 % ↑
12hrptbackground10y168.5585168.97801.36660.25 % ↑
13hrptbackground30y164.3357164.05350.99920.17 % ↓
14hrptbackground50y166.8881166.91250.73640.01 % ↑
15hrptbackground110y175.4006175.26990.64790.07 % ↓
16hrptbackground165y174.2812174.55800.89350.16 % ↑
" ], "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" }, { "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", "
\n", "
Loading plot…
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.analysis.fit()\n", "project.display.fit.results()\n", "project.display.fit.correlations()" ] }, { "cell_type": "markdown", "id": "160", "metadata": {}, "source": [ "#### Display Pattern" ] }, { "cell_type": "code", "execution_count": 83, "id": "161", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:54.363429Z", "iopub.status.busy": "2026-06-04T16:26:54.363256Z", "iopub.status.idle": "2026-06-04T16:26:55.248711Z", "shell.execute_reply": "2026-06-04T16:26:55.247609Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt')" ] }, { "cell_type": "code", "execution_count": 84, "id": "162", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:55.253458Z", "iopub.status.busy": "2026-06-04T16:26:55.253236Z", "iopub.status.idle": "2026-06-04T16:26:56.143417Z", "shell.execute_reply": "2026-06-04T16:26:56.142736Z" } }, "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": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='hrpt', x_min=38, x_max=41)" ] }, { "cell_type": "markdown", "id": "163", "metadata": {}, "source": [ "#### Display Structure" ] }, { "cell_type": "code", "execution_count": 85, "id": "164", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:56.144932Z", "iopub.status.busy": "2026-06-04T16:26:56.144775Z", "iopub.status.idle": "2026-06-04T16:26:56.379974Z", "shell.execute_reply": "2026-06-04T16:26:56.379227Z" } }, "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'lbco'\u001b[0m\u001b[1;36m \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mAtom view type: \u001b[0m\u001b[32m'adp'\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='lbco')" ] }, { "cell_type": "markdown", "id": "165", "metadata": {}, "source": [ "## πŸ“Š Report\n", "\n", "This final section shows how to review the results of the analysis.\n", "\n", "By default, HTML report is generated after fitting. Here we also\n", "show how to activate generation of CIF, TEX and PDF reports with\n", "regular project saves.\n", "Keep in mind, that PDF report generation requires additional\n", "dependencies and is not that fast to be generated after each fit, so\n", "use it with caution.\n", "The generated report files will be saved in the `reports` folder of\n", "the project directory." ] }, { "cell_type": "code", "execution_count": 86, "id": "166", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:26:56.381442Z", "iopub.status.busy": "2026-06-04T16:26:56.381285Z", "iopub.status.idle": "2026-06-04T16:27:09.387240Z", "shell.execute_reply": "2026-06-04T16:27:09.386540Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'lbco_hrpt'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_3_lbco_hrpt'\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": [ "β”‚ └── πŸ“„ lbco.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ hrpt.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": [ " β”œβ”€β”€ πŸ“„ lbco_hrpt.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " β”œβ”€β”€ πŸ“„ lbco_hrpt.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " β”œβ”€β”€ πŸ“„ tex/lbco_hrpt.tex\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ lbco_hrpt.pdf\n" ] } ], "source": [ "project.report.cif = True\n", "project.report.tex = True\n", "project.report.pdf = True\n", "project.save()" ] } ], "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 }