{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:10.978206Z", "iopub.status.busy": "2026-08-18T18:19:10.978046Z", "iopub.status.idle": "2026-08-18T18:19:10.981925Z", "shell.execute_reply": "2026-08-18T18:19:10.981222Z" }, "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.20.1" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Structure Refinement: LaM(7)O3, P02.1 Synchrotron XRD\n", "\n", "This example refines the compositionally complex LaM(7)O3 perovskite,\n", "with La on the A site and an equimolar mixture of Ti, Cr, Mn, Fe, Co,\n", "Ni, and Cu on the B site. The low-temperature synchrotron X-ray powder\n", "diffraction pattern was collected at the P02.1 beamline at PETRA III.\n", "The workflow starts from approximate structural and profile parameters,\n", "estimates the background from the measured pattern, and improves the\n", "model in two fitting stages." ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "## 🛠️ Import Library" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:10.983251Z", "iopub.status.busy": "2026-08-18T18:19:10.983099Z", "iopub.status.idle": "2026-08-18T18:19:13.702050Z", "shell.execute_reply": "2026-08-18T18:19:13.701209Z" } }, "outputs": [], "source": [ "import easydiffraction as edi" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## 📦 Define Project\n", "\n", "The project manages the structures, experiments, analysis, and saved\n", "results used throughout the tutorial.\n", "\n", "### Create Project" ] }, { "cell_type": "code", "execution_count": 3, "id": "5", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:13.704440Z", "iopub.status.busy": "2026-08-18T18:19:13.704161Z", "iopub.status.idle": "2026-08-18T18:19:13.998530Z", "shell.execute_reply": "2026-08-18T18:19:13.997616Z" } }, "outputs": [], "source": [ "project = edi.Project(\n", " name='lam7o3_p021',\n", " description='LaM(7)O3 refinement using P02.1 synchrotron X-ray data.',\n", ")" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "### Save Initial Project\n", "\n", "Create the project directory before fitting so that analysis results\n", "can be written as they are produced." ] }, { "cell_type": "code", "execution_count": 4, "id": "7", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.000696Z", "iopub.status.busy": "2026-08-18T18:19:14.000536Z", "iopub.status.idle": "2026-08-18T18:19:14.051763Z", "shell.execute_reply": "2026-08-18T18:19:14.050901Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project 📦 \u001b[0m\u001b[32m'lam7o3_p021'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-lam7o3-p021'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "├── 📄 project.edi\n", "├── 📁 structures/\n", "├── 📁 experiments/\n", "├── 📁 analysis/\n", "│ └── 📄 analysis.edi\n", "└── 📁 reports/\n", " └── 📄 lam7o3_p021.html\n" ] } ], "source": [ "project.save_as(dir_path='projects/refine-lam7o3-p021')" ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "## 🧩 Define Structure\n", "\n", "The Pnma structure is initialized from approximate values rather than\n", "the final refined values.\n", "\n", "### Create Structure\n", "\n", "Define the structure as an inline CIF. Empty uncertainty parentheses,\n", "such as `5.5()`, mark a parameter as free without assigning an initial\n", "standard uncertainty. Values without parentheses remain fixed." ] }, { "cell_type": "code", "execution_count": 5, "id": "9", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.053499Z", "iopub.status.busy": "2026-08-18T18:19:14.053257Z", "iopub.status.idle": "2026-08-18T18:19:14.056664Z", "shell.execute_reply": "2026-08-18T18:19:14.056007Z" } }, "outputs": [], "source": [ "structure_cif = \"\"\"\n", "data_lam7o3\n", "\n", "_cell.length_a 5.5()\n", "_cell.length_b 7.7()\n", "_cell.length_c 5.5()\n", "_cell.angle_alpha 90.\n", "_cell.angle_beta 90.\n", "_cell.angle_gamma 90.\n", "\n", "_space_group.name_h_m \"P n m a\"\n", "_space_group.coord_system_code abc\n", "\n", "loop_\n", "_atom_site.id\n", "_atom_site.type_symbol\n", "_atom_site.fract_x\n", "_atom_site.fract_y\n", "_atom_site.fract_z\n", "_atom_site.occupancy\n", "_atom_site.adp_iso\n", "_atom_site.adp_type\n", "La La 0.48() 0.25 0.004() 1. 0.1() Biso\n", "Ti Ti 0. 0. 0. 0.14286 0.1() Biso\n", "Cr Cr 0. 0. 0. 0.14286 0.1 Biso\n", "Mn Mn 0. 0. 0. 0.14286 0.1 Biso\n", "Fe Fe 0. 0. 0. 0.14286 0.1 Biso\n", "Co Co 0. 0. 0. 0.14286 0.1 Biso\n", "Ni Ni 0. 0. 0. 0.14286 0.1 Biso\n", "Cu Cu 0. 0. 0. 0.14286 0.1 Biso\n", "O1 O 0.51() 0.25 0.57() 1. 0.1() Biso\n", "O2 O 0.22() 0.03() 0.27() 1. 0.1 Biso\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 6, "id": "10", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.058494Z", "iopub.status.busy": "2026-08-18T18:19:14.058310Z", "iopub.status.idle": "2026-08-18T18:19:14.069654Z", "shell.execute_reply": "2026-08-18T18:19:14.068784Z" } }, "outputs": [], "source": [ "project.structures.add_from_cif_str(structure_cif)" ] }, { "cell_type": "code", "execution_count": 7, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.071117Z", "iopub.status.busy": "2026-08-18T18:19:14.070959Z", "iopub.status.idle": "2026-08-18T18:19:14.075590Z", "shell.execute_reply": "2026-08-18T18:19:14.074559Z" } }, "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'lam7o3'\u001b[0m\u001b[1m]\u001b[0m\n" ] } ], "source": [ "project.structures.show_names()" ] }, { "cell_type": "markdown", "id": "12", "metadata": {}, "source": [ "Use a short alias to access the structure parameters below." ] }, { "cell_type": "code", "execution_count": 8, "id": "13", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.077103Z", "iopub.status.busy": "2026-08-18T18:19:14.076936Z", "iopub.status.idle": "2026-08-18T18:19:14.079637Z", "shell.execute_reply": "2026-08-18T18:19:14.078871Z" } }, "outputs": [], "source": [ "structure = project.structures['lam7o3']" ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "### Display Structure\n", "\n", "Inspect the structure as text and as an interactive crystal model." ] }, { "cell_type": "code", "execution_count": 9, "id": "15", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.081128Z", "iopub.status.busy": "2026-08-18T18:19:14.080964Z", "iopub.status.idle": "2026-08-18T18:19:14.207007Z", "shell.execute_reply": "2026-08-18T18:19:14.206266Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'lam7o3'\u001b[0m\u001b[1;36m as text\u001b[0m\n" ] }, { "data": { "text/html": [ "
Edi
1data_lam7o3
2
3_cell.length_a 5.5()
4_cell.length_b 7.7()
5_cell.length_c 5.5()
6_cell.angle_alpha 90.
7_cell.angle_beta 90.
8_cell.angle_gamma 90.
9
10_space_group.name_h_m "P n m a"
11_space_group.coord_system_code abc
12
13_geom.min_bond_distance_cutoff 0.
14_geom.bond_distance_inc 0.25
15
16loop_
17_atom_site.id
18_atom_site.type_symbol
19_atom_site.fract_x
20_atom_site.fract_y
21_atom_site.fract_z
22_atom_site.wyckoff_letter
23_atom_site.multiplicity
24_atom_site.occupancy
25_atom_site.adp_iso
26_atom_site.adp_type
27La La 0.48() 0.25 0.004() c 4 1. 0.1() Biso
28Ti Ti 0. 0. 0. a 4 0.14286 0.1() Biso
29Cr Cr 0. 0. 0. a 4 0.14286 0.1 Biso
30Mn Mn 0. 0. 0. a 4 0.14286 0.1 Biso
31Fe Fe 0. 0. 0. a 4 0.14286 0.1 Biso
32Co Co 0. 0. 0. a 4 0.14286 0.1 Biso
33Ni Ni 0. 0. 0. a 4 0.14286 0.1 Biso
34Cu Cu 0. 0. 0. a 4 0.14286 0.1 Biso
35O1 O 0.51() 0.25 0.57() c 4 1. 0.1() Biso
36O2 O 0.22() 0.03() 0.27() d 8 1. 0.1 Biso
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "structure.show_as_text()" ] }, { "cell_type": "code", "execution_count": 10, "id": "16", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.208803Z", "iopub.status.busy": "2026-08-18T18:19:14.208629Z", "iopub.status.idle": "2026-08-18T18:19:14.234390Z", "shell.execute_reply": "2026-08-18T18:19:14.233449Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'lam7o3'\u001b[0m\u001b[1;36m \u001b[0m\u001b[1;36m(\u001b[0m\u001b[1;36mAtom view type: \u001b[0m\u001b[32m'covalent'\u001b[0m\u001b[1;36m)\u001b[0m\n" ] }, { "data": { "text/html": [ "
\n", "
\n", "
Loading plot…
\n", "
\n", "
\n", "
\n", "
drag = rotate
wheel = zoom
right-drag = pan
\n", "
\n", "
\n", "\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.structure(struct_name='lam7o3')" ] }, { "cell_type": "markdown", "id": "17", "metadata": {}, "source": [ "## 🔬 Define Experiment\n", "\n", "Load the measured pattern, configure the instrument and peak profile,\n", "and link the structure to the experiment.\n", "\n", "### Download Data\n", "\n", "The first two columns contain 2-theta and intensity. When a third\n", "column of standard uncertainties is absent, EasyDiffraction estimates\n", "it from the square root of the intensity." ] }, { "cell_type": "code", "execution_count": 11, "id": "18", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.235822Z", "iopub.status.busy": "2026-08-18T18:19:14.235668Z", "iopub.status.idle": "2026-08-18T18:19:14.429996Z", "shell.execute_reply": "2026-08-18T18:19:14.427124Z" } }, "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[32m'meas-hep7c-xray-synchrotron'\u001b[0m: La high-entropy perovskite \u001b[1m(\u001b[0m\u001b[1;36m7\u001b[0m B-cations\u001b[1m)\u001b[0m, synchrotron X-ray\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Data \u001b[32m'meas-hep7c-xray-synchrotron'\u001b[0m downloaded to \u001b[32m'../../../data/meas-hep7c-xray-synchrotron.dat'\u001b[0m\n" ] } ], "source": [ "data_path = edi.download_data('meas-hep7c-xray-synchrotron', destination='data')" ] }, { "cell_type": "markdown", "id": "19", "metadata": {}, "source": [ "### Create P02.1 Experiment" ] }, { "cell_type": "code", "execution_count": 12, "id": "20", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.431947Z", "iopub.status.busy": "2026-08-18T18:19:14.431583Z", "iopub.status.idle": "2026-08-18T18:19:14.642116Z", "shell.execute_reply": "2026-08-18T18:19:14.641229Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "⚠️ No uncertainty (sy) column provided. Defaulting to sqrt(y). \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mData loaded successfully\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Experiment 🔬 \u001b[32m'p021'\u001b[0m. Number of data points: \u001b[1;36m1459\u001b[0m.\n" ] } ], "source": [ "project.experiments.add_from_data_path(\n", " name='p021',\n", " data_path=data_path,\n", " sample_form='powder',\n", " beam_mode='constant wavelength',\n", " radiation_probe='xray',\n", ")" ] }, { "cell_type": "markdown", "id": "21", "metadata": {}, "source": [ "Use a short alias to access the P02.1 experiment parameters below." ] }, { "cell_type": "code", "execution_count": 13, "id": "22", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.643739Z", "iopub.status.busy": "2026-08-18T18:19:14.643567Z", "iopub.status.idle": "2026-08-18T18:19:14.646411Z", "shell.execute_reply": "2026-08-18T18:19:14.645585Z" } }, "outputs": [], "source": [ "experiment = project.experiments['p021']" ] }, { "cell_type": "markdown", "id": "23", "metadata": {}, "source": [ "### Set Linked Structures\n", "\n", "Link the structural model to the measured pattern and use an\n", "order-of-magnitude estimate for the scale factor." ] }, { "cell_type": "code", "execution_count": 14, "id": "24", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.647910Z", "iopub.status.busy": "2026-08-18T18:19:14.647758Z", "iopub.status.idle": "2026-08-18T18:19:14.650823Z", "shell.execute_reply": "2026-08-18T18:19:14.650068Z" } }, "outputs": [], "source": [ "experiment.linked_structures.create(\n", " structure_id='lam7o3',\n", " scale=0.000005,\n", ")" ] }, { "cell_type": "markdown", "id": "25", "metadata": {}, "source": [ "### Set P02.1 Instrument Parameters\n", "\n", "Set the monochromatic X-ray wavelength reported for the P02.1\n", "beamline measurement and initialize the unknown 2-theta zero shift at\n", "zero." ] }, { "cell_type": "code", "execution_count": 15, "id": "26", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.652602Z", "iopub.status.busy": "2026-08-18T18:19:14.652422Z", "iopub.status.idle": "2026-08-18T18:19:14.655230Z", "shell.execute_reply": "2026-08-18T18:19:14.654473Z" } }, "outputs": [], "source": [ "experiment.instrument.setup_wavelength = 0.207109\n", "experiment.instrument.calib_twotheta_offset = 0.0" ] }, { "cell_type": "markdown", "id": "27", "metadata": {}, "source": [ "### Set Peak Profile\n", "\n", "Select a pseudo-Voigt profile and provide approximate broadening\n", "parameters. U, V, and W define the Gaussian contribution; X and Y\n", "define the Lorentzian contribution." ] }, { "cell_type": "code", "execution_count": 16, "id": "28", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.656754Z", "iopub.status.busy": "2026-08-18T18:19:14.656585Z", "iopub.status.idle": "2026-08-18T18:19:14.663160Z", "shell.execute_reply": "2026-08-18T18:19:14.662422Z" } }, "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 + berar-baldinozzi asymmetryCWL pseudo-Voigt profile with Berar-Baldinozzi asymmetry correction.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "experiment.peak.show_supported()" ] }, { "cell_type": "code", "execution_count": 17, "id": "29", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.664915Z", "iopub.status.busy": "2026-08-18T18:19:14.664752Z", "iopub.status.idle": "2026-08-18T18:19:14.669424Z", "shell.execute_reply": "2026-08-18T18:19:14.668736Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mPeak profile type for experiment \u001b[0m\u001b[32m'p021'\u001b[0m\u001b[1;36m changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "pseudo-voigt\n" ] } ], "source": [ "experiment.peak.type = 'pseudo-voigt'" ] }, { "cell_type": "code", "execution_count": 18, "id": "30", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.670844Z", "iopub.status.busy": "2026-08-18T18:19:14.670686Z", "iopub.status.idle": "2026-08-18T18:19:14.673839Z", "shell.execute_reply": "2026-08-18T18:19:14.673118Z" } }, "outputs": [], "source": [ "experiment.peak.broad_gauss_u = 0.04\n", "experiment.peak.broad_gauss_v = -0.01\n", "experiment.peak.broad_gauss_w = 0.001\n", "experiment.peak.broad_lorentz_x = 0.1\n", "experiment.peak.broad_lorentz_y = 0.0" ] }, { "cell_type": "markdown", "id": "31", "metadata": {}, "source": [ "### Set Excluded Regions\n", "\n", "Restrict the fit to the useful measured range from 2 to 15 degrees." ] }, { "cell_type": "code", "execution_count": 19, "id": "32", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.675257Z", "iopub.status.busy": "2026-08-18T18:19:14.675097Z", "iopub.status.idle": "2026-08-18T18:19:14.678342Z", "shell.execute_reply": "2026-08-18T18:19:14.677638Z" } }, "outputs": [], "source": [ "experiment.excluded_regions.create(id='1', start=0.0, end=2.0)\n", "experiment.excluded_regions.create(id='2', start=15.0, end=20.0)" ] }, { "cell_type": "markdown", "id": "33", "metadata": {}, "source": [ "### Set Background\n", "\n", "Estimate initial background points from the measured pattern alone." ] }, { "cell_type": "code", "execution_count": 20, "id": "34", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.679984Z", "iopub.status.busy": "2026-08-18T18:19:14.679825Z", "iopub.status.idle": "2026-08-18T18:19:14.702091Z", "shell.execute_reply": "2026-08-18T18:19:14.701328Z" } }, "outputs": [], "source": [ "experiment.background.auto_estimate(use_model=False)" ] }, { "cell_type": "code", "execution_count": 21, "id": "35", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.704218Z", "iopub.status.busy": "2026-08-18T18:19:14.704038Z", "iopub.status.idle": "2026-08-18T18:19:14.710966Z", "shell.execute_reply": "2026-08-18T18:19:14.710300Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mLine-segment background points\u001b[0m\n" ] }, { "data": { "text/html": [ "
PositionIntensity
12.00330584.02820
23.19170616.43436
33.49660608.10597
43.72800594.63226
53.95940574.02994
64.94790457.72470
75.17920443.13978
85.46320433.01395
96.02050432.92677
106.97750421.29697
117.75570444.89668
128.61800453.76679
1311.28920346.83990
1411.93060357.71449
1514.73850302.43079
1614.99090278.31547
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "experiment.background.show()" ] }, { "cell_type": "markdown", "id": "36", "metadata": {}, "source": [ "### Inspect Experiment\n", "\n", "Display the configured experiment as text." ] }, { "cell_type": "code", "execution_count": 22, "id": "37", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:14.712974Z", "iopub.status.busy": "2026-08-18T18:19:14.712797Z", "iopub.status.idle": "2026-08-18T18:19:15.646557Z", "shell.execute_reply": "2026-08-18T18:19:15.645790Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mExperiment 🔬 \u001b[0m\u001b[32m'p021'\u001b[0m\u001b[1;36m as text\u001b[0m\n" ] }, { "data": { "text/html": [ "
Edi
1data_p021
2
3_experiment_type.sample_form powder
4_experiment_type.beam_mode "constant wavelength"
5_experiment_type.radiation_probe xray
6_experiment_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.04
16_peak.broad_gauss_v -0.01
17_peak.broad_gauss_w 0.001
18_peak.broad_lorentz_x 0.1
19_peak.broad_lorentz_y 0.
20_peak.cutoff_fwhm 0.
21_peak.type cwl-pseudo-voigt
22
23_instrument.setup_wavelength 0.207109
24_instrument.setup_wavelength_2 0.
25_instrument.setup_wavelength_2_to_1_ratio 0.
26_instrument.calib_twotheta_offset 0.
27_instrument.calib_sample_displacement 0.
28_instrument.calib_sample_transparency 0.
29_instrument.setup_polarization_coefficient 0.
30_instrument.setup_monochromator_twotheta 0.
31
32_absorption.type none
33
34loop_
35_linked_structure.structure_id
36_linked_structure.scale
37lam7o3 0.000005
38
39loop_
40_excluded_region.id
41_excluded_region.start
42_excluded_region.end
431 0. 2.
442 15. 20.
45
46_background.type line-segment
47
48loop_
49_background.id
50_background.position
51_background.intensity
521 2.0033 584.0282
532 3.1917 616.4343557
543 3.4966 608.10596651
554 3.728 594.63226302
565 3.9594 574.02993766
576 4.9479 457.7247
587 5.1792 443.13977867
598 5.4632 433.01395145
609 6.0205 432.92676858
6110 6.9775 421.2969741
6211 7.7557 444.89668148
6312 8.618 453.76678528
6413 11.2892 346.83989649
6514 11.9306 357.71448643
6615 14.7385 302.43079253
6716 14.9909 278.31546798
68
69loop_
70_data.two_theta
71_data.id
72_data.d_spacing
73_data.intensity_meas
74_data.intensity_meas_su
75_data.intensity_calc
76_data.intensity_bkg
77_data.calc_status
780.0053 1 0. 0. 1. 0. 0. excl
790.0158 2 0. 0. 1. 0. 0. excl
800.0263 3 0. 0. 1. 0. 0. excl
810.0368 4 0. 0. 1. 0. 0. excl
820.0473 5 0. 0. 1. 0. 0. excl
830.0578 6 0. 0. 1. 0. 0. excl
840.0684 7 0. 0. 1. 0. 0. excl
850.0789 8 0. 0. 1. 0. 0. excl
860.0894 9 0. 0. 1. 0. 0. excl
870.0999 10 0. 0. 1. 0. 0. excl
88...
8915.2432 1450 0. 65.524826 8.09474064 0. 0. excl
9015.2538 1451 0. 43.702377 6.61077734 0. 0. excl
9115.2643 1452 0. 31.145777 5.58084017 0. 0. excl
9215.2748 1453 0. 20.166813 4.49074749 0. 0. excl
9315.2853 1454 0. 14.170188 3.76433102 0. 0. excl
9415.2958 1455 0. 7.3013401 2.7020992 0. 0. excl
9515.3063 1456 0. 12.101576 3.47873195 0. 0. excl
9615.3169 1457 0. 6.531918 2.55576173 0. 0. excl
9715.3274 1458 0. 3.1248069 1.76771234 0. 0. excl
9815.3379 1459 0. 3.6774037 1.91765578 0. 0. excl
99
100loop_
101_refln.id
102_refln.structure_id
103_refln.d_spacing
104_refln.sin_theta_over_lambda
105_refln.index_h
106_refln.index_k
107_refln.index_l
108_refln.f_calc
109_refln.f_squared_calc
110_refln.two_theta
1111 lam7o3 7.7 0.06493506 0 1 0 0. 0. 1.54114667
1122 lam7o3 5.5 0.09090909 0 0 1 0. 0. 2.15766778
1133 lam7o3 5.5 0.09090909 1 0 0 0. 0. 2.15766778
1144 lam7o3 4.47553409 0.11171851 0 1 1 3.59310475 12.91040172 2.65164569
1155 lam7o3 4.47553409 0.11171851 1 1 0 0. 0. 2.65164569
1166 lam7o3 3.8890873 0.12856487 1 0 1 84.40914375 7124.90354832 3.05158341
1177 lam7o3 3.85 0.12987013 0 2 0 85.84489383 7369.34579669 3.08257218
1188 lam7o3 3.47142809 0.14403294 1 1 1 24.66596148 608.40965573 3.4188328
1199 lam7o3 3.15404289 0.1585267 1 2 0 0. 0. 3.76298134
12010 lam7o3 3.15404289 0.1585267 0 2 1 0. 0. 3.76298134
121...
122605 lam7o3 0.63080858 0.79263348 0 10 5 0. 0. 18.89705877
123606 lam7o3 0.63072392 0.79273987 5 2 7 107.42119834 11539.3138528 18.89961836
124607 lam7o3 0.63072392 0.79273987 7 2 5 90.76949065 8239.10043243 18.89961836
125608 lam7o3 0.63021671 0.79337789 2 4 8 97.82362003 9569.46063649 18.91496894
126609 lam7o3 0.63021671 0.79337789 8 4 2 76.04580662 5782.96470497 18.91496894
127610 lam7o3 0.62937406 0.79444012 3 6 7 108.33293447 11736.02469019 18.94052659
128611 lam7o3 0.62937406 0.79444012 7 6 3 78.37832345 6143.16158631 18.94052659
129612 lam7o3 0.62845104 0.79560693 6 3 6 53.64286926 2877.55742291 18.9686017
130613 lam7o3 0.62778229 0.79645445 8 5 0 76.32628817 5825.702266 18.98899484
131614 lam7o3 0.62778229 0.79645445 0 5 8 0. 0. 18.98899484
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "experiment.show_as_text()" ] }, { "cell_type": "markdown", "id": "38", "metadata": {}, "source": [ "## 🚀 Perform Analysis\n", "\n", "Select the refinement parameters, apply the shared-Biso constraints,\n", "and improve the model in two fitting stages.\n", "\n", "### Set Free Parameters\n", "\n", "The independent cell lengths, selected fractional coordinates, and\n", "three independent Biso values were marked free by `()` in the inline\n", "CIF. They do not need to be selected again here." ] }, { "cell_type": "markdown", "id": "39", "metadata": {}, "source": [ "Refine the scale factor, zero shift, U/V/W/X profile terms, and active\n", "background-point intensities." ] }, { "cell_type": "code", "execution_count": 23, "id": "40", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.648511Z", "iopub.status.busy": "2026-08-18T18:19:15.648321Z", "iopub.status.idle": "2026-08-18T18:19:15.652552Z", "shell.execute_reply": "2026-08-18T18:19:15.651755Z" } }, "outputs": [], "source": [ "experiment.linked_structures['lam7o3'].scale.free = True\n", "\n", "experiment.instrument.calib_twotheta_offset.free = True\n", "\n", "experiment.peak.broad_gauss_u.free = True\n", "experiment.peak.broad_gauss_v.free = True\n", "experiment.peak.broad_gauss_w.free = True\n", "experiment.peak.broad_lorentz_x.free = True\n", "\n", "for point in experiment.background:\n", " point.intensity.free = True" ] }, { "cell_type": "markdown", "id": "41", "metadata": {}, "source": [ "Display all parameters selected for refinement." ] }, { "cell_type": "code", "execution_count": 24, "id": "42", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.654047Z", "iopub.status.busy": "2026-08-18T18:19:15.653894Z", "iopub.status.idle": "2026-08-18T18:19:15.744781Z", "shell.execute_reply": "2026-08-18T18:19:15.743966Z" } }, "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
1lam7o3celllength_a5.50000-infinfÅ
2lam7o3celllength_b7.70000-infinfÅ
3lam7o3celllength_c5.50000-infinfÅ
4lam7o3atom_siteLafract_x0.48000-infinf
5lam7o3atom_siteLafract_z0.00400-infinf
6lam7o3atom_siteLaadp_iso0.10000-infinfŲ
7lam7o3atom_siteTiadp_iso0.10000-infinfŲ
8lam7o3atom_siteO1fract_x0.51000-infinf
9lam7o3atom_siteO1fract_z0.57000-infinf
10lam7o3atom_siteO1adp_iso0.10000-infinfŲ
11lam7o3atom_siteO2fract_x0.22000-infinf
12lam7o3atom_siteO2fract_y0.03000-infinf
13lam7o3atom_siteO2fract_z0.27000-infinf
14p021linked_structurelam7o3scale0.00001-infinf
15p021peakbroad_gauss_u0.04000-infinfdeg²
16p021peakbroad_gauss_v-0.01000-infinfdeg²
17p021peakbroad_gauss_w0.00100-infinfdeg²
18p021peakbroad_lorentz_x0.10000-infinfdeg
19p021instrumenttwotheta_offset0.00000-infinfdeg
20p021background1intensity584.02820-infinf
21p021background2intensity616.43436-infinf
22p021background3intensity608.10597-infinf
23p021background4intensity594.63226-infinf
24p021background5intensity574.02994-infinf
25p021background6intensity457.72470-infinf
26p021background7intensity443.13978-infinf
27p021background8intensity433.01395-infinf
28p021background9intensity432.92677-infinf
29p021background10intensity421.29697-infinf
30p021background11intensity444.89668-infinf
31p021background12intensity453.76679-infinf
32p021background13intensity346.83990-infinf
33p021background14intensity357.71449-infinf
34p021background15intensity302.43079-infinf
35p021background16intensity278.31547-infinf
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.parameters.free()" ] }, { "cell_type": "markdown", "id": "43", "metadata": {}, "source": [ "### Set Constraints\n", "\n", "Create aliases for the constrained Biso parameters. The seven\n", "elements share one B site and therefore one Biso value; O1 and O2\n", "are also modeled with one shared Biso value." ] }, { "cell_type": "code", "execution_count": 25, "id": "44", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.746751Z", "iopub.status.busy": "2026-08-18T18:19:15.746568Z", "iopub.status.idle": "2026-08-18T18:19:15.752567Z", "shell.execute_reply": "2026-08-18T18:19:15.751783Z" } }, "outputs": [], "source": [ "# B sites: Ti, Cr, Mn, Fe, Co, Ni, Cu\n", "project.analysis.aliases.create(\n", " id='biso_Ti',\n", " param=structure.atom_sites['Ti'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Cr',\n", " param=structure.atom_sites['Cr'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Mn',\n", " param=structure.atom_sites['Mn'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Fe',\n", " param=structure.atom_sites['Fe'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Co',\n", " param=structure.atom_sites['Co'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Ni',\n", " param=structure.atom_sites['Ni'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_Cu',\n", " param=structure.atom_sites['Cu'].adp_iso,\n", ")\n", "\n", "# O sites: O1, O2\n", "project.analysis.aliases.create(\n", " id='biso_O1',\n", " param=structure.atom_sites['O1'].adp_iso,\n", ")\n", "project.analysis.aliases.create(\n", " id='biso_O2',\n", " param=structure.atom_sites['O2'].adp_iso,\n", ")" ] }, { "cell_type": "markdown", "id": "45", "metadata": {}, "source": [ "Apply the equality constraints using the aliases." ] }, { "cell_type": "code", "execution_count": 26, "id": "46", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.754842Z", "iopub.status.busy": "2026-08-18T18:19:15.754658Z", "iopub.status.idle": "2026-08-18T18:19:15.760764Z", "shell.execute_reply": "2026-08-18T18:19:15.759716Z" } }, "outputs": [], "source": [ "project.analysis.constraints.create(id='1', expression='biso_Cr = biso_Ti')\n", "project.analysis.constraints.create(id='2', expression='biso_Mn = biso_Ti')\n", "project.analysis.constraints.create(id='3', expression='biso_Fe = biso_Ti')\n", "project.analysis.constraints.create(id='4', expression='biso_Co = biso_Ti')\n", "project.analysis.constraints.create(id='5', expression='biso_Ni = biso_Ti')\n", "project.analysis.constraints.create(id='6', expression='biso_Cu = biso_Ti')\n", "\n", "project.analysis.constraints.create(id='7', expression='biso_O2 = biso_O1')" ] }, { "cell_type": "markdown", "id": "47", "metadata": {}, "source": [ "Display the defined constraints." ] }, { "cell_type": "code", "execution_count": 27, "id": "48", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.762691Z", "iopub.status.busy": "2026-08-18T18:19:15.762439Z", "iopub.status.idle": "2026-08-18T18:19:15.770406Z", "shell.execute_reply": "2026-08-18T18:19:15.769771Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mUser defined constraints\u001b[0m\n" ] }, { "data": { "text/html": [ "
idexpression
11biso_Cr = biso_Ti
22biso_Mn = biso_Ti
33biso_Fe = biso_Ti
44biso_Co = biso_Ti
55biso_Ni = biso_Ti
66biso_Cu = biso_Ti
77biso_O2 = biso_O1
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Constraints enabled: \u001b[3;92mTrue\u001b[0m\n" ] } ], "source": [ "project.analysis.display.constraints()" ] }, { "cell_type": "markdown", "id": "49", "metadata": {}, "source": [ "### Fit Initial Model\n", "\n", "The first fit uses a background estimated directly from the measured\n", "pattern.\n", "\n", "#### Display Pattern (Before Fit)\n", "\n", "Compare the measured pattern with the calculation from the starting\n", "model before optimization." ] }, { "cell_type": "code", "execution_count": 28, "id": "50", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.772088Z", "iopub.status.busy": "2026-08-18T18:19:15.771933Z", "iopub.status.idle": "2026-08-18T18:19:15.899037Z", "shell.execute_reply": "2026-08-18T18:19:15.898329Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021')" ] }, { "cell_type": "code", "execution_count": 29, "id": "51", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:15.901950Z", "iopub.status.busy": "2026-08-18T18:19:15.901767Z", "iopub.status.idle": "2026-08-18T18:19:16.000647Z", "shell.execute_reply": "2026-08-18T18:19:15.999971Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021', x_min=2.2, x_max=4.0)" ] }, { "cell_type": "markdown", "id": "52", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 30, "id": "53", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:19:16.003031Z", "iopub.status.busy": "2026-08-18T18:19:16.002857Z", "iopub.status.idle": "2026-08-18T18:22:09.589706Z", "shell.execute_reply": "2026-08-18T18:22:09.586977Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-1cc66c56ef2d4cf0be20bf9c49b689d3-button');\n", " const status = document.getElementById('ed-fit-stop-1cc66c56ef2d4cf0be20bf9c49b689d3-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'p021'\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.21276.18
2205.55276.18
33910.6746.4683.2% ↓
45715.9346.46
57520.7915.9765.6% ↓
69326.1015.97
711131.063.8975.7% ↓
813036.433.89
914642.143.89
1014943.161.7155.9% ↓
1116148.411.71
1217253.661.71
1318458.731.71
1418558.961.1234.9% ↓
1519764.251.12
1620869.281.12
1722074.771.12
1822175.180.8820.9% ↓
1923280.260.88
2024385.410.88
2125490.590.88
2226795.860.88
23278101.070.88
24291106.370.88
25302111.530.88
26314117.040.88
27326122.140.88
28338127.470.88
29350132.670.88
30360137.740.88
31371142.920.88
32383148.180.88
33394153.340.88
34405158.430.88
35417163.820.88
36429169.070.88
37438173.490.88
" ], "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;36m0.88\u001b[0m at iteration \u001b[1;36m437\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Fitting complete.\n" ] } ], "source": [ "project.analysis.fit()" ] }, { "cell_type": "markdown", "id": "54", "metadata": {}, "source": [ "Display the initial fit summary and the strongest parameter\n", "correlations." ] }, { "cell_type": "code", "execution_count": 31, "id": "55", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:09.591109Z", "iopub.status.busy": "2026-08-18T18:22:09.590942Z", "iopub.status.idle": "2026-08-18T18:22:10.846205Z", "shell.execute_reply": "2026-08-18T18:22:10.845562Z" } }, "outputs": [ { "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 (leastsq)
2✅ Overall statussuccess
3⏱️ Fitting time (seconds)173.49
4🔁 Iterations435
5📏 Goodness-of-fit (reduced χ²)0.88
6📏 R-factor (Rf, %)2.39
7📏 R-factor squared (Rf², %)2.55
8📏 Weighted R-factor (wR, %)1.91
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "📈 Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lam7o3celllength_aÅ5.50005.46230.00020.69 % ↓
2lam7o3celllength_bÅ7.70007.73320.00040.43 % ↑
3lam7o3celllength_cÅ5.50005.49030.00020.18 % ↓
4lam7o3atom_siteLafract_x0.48000.47660.00020.72 % ↓
5lam7o3atom_siteLafract_z0.00400.00530.000631.47 % ↑
6lam7o3atom_siteLaadp_isoŲ0.10000.59420.0216494.21 % ↑
7lam7o3atom_siteTiadp_isoŲ0.10000.34250.0291242.51 % ↑
8lam7o3atom_siteO1fract_x0.51000.50700.00210.58 % ↓
9lam7o3atom_siteO1fract_z0.57000.55890.00351.96 % ↓
10lam7o3atom_siteO1adp_isoŲ0.10000.59410.1573494.11 % ↑
11lam7o3atom_siteO2fract_x0.22000.23030.00334.68 % ↑
12lam7o3atom_siteO2fract_y0.03000.03780.002025.89 % ↑
13lam7o3atom_siteO2fract_z0.27000.27940.00293.47 % ↑
14p021linked_structurelam7o3scale0.00000.00000.000027.30 % ↓
15p021peakbroad_gauss_udeg²0.04000.04850.017421.19 % ↑
16p021peakbroad_gauss_vdeg²-0.0100-0.00660.002233.63 % ↓
17p021peakbroad_gauss_wdeg²0.00100.00120.000118.94 % ↑
18p021peakbroad_lorentz_xdeg0.10000.16370.004263.65 % ↑
19p021instrumenttwotheta_offsetdeg0.0000-0.00040.0001N/A
20p021background1intensity584.0282624.05784.45096.85 % ↑
21p021background2intensity616.4344988.25704.816060.32 % ↑
22p021background3intensity608.1060654.06956.67367.56 % ↑
23p021background4intensity594.6323626.97626.43395.44 % ↑
24p021background5intensity574.0299565.56924.43661.47 % ↓
25p021background6intensity457.7247449.19353.80871.86 % ↓
26p021background7intensity443.1398431.17095.71322.70 % ↓
27p021background8intensity433.0140423.06074.34952.30 % ↓
28p021background9intensity432.9268424.77063.60201.88 % ↓
29p021background10intensity421.2970406.99773.18573.39 % ↓
30p021background11intensity444.8967425.45093.20334.37 % ↓
31p021background12intensity453.7668462.34262.37501.89 % ↑
32p021background13intensity346.8399348.68872.38850.53 % ↑
33p021background14intensity357.7145349.48782.16752.30 % ↓
34p021background15intensity302.4308290.91542.28663.81 % ↓
35p021background16intensity278.3155258.71945.56847.04 % ↓
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
• start = parameter value before refinement
• value = refined value from least-squares minimization
• s.u. = standard uncertainty (one sigma), from the covariance matrix
• change = relative change from start, in %; ↑ = increase, ↓ = decrease
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.fit.results()" ] }, { "cell_type": "code", "execution_count": 32, "id": "56", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:10.848659Z", "iopub.status.busy": "2026-08-18T18:22:10.847979Z", "iopub.status.idle": "2026-08-18T18:22:10.881946Z", "shell.execute_reply": "2026-08-18T18:22:10.881010Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
Loading plot…
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.fit.correlations(max_parameters=5)" ] }, { "cell_type": "markdown", "id": "57", "metadata": {}, "source": [ "#### Display Pattern (After Initial Fit)\n", "\n", "Inspect the full fitted pattern and the nonuniform low-angle\n", "background region." ] }, { "cell_type": "code", "execution_count": 33, "id": "58", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:10.883659Z", "iopub.status.busy": "2026-08-18T18:22:10.883486Z", "iopub.status.idle": "2026-08-18T18:22:10.973637Z", "shell.execute_reply": "2026-08-18T18:22:10.972570Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021')" ] }, { "cell_type": "code", "execution_count": 34, "id": "59", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:10.975839Z", "iopub.status.busy": "2026-08-18T18:22:10.975150Z", "iopub.status.idle": "2026-08-18T18:22:11.092323Z", "shell.execute_reply": "2026-08-18T18:22:11.091835Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021', x_min=2.2, x_max=4.0)" ] }, { "cell_type": "markdown", "id": "60", "metadata": {}, "source": [ "### Improve Background Estimate\n", "\n", "With a fitted peak model available, repeat automatic estimation using\n", "the calculated peak contribution. This replaces the original points\n", "with a model-guided estimate. Replacement points are fixed by default,\n", "so mark their intensities free again." ] }, { "cell_type": "code", "execution_count": 35, "id": "61", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:11.095098Z", "iopub.status.busy": "2026-08-18T18:22:11.094414Z", "iopub.status.idle": "2026-08-18T18:22:11.130623Z", "shell.execute_reply": "2026-08-18T18:22:11.129505Z" } }, "outputs": [], "source": [ "experiment.background.auto_estimate(use_model=True)" ] }, { "cell_type": "code", "execution_count": 36, "id": "62", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:11.132761Z", "iopub.status.busy": "2026-08-18T18:22:11.132071Z", "iopub.status.idle": "2026-08-18T18:22:11.142310Z", "shell.execute_reply": "2026-08-18T18:22:11.141379Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mLine-segment background points\u001b[0m\n" ] }, { "data": { "text/html": [ "
PositionIntensity
12.00330576.07930
22.17160638.44269
32.23470662.65186
42.29780695.09265
52.40300752.13934
62.75000948.88708
72.79210960.58868
82.83410967.29542
92.87620968.71605
102.91820964.86104
112.97080953.16247
123.14960876.76893
133.32840781.24539
143.49660699.51489
153.64390640.61808
163.72800601.48366
173.81210556.51417
184.03300428.78047
194.08550400.97938
204.14860371.19048
214.21170346.60070
224.26430331.07531
234.43260318.49330
244.50620328.33475
254.77960400.14924
264.94790435.19050
275.02150440.50098
285.46320422.43300
295.82070425.38983
306.08360420.22464
316.43070417.57909
326.78820410.64869
337.40870409.16031
347.75570427.93405
357.86090433.58138
368.17640441.57902
378.33410442.13621
388.97560435.40766
399.97460432.32693
4010.38480396.20254
4110.85800351.40050
4211.69930347.23352
4311.85700347.83931
4412.53010340.09138
4514.24420301.93226
4614.99090260.58927
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "experiment.background.show()" ] }, { "cell_type": "code", "execution_count": 37, "id": "63", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:11.144320Z", "iopub.status.busy": "2026-08-18T18:22:11.143673Z", "iopub.status.idle": "2026-08-18T18:22:11.149180Z", "shell.execute_reply": "2026-08-18T18:22:11.148283Z" } }, "outputs": [], "source": [ "for point in experiment.background:\n", " point.intensity.free = True" ] }, { "cell_type": "markdown", "id": "64", "metadata": {}, "source": [ "#### Run Fitting" ] }, { "cell_type": "code", "execution_count": 38, "id": "65", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:22:11.150807Z", "iopub.status.busy": "2026-08-18T18:22:11.150644Z", "iopub.status.idle": "2026-08-18T18:24:59.120945Z", "shell.execute_reply": "2026-08-18T18:24:59.120479Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-a12c82e970ca46a1977d9c0e98ff0d60-button');\n", " const status = document.getElementById('ed-fit-stop-a12c82e970ca46a1977d9c0e98ff0d60-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'p021'\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.702.77
2165.872.77
32711.072.77
44016.182.77
55821.452.77
66924.430.1694.1% ↓
78729.550.16
810634.600.16
912039.870.16
1013245.450.16
1114450.930.16
1215656.180.16
1316761.280.16
1417966.430.16
1518971.570.16
1620277.120.16
1721482.700.16
1822688.390.16
1923893.650.16
2025199.510.16
21263104.630.16
22275110.100.16
23288115.820.16
24300121.440.16
25312126.510.16
26324131.850.16
27336137.060.16
28348142.160.16
29359147.170.16
30371152.230.16
31387157.310.16
32400167.860.16
" ], "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;36m0.16\u001b[0m at iteration \u001b[1;36m399\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "✅ Fitting complete.\n" ] } ], "source": [ "project.analysis.fit()" ] }, { "cell_type": "code", "execution_count": 39, "id": "66", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:24:59.122932Z", "iopub.status.busy": "2026-08-18T18:24:59.122763Z", "iopub.status.idle": "2026-08-18T18:25:00.505278Z", "shell.execute_reply": "2026-08-18T18:25:00.504502Z" } }, "outputs": [ { "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 (leastsq)
2✅ Overall statussuccess
3⏱️ Fitting time (seconds)167.86
4🔁 Iterations397
5📏 Goodness-of-fit (reduced χ²)0.16
6📏 R-factor (Rf, %)1.01
7📏 R-factor squared (Rf², %)1.61
8📏 Weighted R-factor (wR, %)1.48
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "📈 Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1lam7o3celllength_aÅ5.46235.46220.00010.00 % ↓
2lam7o3celllength_bÅ7.73327.73310.00020.00 % ↓
3lam7o3celllength_cÅ5.49035.49020.00010.00 % ↓
4lam7o3atom_siteLafract_x0.47660.47670.00010.03 % ↑
5lam7o3atom_siteLafract_z0.00530.00450.000315.23 % ↓
6lam7o3atom_siteLaadp_isoŲ0.59420.62600.00955.35 % ↑
7lam7o3atom_siteTiadp_isoŲ0.34250.33760.01261.44 % ↓
8lam7o3atom_siteO1fract_x0.50700.50830.00100.25 % ↑
9lam7o3atom_siteO1fract_z0.55890.57080.00162.14 % ↑
10lam7o3atom_siteO1adp_isoŲ0.59410.35830.065439.69 % ↓
11lam7o3atom_siteO2fract_x0.23030.22180.00143.71 % ↓
12lam7o3atom_siteO2fract_y0.03780.03400.00099.90 % ↓
13lam7o3atom_siteO2fract_z0.27940.27480.00141.63 % ↓
14p021linked_structurelam7o3scale0.00000.00000.00000.49 % ↑
15p021peakbroad_gauss_udeg²0.04850.05130.00755.81 % ↑
16p021peakbroad_gauss_vdeg²-0.0066-0.00760.001015.15 % ↑
17p021peakbroad_gauss_wdeg²0.00120.00120.00002.99 % ↑
18p021peakbroad_lorentz_xdeg0.16370.16690.00252.00 % ↑
19p021instrumenttwotheta_offsetdeg-0.0004-0.00050.000125.23 % ↑
20p021background1intensity576.0793583.70574.45971.32 % ↑
21p021background2intensity638.4427637.01384.14540.22 % ↓
22p021background3intensity662.6519661.44465.36490.18 % ↓
23p021background4intensity695.0927691.52214.80340.51 % ↓
24p021background5intensity752.1393751.66933.34330.06 % ↓
25p021background6intensity948.8871967.42763.86521.95 % ↑
26p021background7intensity960.5887968.74707.83770.85 % ↑
27p021background8intensity967.2954981.17938.04171.44 % ↑
28p021background9intensity968.7160991.68448.05662.37 % ↑
29p021background10intensity964.8610978.21617.51241.38 % ↑
30p021background11intensity953.1625961.77015.22630.90 % ↑
31p021background12intensity876.7689877.84444.05260.12 % ↑
32p021background13intensity781.2454775.42853.70770.74 % ↓
33p021background14intensity699.5149689.00553.77401.50 % ↓
34p021background15intensity640.6181649.75814.06861.43 % ↑
35p021background16intensity601.4837615.52744.52302.33 % ↑
36p021background17intensity556.5142597.08303.48727.29 % ↑
37p021background18intensity428.7805551.27163.584728.57 % ↑
38p021background19intensity400.9794548.17565.236636.71 % ↑
39p021background20intensity371.1905583.10605.308057.09 % ↑
40p021background21intensity346.6007514.87135.491148.55 % ↑
41p021background22intensity331.0753523.42317.009758.10 % ↑
42p021background23intensity318.4933508.06454.987159.52 % ↑
43p021background24intensity328.3347497.33373.159451.47 % ↑
44p021background25intensity400.1492467.07312.651616.72 % ↑
45p021background26intensity435.1905452.41493.28563.96 % ↑
46p021background27intensity440.5010438.91082.54400.36 % ↓
47p021background28intensity422.4330420.92192.06070.36 % ↓
48p021background29intensity425.3898426.85012.12980.34 % ↑
49p021background30intensity420.2246418.44492.88490.42 % ↓
50p021background31intensity417.5791417.36512.00050.05 % ↓
51p021background32intensity410.6487411.70421.86680.26 % ↑
52p021background33intensity409.1603410.51872.04240.33 % ↑
53p021background34intensity427.9340431.23672.56060.77 % ↑
54p021background35intensity433.5814435.47822.56490.44 % ↑
55p021background36intensity441.5790441.40292.41320.04 % ↓
56p021background37intensity442.1362440.35731.91730.40 % ↓
57p021background38intensity435.4077436.79171.46360.32 % ↑
58p021background39intensity432.3269440.69091.60171.93 % ↑
59p021background40intensity396.2025399.27621.77050.78 % ↑
60p021background41intensity351.4005345.25371.46771.75 % ↓
61p021background42intensity347.2335344.89561.80530.67 % ↓
62p021background43intensity347.8393350.58741.61630.79 % ↑
63p021background44intensity340.0914339.50411.13390.17 % ↓
64p021background45intensity301.9323302.41851.09530.16 % ↑
65p021background46intensity260.5893273.93541.51485.12 % ↑
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
• start = parameter value before refinement
• value = refined value from least-squares minimization
• s.u. = standard uncertainty (one sigma), from the covariance matrix
• change = relative change from start, in %; ↑ = increase, ↓ = decrease
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.fit.results()" ] }, { "cell_type": "code", "execution_count": 40, "id": "67", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:25:00.506966Z", "iopub.status.busy": "2026-08-18T18:25:00.506779Z", "iopub.status.idle": "2026-08-18T18:25:00.541892Z", "shell.execute_reply": "2026-08-18T18:25:00.541172Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
Loading plot…
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.fit.correlations(max_parameters=5)" ] }, { "cell_type": "markdown", "id": "68", "metadata": {}, "source": [ "#### Display Pattern (After Final Fit)" ] }, { "cell_type": "code", "execution_count": 41, "id": "69", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:25:00.543725Z", "iopub.status.busy": "2026-08-18T18:25:00.543568Z", "iopub.status.idle": "2026-08-18T18:25:00.700470Z", "shell.execute_reply": "2026-08-18T18:25:00.699309Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021')" ] }, { "cell_type": "code", "execution_count": 42, "id": "70", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:25:00.702060Z", "iopub.status.busy": "2026-08-18T18:25:00.701880Z", "iopub.status.idle": "2026-08-18T18:25:00.916667Z", "shell.execute_reply": "2026-08-18T18:25:00.914301Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='p021', x_min=2.2, x_max=4.0)" ] }, { "cell_type": "markdown", "id": "71", "metadata": {}, "source": [ "## 📊 Report\n", "\n", "The HTML report is written automatically when the project is saved.\n", "PDF generation can be enabled before the final save when required." ] }, { "cell_type": "code", "execution_count": 43, "id": "72", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:25:00.919843Z", "iopub.status.busy": "2026-08-18T18:25:00.919665Z", "iopub.status.idle": "2026-08-18T18:25:00.923725Z", "shell.execute_reply": "2026-08-18T18:25:00.922484Z" } }, "outputs": [], "source": [ "# Enable PDF report generation before the last save (time consuming)\n", "# project.report.pdf = True" ] }, { "cell_type": "markdown", "id": "73", "metadata": {}, "source": [ "## 💾 Save Project" ] }, { "cell_type": "code", "execution_count": 44, "id": "74", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:25:00.927620Z", "iopub.status.busy": "2026-08-18T18:25:00.927430Z", "iopub.status.idle": "2026-08-18T18:25:01.453765Z", "shell.execute_reply": "2026-08-18T18:25:01.451258Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project 📦 \u001b[0m\u001b[32m'lam7o3_p021'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-lam7o3-p021'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "├── 📄 project.edi\n", "├── 📁 structures/\n", "│ └── 📄 lam7o3.edi\n", "├── 📁 experiments/\n", "│ └── 📄 p021.edi\n", "├── 📁 analysis/\n", "│ └── 📄 analysis.edi\n", "└── 📁 reports/\n", " └── 📄 lam7o3_p021.html\n" ] } ], "source": [ "project.save()" ] }, { "cell_type": "code", "execution_count": null, "id": "75", "metadata": {}, "outputs": [], "source": [] } ], "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.6" } }, "nbformat": 4, "nbformat_minor": 5 }