{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:33.818482Z", "iopub.status.busy": "2026-08-18T18:18:33.818282Z", "iopub.status.idle": "2026-08-18T18:18:33.822350Z", "shell.execute_reply": "2026-08-18T18:18:33.821654Z" }, "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: 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-08-18T18:18:33.824038Z", "iopub.status.busy": "2026-08-18T18:18:33.823879Z", "iopub.status.idle": "2026-08-18T18:18:36.509614Z", "shell.execute_reply": "2026-08-18T18:18:36.508546Z" } }, "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-08-18T18:18:36.511534Z", "iopub.status.busy": "2026-08-18T18:18:36.511214Z", "iopub.status.idle": "2026-08-18T18:18:36.844055Z", "shell.execute_reply": "2026-08-18T18:18:36.843312Z" } }, "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", "β”œβ”€β”€ πŸ“ structures/\n", "β”œβ”€β”€ πŸ“ experiments/\n", "β”œβ”€β”€ πŸ“ analysis/\n", "β”‚ └── πŸ“„ analysis.edi\n", "└── πŸ“ reports/\n", " └── πŸ“„ 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-08-18T18:18:36.845978Z", "iopub.status.busy": "2026-08-18T18:18:36.845807Z", "iopub.status.idle": "2026-08-18T18:18:37.019381Z", "shell.execute_reply": "2026-08-18T18:18:37.018473Z" } }, "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-08-18T18:18:37.021159Z", "iopub.status.busy": "2026-08-18T18:18:37.020887Z", "iopub.status.idle": "2026-08-18T18:18:37.031574Z", "shell.execute_reply": "2026-08-18T18:18:37.030704Z" } }, "outputs": [], "source": [ "project.structures.add_from_cif_path(structure_path)" ] }, { "cell_type": "code", "execution_count": 6, "id": "9", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:37.033399Z", "iopub.status.busy": "2026-08-18T18:18:37.033244Z", "iopub.status.idle": "2026-08-18T18:18:37.037736Z", "shell.execute_reply": "2026-08-18T18:18:37.036945Z" } }, "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-08-18T18:18:37.039355Z", "iopub.status.busy": "2026-08-18T18:18:37.039202Z", "iopub.status.idle": "2026-08-18T18:18:37.041754Z", "shell.execute_reply": "2026-08-18T18:18:37.041057Z" } }, "outputs": [], "source": [ "structure = project.structures['tbti']" ] }, { "cell_type": "code", "execution_count": 8, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:37.043421Z", "iopub.status.busy": "2026-08-18T18:18:37.043268Z", "iopub.status.idle": "2026-08-18T18:18:37.101976Z", "shell.execute_reply": "2026-08-18T18:18:37.100891Z" } }, "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-08-18T18:18:37.103575Z", "iopub.status.busy": "2026-08-18T18:18:37.103382Z", "iopub.status.idle": "2026-08-18T18:18:37.106926Z", "shell.execute_reply": "2026-08-18T18:18:37.106155Z" } }, "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-08-18T18:18:37.108440Z", "iopub.status.busy": "2026-08-18T18:18:37.108286Z", "iopub.status.idle": "2026-08-18T18:18:37.112027Z", "shell.execute_reply": "2026-08-18T18:18:37.110966Z" } }, "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-08-18T18:18:37.113479Z", "iopub.status.busy": "2026-08-18T18:18:37.113297Z", "iopub.status.idle": "2026-08-18T18:18:37.116625Z", "shell.execute_reply": "2026-08-18T18:18:37.115716Z" } }, "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-08-18T18:18:37.118131Z", "iopub.status.busy": "2026-08-18T18:18:37.117972Z", "iopub.status.idle": "2026-08-18T18:18:37.120759Z", "shell.execute_reply": "2026-08-18T18:18:37.119963Z" } }, "outputs": [], "source": [ "project.structure_style.atom_view = 'adp'" ] }, { "cell_type": "code", "execution_count": 13, "id": "17", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:37.122343Z", "iopub.status.busy": "2026-08-18T18:18:37.122133Z", "iopub.status.idle": "2026-08-18T18:18:37.245156Z", "shell.execute_reply": "2026-08-18T18:18:37.244236Z" } }, "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-08-18T18:18:37.246936Z", "iopub.status.busy": "2026-08-18T18:18:37.246743Z", "iopub.status.idle": "2026-08-18T18:18:37.418341Z", "shell.execute_reply": "2026-08-18T18:18:37.417444Z" } }, "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-08-18T18:18:37.420113Z", "iopub.status.busy": "2026-08-18T18:18:37.419889Z", "iopub.status.idle": "2026-08-18T18:18:37.529159Z", "shell.execute_reply": "2026-08-18T18:18:37.528729Z" } }, "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-08-18T18:18:37.531979Z", "iopub.status.busy": "2026-08-18T18:18:37.531814Z", "iopub.status.idle": "2026-08-18T18:18:37.536578Z", "shell.execute_reply": "2026-08-18T18:18:37.536169Z" } }, "outputs": [], "source": [ "experiment = project.experiments['heidi']" ] }, { "cell_type": "code", "execution_count": 17, "id": "22", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:37.540738Z", "iopub.status.busy": "2026-08-18T18:18:37.540587Z", "iopub.status.idle": "2026-08-18T18:18:37.543212Z", "shell.execute_reply": "2026-08-18T18:18:37.542637Z" } }, "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-08-18T18:18:37.544497Z", "iopub.status.busy": "2026-08-18T18:18:37.544330Z", "iopub.status.idle": "2026-08-18T18:18:37.546925Z", "shell.execute_reply": "2026-08-18T18:18:37.546289Z" } }, "outputs": [], "source": [ "experiment.instrument.setup_wavelength = 0.793" ] }, { "cell_type": "code", "execution_count": 19, "id": "24", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:37.548337Z", "iopub.status.busy": "2026-08-18T18:18:37.548179Z", "iopub.status.idle": "2026-08-18T18:18:37.551126Z", "shell.execute_reply": "2026-08-18T18:18:37.550303Z" } }, "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-08-18T18:18:37.552992Z", "iopub.status.busy": "2026-08-18T18:18:37.552847Z", "iopub.status.idle": "2026-08-18T18:18:37.846651Z", "shell.execute_reply": "2026-08-18T18:18:37.845844Z" } }, "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-08-18T18:18:37.848186Z", "iopub.status.busy": "2026-08-18T18:18:37.848022Z", "iopub.status.idle": "2026-08-18T18:18:37.851794Z", "shell.execute_reply": "2026-08-18T18:18:37.850950Z" } }, "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-08-18T18:18:37.853244Z", "iopub.status.busy": "2026-08-18T18:18:37.853087Z", "iopub.status.idle": "2026-08-18T18:18:37.855802Z", "shell.execute_reply": "2026-08-18T18:18:37.855137Z" } }, "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-08-18T18:18:37.857765Z", "iopub.status.busy": "2026-08-18T18:18:37.857604Z", "iopub.status.idle": "2026-08-18T18:18:38.718233Z", "shell.execute_reply": "2026-08-18T18:18:38.717331Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-709bd9dfbdda4daf9dd6c1c76a82ed3b-button');\n", " const status = document.getElementById('ed-fit-stop-709bd9dfbdda4daf9dd6c1c76a82ed3b-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.13186.4147.6% ↓
3250.2342.2877.3% ↓
4360.3412.9769.3% ↓
5470.4412.751.6% ↓
6810.7612.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" ] } ], "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-08-18T18:18:38.719927Z", "iopub.status.busy": "2026-08-18T18:18:38.719735Z", "iopub.status.idle": "2026-08-18T18:18:39.069172Z", "shell.execute_reply": "2026-08-18T18:18:39.068502Z" } }, "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.76
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-08-18T18:18:39.071155Z", "iopub.status.busy": "2026-08-18T18:18:39.070978Z", "iopub.status.idle": "2026-08-18T18:18:39.078429Z", "shell.execute_reply": "2026-08-18T18:18:39.077661Z" } }, "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-08-18T18:18:39.079912Z", "iopub.status.busy": "2026-08-18T18:18:39.079727Z", "iopub.status.idle": "2026-08-18T18:18:39.138147Z", "shell.execute_reply": "2026-08-18T18:18:39.137517Z" } }, "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-08-18T18:18:39.140269Z", "iopub.status.busy": "2026-08-18T18:18:39.140066Z", "iopub.status.idle": "2026-08-18T18:18:39.144691Z", "shell.execute_reply": "2026-08-18T18:18:39.144082Z" } }, "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-08-18T18:18:39.146431Z", "iopub.status.busy": "2026-08-18T18:18:39.146258Z", "iopub.status.idle": "2026-08-18T18:18:39.161659Z", "shell.execute_reply": "2026-08-18T18:18:39.160864Z" } }, "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-08-18T18:18:39.163166Z", "iopub.status.busy": "2026-08-18T18:18:39.163001Z", "iopub.status.idle": "2026-08-18T18:18:39.168336Z", "shell.execute_reply": "2026-08-18T18:18:39.167278Z" } }, "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-08-18T18:18:39.169865Z", "iopub.status.busy": "2026-08-18T18:18:39.169687Z", "iopub.status.idle": "2026-08-18T18:18:39.172906Z", "shell.execute_reply": "2026-08-18T18:18:39.172205Z" } }, "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-08-18T18:18:39.174490Z", "iopub.status.busy": "2026-08-18T18:18:39.174312Z", "iopub.status.idle": "2026-08-18T18:18:39.177691Z", "shell.execute_reply": "2026-08-18T18:18:39.177005Z" } }, "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-08-18T18:18:39.179334Z", "iopub.status.busy": "2026-08-18T18:18:39.179174Z", "iopub.status.idle": "2026-08-18T18:18:41.798667Z", "shell.execute_reply": "2026-08-18T18:18:41.797810Z" } }, "outputs": [ { "data": { "text/html": [], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function() {\n", " const button = document.getElementById('ed-fit-stop-7c94bcae6830495cb6f50c58ae7abcbb-button');\n", " const status = document.getElementById('ed-fit-stop-7c94bcae6830495cb6f50c58ae7abcbb-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.763.0276.8% ↓
3331.192.942.5% ↓
4792.532.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" ] } ], "source": [ "project.analysis.fit()" ] }, { "cell_type": "code", "execution_count": 33, "id": "41", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:41.800601Z", "iopub.status.busy": "2026-08-18T18:18:41.800359Z", "iopub.status.idle": "2026-08-18T18:18:42.192184Z", "shell.execute_reply": "2026-08-18T18:18:42.191445Z" } }, "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.53
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-08-18T18:18:42.194120Z", "iopub.status.busy": "2026-08-18T18:18:42.193961Z", "iopub.status.idle": "2026-08-18T18:18:42.217119Z", "shell.execute_reply": "2026-08-18T18:18:42.216411Z" } }, "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-08-18T18:18:42.218979Z", "iopub.status.busy": "2026-08-18T18:18:42.218814Z", "iopub.status.idle": "2026-08-18T18:18:42.233074Z", "shell.execute_reply": "2026-08-18T18:18:42.232306Z" } }, "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-08-18T18:18:42.235007Z", "iopub.status.busy": "2026-08-18T18:18:42.234786Z", "iopub.status.idle": "2026-08-18T18:18:42.245275Z", "shell.execute_reply": "2026-08-18T18:18:42.244496Z" } }, "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-08-18T18:18:42.247084Z", "iopub.status.busy": "2026-08-18T18:18:42.246936Z", "iopub.status.idle": "2026-08-18T18:18:42.314213Z", "shell.execute_reply": "2026-08-18T18:18:42.313600Z" } }, "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\n", "\n", "PDF generation can be enabled locally by uncommenting the line below,\n", "but it requires Tectonic and may download a TeX bundle, so it is\n", "disabled to keep this tutorial reproducible offline." ] }, { "cell_type": "code", "execution_count": 38, "id": "48", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:18:42.316433Z", "iopub.status.busy": "2026-08-18T18:18:42.316259Z", "iopub.status.idle": "2026-08-18T18:18:42.500603Z", "shell.execute_reply": "2026-08-18T18:18:42.499793Z" } }, "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", "β”œβ”€β”€ πŸ“ structures/\n", "β”‚ └── πŸ“„ tbti.edi\n", "β”œβ”€β”€ πŸ“ experiments/\n", "β”‚ └── πŸ“„ heidi.edi\n", "β”œβ”€β”€ πŸ“ analysis/\n", "β”‚ └── πŸ“„ analysis.edi\n", "└── πŸ“ reports/\n", " └── πŸ“„ tbti_heidi.html\n" ] } ], "source": [ "# 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.6" } }, "nbformat": 4, "nbformat_minor": 5 }