{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:04.620508Z", "iopub.status.busy": "2026-06-30T22:39:04.620317Z", "iopub.status.idle": "2026-06-30T22:39:04.624601Z", "shell.execute_reply": "2026-06-30T22:39:04.623776Z" }, "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.19.1" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Structure Refinement: Tb2TiO7, HEiDi\n", "\n", "Crystal structure refinement of Tb2TiO7 using single crystal neutron\n", "diffraction data from HEiDi at FRM II." ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "## πŸ› οΈ Import Library" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:04.625931Z", "iopub.status.busy": "2026-06-30T22:39:04.625784Z", "iopub.status.idle": "2026-06-30T22:39:07.510724Z", "shell.execute_reply": "2026-06-30T22:39:07.509688Z" } }, "outputs": [], "source": [ "import easydiffraction as edi" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## πŸ“¦ Define Project" ] }, { "cell_type": "code", "execution_count": 3, "id": "5", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.512545Z", "iopub.status.busy": "2026-06-30T22:39:07.512257Z", "iopub.status.idle": "2026-06-30T22:39:07.782364Z", "shell.execute_reply": "2026-06-30T22:39:07.781458Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'tbti_heidi'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-tbti-heidi'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“„ project.edi\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.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "└── πŸ“ reports/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ tbti_heidi.html\n" ] } ], "source": [ "# Create a minimal project with a short name\n", "project = edi.Project(name='tbti_heidi')\n", "project.metadata.title = 'Tb2Ti2O7 at HEiDi@FRMII'\n", "project.metadata.description = \"\"\"This project demonstrates a standard\n", "refinement of the crystal structure of Tb2Ti2O7 using single crystal \n", "neutron diffraction data from HEiDi at FRM II.\"\"\"\n", "\n", "project.save_as(dir_path='projects/refine-tbti-heidi')" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "## 🧩 Define Structure" ] }, { "cell_type": "code", "execution_count": 4, "id": "7", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.783885Z", "iopub.status.busy": "2026-06-30T22:39:07.783729Z", "iopub.status.idle": "2026-06-30T22:39:07.932593Z", "shell.execute_reply": "2026-06-30T22:39:07.931921Z" } }, "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'struct-tbti'\u001b[0m: Tb2Ti2O7 \u001b[1m(\u001b[0mcrystal structure\u001b[1m)\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βœ… Data \u001b[32m'struct-tbti'\u001b[0m downloaded to \u001b[32m'../../../data/struct-tbti.cif'\u001b[0m\n" ] } ], "source": [ "# Download CIF file from repository\n", "structure_path = edi.download_data('struct-tbti', destination='data')" ] }, { "cell_type": "code", "execution_count": 5, "id": "8", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.938129Z", "iopub.status.busy": "2026-06-30T22:39:07.937868Z", "iopub.status.idle": "2026-06-30T22:39:07.964218Z", "shell.execute_reply": "2026-06-30T22:39:07.962921Z" } }, "outputs": [], "source": [ "project.structures.add_from_cif_path(structure_path)" ] }, { "cell_type": "code", "execution_count": 6, "id": "9", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.966523Z", "iopub.status.busy": "2026-06-30T22:39:07.965811Z", "iopub.status.idle": "2026-06-30T22:39:07.976491Z", "shell.execute_reply": "2026-06-30T22:39:07.975512Z" } }, "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'tbti'\u001b[0m\u001b[1m]\u001b[0m\n" ] } ], "source": [ "project.structures.show_names()" ] }, { "cell_type": "code", "execution_count": 7, "id": "10", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.978145Z", "iopub.status.busy": "2026-06-30T22:39:07.977943Z", "iopub.status.idle": "2026-06-30T22:39:07.983322Z", "shell.execute_reply": "2026-06-30T22:39:07.982874Z" } }, "outputs": [], "source": [ "structure = project.structures['tbti']" ] }, { "cell_type": "code", "execution_count": 8, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:07.985446Z", "iopub.status.busy": "2026-06-30T22:39:07.985158Z", "iopub.status.idle": "2026-06-30T22:39:08.056746Z", "shell.execute_reply": "2026-06-30T22:39:08.055518Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\u001b[0m\u001b[1;36m as text\u001b[0m\n" ] }, { "data": { "text/html": [ "
Edi
1data_tbti
2
3_cell.length_a 10.13
4_cell.length_b 10.13
5_cell.length_c 10.13
6_cell.angle_alpha 90.
7_cell.angle_beta 90.
8_cell.angle_gamma 90.
9
10_space_group.name_h_m "F d -3 m"
11_space_group.coord_system_code 2
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
27Tb Tb 0.5 0.5 0.5 d 16 1. 0.530(20) Biso
28Ti Ti 0. 0. 0. c 16 1. 0.480(30) Biso
29O1 O 0.328040(90) 0.125 0.125 f 48 1.000(10) 0.450(20) Biso
30O2 O 0.375 0.375 0.375 b 8 0.970(20) 0.230(40) Biso
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "structure.show_as_text()" ] }, { "cell_type": "code", "execution_count": 9, "id": "12", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.058668Z", "iopub.status.busy": "2026-06-30T22:39:08.058452Z", "iopub.status.idle": "2026-06-30T22:39:08.063126Z", "shell.execute_reply": "2026-06-30T22:39:08.062240Z" } }, "outputs": [], "source": [ "structure.atom_sites['Tb'].adp_type = 'Uiso'\n", "structure.atom_sites['Ti'].adp_type = 'Uiso'\n", "structure.atom_sites['O1'].adp_type = 'Uiso'\n", "structure.atom_sites['O2'].adp_type = 'Uiso'" ] }, { "cell_type": "code", "execution_count": 10, "id": "13", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.065507Z", "iopub.status.busy": "2026-06-30T22:39:08.065283Z", "iopub.status.idle": "2026-06-30T22:39:08.069981Z", "shell.execute_reply": "2026-06-30T22:39:08.069112Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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.wyckoff_letter\n", "_atom_site.multiplicity\n", "_atom_site.occupancy\n", "_atom_site.adp_iso\n", "_atom_site.adp_type\n", "Tb Tb 0.5 0.5 0.5 d 16 1. 0.007(20) Uiso\n", "Ti Ti 0. 0. 0. c 16 1. 0.006(30) Uiso\n", "O1 O 0.328040(90) 0.125 0.125 f 48 1.000(10) 0.006(20) Uiso\n", "O2 O 0.375 0.375 0.375 b 8 0.970(20) 0.003(40) Uiso\n" ] } ], "source": [ "print(structure.atom_sites.as_cif)" ] }, { "cell_type": "code", "execution_count": 11, "id": "14", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.071973Z", "iopub.status.busy": "2026-06-30T22:39:08.071771Z", "iopub.status.idle": "2026-06-30T22:39:08.077317Z", "shell.execute_reply": "2026-06-30T22:39:08.075922Z" } }, "outputs": [], "source": [ "structure.atom_sites['Tb'].adp_iso = 0.0\n", "structure.atom_sites['Ti'].adp_iso = 0.0\n", "structure.atom_sites['O1'].adp_iso = 0.0\n", "structure.atom_sites['O2'].adp_iso = 0.0" ] }, { "cell_type": "markdown", "id": "15", "metadata": {}, "source": [ "### Display Structure (ADP)\n", "\n", "Select the ADP atom view. With the starting isotropic displacements every\n", "atom is drawn as a sphere; after the anisotropic refinement below, the same\n", "view will draw probability ellipsoids for the anisotropic sites." ] }, { "cell_type": "code", "execution_count": 12, "id": "16", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.078854Z", "iopub.status.busy": "2026-06-30T22:39:08.078687Z", "iopub.status.idle": "2026-06-30T22:39:08.081986Z", "shell.execute_reply": "2026-06-30T22:39:08.081241Z" } }, "outputs": [], "source": [ "project.structure_style.atom_view = 'adp'" ] }, { "cell_type": "code", "execution_count": 13, "id": "17", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.083474Z", "iopub.status.busy": "2026-06-30T22:39:08.083324Z", "iopub.status.idle": "2026-06-30T22:39:08.199609Z", "shell.execute_reply": "2026-06-30T22:39:08.199119Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\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='tbti')" ] }, { "cell_type": "markdown", "id": "18", "metadata": {}, "source": [ "## πŸ”¬ Define Experiment" ] }, { "cell_type": "code", "execution_count": 14, "id": "19", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.202208Z", "iopub.status.busy": "2026-06-30T22:39:08.202021Z", "iopub.status.idle": "2026-06-30T22:39:08.322209Z", "shell.execute_reply": "2026-06-30T22:39:08.321254Z" } }, "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-tbti-heidi'\u001b[0m: Tb2Ti2O7, HEiDi \u001b[1m(\u001b[0mMLZ\u001b[1m)\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βœ… Data \u001b[32m'meas-tbti-heidi'\u001b[0m downloaded to \u001b[32m'../../../data/meas-tbti-heidi.xye'\u001b[0m\n" ] } ], "source": [ "# Download data file from repository\n", "data_path = edi.download_data('meas-tbti-heidi', destination='data')" ] }, { "cell_type": "code", "execution_count": 15, "id": "20", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.323977Z", "iopub.status.busy": "2026-06-30T22:39:08.323753Z", "iopub.status.idle": "2026-06-30T22:39:08.446994Z", "shell.execute_reply": "2026-06-30T22:39:08.446290Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mData loaded successfully\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Experiment πŸ”¬ \u001b[32m'heidi'\u001b[0m. Number of data points: \u001b[1;36m220\u001b[0m.\n" ] } ], "source": [ "project.experiments.add_from_data_path(\n", " name='heidi',\n", " data_path=data_path,\n", " sample_form='single crystal',\n", " beam_mode='constant wavelength',\n", " radiation_probe='neutron',\n", ")" ] }, { "cell_type": "code", "execution_count": 16, "id": "21", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.448629Z", "iopub.status.busy": "2026-06-30T22:39:08.448467Z", "iopub.status.idle": "2026-06-30T22:39:08.451052Z", "shell.execute_reply": "2026-06-30T22:39:08.450425Z" } }, "outputs": [], "source": [ "experiment = project.experiments['heidi']" ] }, { "cell_type": "code", "execution_count": 17, "id": "22", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.452479Z", "iopub.status.busy": "2026-06-30T22:39:08.452329Z", "iopub.status.idle": "2026-06-30T22:39:08.455087Z", "shell.execute_reply": "2026-06-30T22:39:08.454425Z" } }, "outputs": [], "source": [ "experiment.linked_structure.structure_id = 'tbti'\n", "experiment.linked_structure.scale = 1.0" ] }, { "cell_type": "code", "execution_count": 18, "id": "23", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.456476Z", "iopub.status.busy": "2026-06-30T22:39:08.456333Z", "iopub.status.idle": "2026-06-30T22:39:08.458964Z", "shell.execute_reply": "2026-06-30T22:39:08.458321Z" } }, "outputs": [], "source": [ "experiment.instrument.setup_wavelength = 0.793" ] }, { "cell_type": "code", "execution_count": 19, "id": "24", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.460355Z", "iopub.status.busy": "2026-06-30T22:39:08.460206Z", "iopub.status.idle": "2026-06-30T22:39:08.462965Z", "shell.execute_reply": "2026-06-30T22:39:08.462316Z" } }, "outputs": [], "source": [ "experiment.extinction.mosaicity = 35000\n", "experiment.extinction.radius = 10" ] }, { "cell_type": "markdown", "id": "25", "metadata": {}, "source": [ "## πŸš€ Perform Analysis" ] }, { "cell_type": "markdown", "id": "26", "metadata": {}, "source": [ "### ADP iso" ] }, { "cell_type": "code", "execution_count": 20, "id": "27", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.464314Z", "iopub.status.busy": "2026-06-30T22:39:08.464172Z", "iopub.status.idle": "2026-06-30T22:39:08.759861Z", "shell.execute_reply": "2026-06-30T22:39:08.758961Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='heidi')" ] }, { "cell_type": "code", "execution_count": 21, "id": "28", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.761483Z", "iopub.status.busy": "2026-06-30T22:39:08.761323Z", "iopub.status.idle": "2026-06-30T22:39:08.764892Z", "shell.execute_reply": "2026-06-30T22:39:08.764206Z" } }, "outputs": [], "source": [ "structure.atom_sites['O1'].fract_x.free = True\n", "\n", "structure.atom_sites['Ti'].occupancy.free = True\n", "structure.atom_sites['O1'].occupancy.free = True\n", "structure.atom_sites['O2'].occupancy.free = True\n", "\n", "structure.atom_sites['Tb'].adp_iso.free = True\n", "structure.atom_sites['Ti'].adp_iso.free = True\n", "structure.atom_sites['O1'].adp_iso.free = True\n", "structure.atom_sites['O2'].adp_iso.free = True" ] }, { "cell_type": "code", "execution_count": 22, "id": "29", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.766560Z", "iopub.status.busy": "2026-06-30T22:39:08.766392Z", "iopub.status.idle": "2026-06-30T22:39:08.769763Z", "shell.execute_reply": "2026-06-30T22:39:08.769007Z" } }, "outputs": [], "source": [ "experiment.linked_structure.scale.free = True\n", "experiment.extinction.radius.free = True" ] }, { "cell_type": "code", "execution_count": 23, "id": "30", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:08.771388Z", "iopub.status.busy": "2026-06-30T22:39:08.771230Z", "iopub.status.idle": "2026-06-30T22:39:09.915406Z", "shell.execute_reply": "2026-06-30T22:39:09.914403Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-d50be21371004f919fc054a62aa6ba08-button');\n", " const status = document.getElementById('ed-fit-stop-d50be21371004f919fc054a62aa6ba08-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'heidi'\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.01355.79
2140.14186.4147.6% ↓
3250.2542.2877.3% ↓
4360.3512.9769.3% ↓
5470.4512.751.6% ↓
6810.7812.75
" ], "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;36m12.75\u001b[0m at iteration \u001b[1;36m80\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'tbti_heidi'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-tbti-heidi'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“„ project.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ structures/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ tbti.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ heidi.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ analysis/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ analysis.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "└── πŸ“ reports/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ tbti_heidi.html\n" ] } ], "source": [ "# Start refinement. All parameters, which have standard uncertainties\n", "# in the input CIF files, are refined by default.\n", "project.analysis.fit()" ] }, { "cell_type": "code", "execution_count": 24, "id": "31", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:09.917340Z", "iopub.status.busy": "2026-06-30T22:39:09.916981Z", "iopub.status.idle": "2026-06-30T22:39:10.218623Z", "shell.execute_reply": "2026-06-30T22:39:10.217763Z" } }, "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)0.78
4πŸ” Iterations78
5πŸ“ Goodness-of-fit (reduced χ²)12.75
6πŸ“ R-factor (Rf, %)7.65
7πŸ“ R-factor squared (RfΒ², %)8.10
8πŸ“ Weighted R-factor (wR, %)8.59
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1tbtiatom_siteTbadp_isoΓ…Β²0.00000.00680.0003N/A
2tbtiatom_siteTioccupancy1.00000.97300.01782.70 % ↓
3tbtiatom_siteTiadp_isoΓ…Β²0.00000.00540.0006N/A
4tbtiatom_siteO1fract_x0.32800.32800.00010.00 % ↑
5tbtiatom_siteO1occupancy1.00000.99890.01040.11 % ↓
6tbtiatom_siteO1adp_isoΓ…Β²0.00000.00570.0002N/A
7tbtiatom_siteO2occupancy0.97000.96880.01830.12 % ↓
8tbtiatom_siteO2adp_isoΓ…Β²0.00000.00300.0005N/A
9heidiextinctionradiusΞΌm10.000026.43481.0122164.35 % ↑
10heidilinked_structurescale1.00002.93290.0586193.29 % ↑
" ], "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": [ "# Show fit results summary\n", "project.display.fit.results()" ] }, { "cell_type": "code", "execution_count": 25, "id": "32", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.220283Z", "iopub.status.busy": "2026-06-30T22:39:10.220040Z", "iopub.status.idle": "2026-06-30T22:39:10.229865Z", "shell.execute_reply": "2026-06-30T22:39:10.229062Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\u001b[0m\u001b[1;36m as text\u001b[0m\n" ] }, { "data": { "text/html": [ "
Edi
1data_tbti
2
3_cell.length_a 10.13
4_cell.length_b 10.13
5_cell.length_c 10.13
6_cell.angle_alpha 90.
7_cell.angle_beta 90.
8_cell.angle_gamma 90.
9
10_space_group.name_h_m "F d -3 m"
11_space_group.coord_system_code 2
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
27Tb Tb 0.5 0.5 0.5 d 16 1. 0.00682(29) Uiso
28Ti Ti 0. 0. 0. c 16 0.973(18) 0.00540(60) Uiso
29O1 O 0.328044(94) 0.125 0.125 f 48 0.999(10) 0.00573(25) Uiso
30O2 O 0.375 0.375 0.375 b 8 0.969(18) 0.00303(48) Uiso
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "structure.show_as_text()" ] }, { "cell_type": "code", "execution_count": 26, "id": "33", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.231390Z", "iopub.status.busy": "2026-06-30T22:39:10.231227Z", "iopub.status.idle": "2026-06-30T22:39:10.296372Z", "shell.execute_reply": "2026-06-30T22:39:10.295407Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\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='tbti')" ] }, { "cell_type": "code", "execution_count": 27, "id": "34", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.298061Z", "iopub.status.busy": "2026-06-30T22:39:10.297877Z", "iopub.status.idle": "2026-06-30T22:39:10.302399Z", "shell.execute_reply": "2026-06-30T22:39:10.301592Z" } }, "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'heidi'\u001b[0m\u001b[1m]\u001b[0m\n" ] } ], "source": [ "project.experiments.show_names()" ] }, { "cell_type": "code", "execution_count": 28, "id": "35", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.304086Z", "iopub.status.busy": "2026-06-30T22:39:10.303917Z", "iopub.status.idle": "2026-06-30T22:39:10.319780Z", "shell.execute_reply": "2026-06-30T22:39:10.319144Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='heidi')" ] }, { "cell_type": "markdown", "id": "36", "metadata": {}, "source": [ "### ADP aniso" ] }, { "cell_type": "code", "execution_count": 29, "id": "37", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.321694Z", "iopub.status.busy": "2026-06-30T22:39:10.321522Z", "iopub.status.idle": "2026-06-30T22:39:10.326964Z", "shell.execute_reply": "2026-06-30T22:39:10.326144Z" } }, "outputs": [], "source": [ "structure.atom_sites['Tb'].adp_type = 'Uani'\n", "structure.atom_sites['Ti'].adp_type = 'Uani'\n", "structure.atom_sites['O1'].adp_type = 'Uani'\n", "# structure.atom_sites['O2'].adp_type = 'Uani'" ] }, { "cell_type": "code", "execution_count": 30, "id": "38", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.328716Z", "iopub.status.busy": "2026-06-30T22:39:10.328557Z", "iopub.status.idle": "2026-06-30T22:39:10.331918Z", "shell.execute_reply": "2026-06-30T22:39:10.331200Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "loop_\n", "_atom_site_aniso.id\n", "_atom_site_aniso.adp_11\n", "_atom_site_aniso.adp_22\n", "_atom_site_aniso.adp_33\n", "_atom_site_aniso.adp_12\n", "_atom_site_aniso.adp_13\n", "_atom_site_aniso.adp_23\n", "Tb 0.00681683 0.00681683 0.00681683 0. 0. 0.\n", "Ti 0.00539742 0.00539742 0.00539742 0. 0. 0.\n", "O1 0.00572628 0.00572628 0.00572628 0. 0. 0.\n" ] } ], "source": [ "print(structure.atom_site_aniso.as_cif)" ] }, { "cell_type": "code", "execution_count": 31, "id": "39", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.334153Z", "iopub.status.busy": "2026-06-30T22:39:10.333973Z", "iopub.status.idle": "2026-06-30T22:39:10.337433Z", "shell.execute_reply": "2026-06-30T22:39:10.336738Z" } }, "outputs": [], "source": [ "structure.atom_site_aniso['Tb'].adp_11.free = True\n", "structure.atom_site_aniso['Tb'].adp_12.free = True\n", "structure.atom_site_aniso['Ti'].adp_11.free = True\n", "structure.atom_site_aniso['Ti'].adp_12.free = True\n", "structure.atom_site_aniso['O1'].adp_11.free = True\n", "structure.atom_site_aniso['O1'].adp_22.free = True\n", "structure.atom_site_aniso['O1'].adp_23.free = True\n", "# structure.atom_site_aniso['O2'].adp_11.free = True" ] }, { "cell_type": "code", "execution_count": 32, "id": "40", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:10.339332Z", "iopub.status.busy": "2026-06-30T22:39:10.339079Z", "iopub.status.idle": "2026-06-30T22:39:13.399428Z", "shell.execute_reply": "2026-06-30T22:39:13.398500Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-c26d39ffd386412588d0f2f557868cff-button');\n", " const status = document.getElementById('ed-fit-stop-c26d39ffd386412588d0f2f557868cff-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'heidi'\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.2813.00
2180.783.0276.8% ↓
3331.222.942.5% ↓
4792.672.94
" ], "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.94\u001b[0m at iteration \u001b[1;36m78\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'tbti_heidi'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-tbti-heidi'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“„ project.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ structures/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ tbti.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ heidi.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ analysis/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ analysis.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "└── πŸ“ reports/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ tbti_heidi.html\n" ] } ], "source": [ "project.analysis.fit()" ] }, { "cell_type": "code", "execution_count": 33, "id": "41", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.401350Z", "iopub.status.busy": "2026-06-30T22:39:13.401043Z", "iopub.status.idle": "2026-06-30T22:39:13.729736Z", "shell.execute_reply": "2026-06-30T22:39:13.729020Z" } }, "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)2.67
4πŸ” Iterations76
5πŸ“ Goodness-of-fit (reduced χ²)2.94
6πŸ“ R-factor (Rf, %)4.21
7πŸ“ R-factor squared (RfΒ², %)6.61
8πŸ“ Weighted R-factor (wR, %)13.29
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "πŸ“ˆ Refined parameters:\n" ] }, { "data": { "text/html": [ "
datablockcategoryentryparameterunitsstartvalues.u.change
1tbtiatom_siteTioccupancy0.97300.96610.00850.71 % ↓
2tbtiatom_siteO1fract_x0.32800.32800.00000.01 % ↓
3tbtiatom_siteO1occupancy0.99890.99400.00500.50 % ↓
4tbtiatom_siteO2occupancy0.96880.97180.00880.31 % ↑
5tbtiatom_siteO2adp_isoΓ…Β²0.00300.00330.00027.87 % ↑
6tbtiatom_site_anisoTbadp_11Γ…Β²0.00680.00660.00013.45 % ↓
7tbtiatom_site_anisoTbadp_12Γ…Β²0.0000-0.00230.0001N/A
8tbtiatom_site_anisoTiadp_11Γ…Β²0.00540.00490.00039.56 % ↓
9tbtiatom_site_anisoTiadp_12Γ…Β²0.0000-0.00050.0002N/A
10tbtiatom_site_anisoO1adp_11Γ…Β²0.00570.00670.000217.67 % ↑
11tbtiatom_site_anisoO1adp_22Γ…Β²0.00570.00490.000114.61 % ↓
12tbtiatom_site_anisoO1adp_23Γ…Β²0.00000.00190.0001N/A
13heidiextinctionradiusΞΌm26.434824.83170.49316.06 % ↓
14heidilinked_structurescale2.93292.87440.02741.99 % ↓
" ], "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": 34, "id": "42", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.731287Z", "iopub.status.busy": "2026-06-30T22:39:13.731124Z", "iopub.status.idle": "2026-06-30T22:39:13.754855Z", "shell.execute_reply": "2026-06-30T22:39:13.754144Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "
\n", "
Loading plot…
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.fit.correlations()" ] }, { "cell_type": "code", "execution_count": 35, "id": "43", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.756377Z", "iopub.status.busy": "2026-06-30T22:39:13.756211Z", "iopub.status.idle": "2026-06-30T22:39:13.771980Z", "shell.execute_reply": "2026-06-30T22:39:13.770810Z" } }, "outputs": [ { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='heidi')" ] }, { "cell_type": "code", "execution_count": 36, "id": "44", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.773776Z", "iopub.status.busy": "2026-06-30T22:39:13.773552Z", "iopub.status.idle": "2026-06-30T22:39:13.783281Z", "shell.execute_reply": "2026-06-30T22:39:13.782474Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\u001b[0m\u001b[1;36m as text\u001b[0m\n" ] }, { "data": { "text/html": [ "
Edi
1data_tbti
2
3_cell.length_a 10.13
4_cell.length_b 10.13
5_cell.length_c 10.13
6_cell.angle_alpha 90.
7_cell.angle_beta 90.
8_cell.angle_gamma 90.
9
10_space_group.name_h_m "F d -3 m"
11_space_group.coord_system_code 2
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
27Tb Tb 0.5 0.5 0.5 d 16 1. 0.00658189 Uani
28Ti Ti 0. 0. 0. c 16 0.9661(85) 0.00488144 Uani
29O1 O 0.327996(47) 0.125 0.125 f 48 0.9940(50) 0.00550586 Uani
30O2 O 0.375 0.375 0.375 b 8 0.9718(88) 0.00327(24) Uiso
31
32loop_
33_atom_site_aniso.id
34_atom_site_aniso.adp_11
35_atom_site_aniso.adp_22
36_atom_site_aniso.adp_33
37_atom_site_aniso.adp_12
38_atom_site_aniso.adp_13
39_atom_site_aniso.adp_23
40Tb 0.00658(14) 0.00658189 0.00658189 -0.00228(11) -0.00228459 -0.00228459
41Ti 0.00488(29) 0.00488144 0.00488144 -0.00048(25) -0.00048176 -0.00048176
42O1 0.00674(18) 0.00489(13) 0.0048898 0. 0. 0.00189(13)
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "structure.show_as_text()" ] }, { "cell_type": "markdown", "id": "45", "metadata": {}, "source": [ "### Display Structure (final)\n", "\n", "Tb, Ti and O1 were refined with anisotropic displacements (`Uani`), so the\n", "ADP view now draws them as probability ellipsoids, while O2 stayed isotropic\n", "(`Uiso`) and remains a sphere β€” highlighting how the view changed from the\n", "initial spheres to ellipsoids." ] }, { "cell_type": "code", "execution_count": 37, "id": "46", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.784898Z", "iopub.status.busy": "2026-06-30T22:39:13.784679Z", "iopub.status.idle": "2026-06-30T22:39:13.875075Z", "shell.execute_reply": "2026-06-30T22:39:13.874088Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'tbti'\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='tbti')" ] }, { "cell_type": "markdown", "id": "47", "metadata": {}, "source": [ "## πŸ“Š Report" ] }, { "cell_type": "code", "execution_count": 38, "id": "48", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:39:13.876700Z", "iopub.status.busy": "2026-06-30T22:39:13.876542Z", "iopub.status.idle": "2026-06-30T22:39:31.879663Z", "shell.execute_reply": "2026-06-30T22:39:31.876499Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'tbti_heidi'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-tbti-heidi'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“„ project.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ structures/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ tbti.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ heidi.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ analysis/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ analysis.edi\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "└── πŸ“ reports/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " β”œβ”€β”€ πŸ“„ tbti_heidi.html\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ tbti_heidi.pdf\n" ] } ], "source": [ "# Enable PDF report generation before the last save (time consuming)\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 }