{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:11.629913Z", "iopub.status.busy": "2026-06-04T16:27:11.629756Z", "iopub.status.idle": "2026-06-04T16:27:11.633587Z", "shell.execute_reply": "2026-06-04T16:27:11.632777Z" }, "tags": [ "hide-in-docs" ] }, "outputs": [], "source": [ "# Check whether easydiffraction is installed; install it if needed.\n", "# Required for remote environments such as Google Colab.\n", "import importlib.util\n", "\n", "if importlib.util.find_spec('easydiffraction') is None:\n", " %pip install easydiffraction==0.18.0" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Structure Refinement: PbSO4, NPD + XRD\n", "\n", "This example demonstrates a more advanced use of the EasyDiffraction\n", "library by explicitly creating and configuring structures and\n", "experiments before adding them to a project. It could be more suitable\n", "for users who are interested in creating custom workflows. This\n", "tutorial provides minimal explanation and is intended for users\n", "already familiar with EasyDiffraction.\n", "\n", "The tutorial covers a Rietveld refinement of PbSO4 crystal structure\n", "based on the joint fit of both X-ray and neutron diffraction data." ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "## πŸ› οΈ Import Library" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:11.635276Z", "iopub.status.busy": "2026-06-04T16:27:11.635076Z", "iopub.status.idle": "2026-06-04T16:27:14.358933Z", "shell.execute_reply": "2026-06-04T16:27:14.358014Z" } }, "outputs": [], "source": [ "from easydiffraction import ExperimentFactory\n", "from easydiffraction import Project\n", "from easydiffraction import StructureFactory\n", "from easydiffraction import download_data" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", "### Create Structure" ] }, { "cell_type": "code", "execution_count": 3, "id": "5", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.360712Z", "iopub.status.busy": "2026-06-04T16:27:14.360421Z", "iopub.status.idle": "2026-06-04T16:27:14.365190Z", "shell.execute_reply": "2026-06-04T16:27:14.364340Z" } }, "outputs": [], "source": [ "structure = StructureFactory.from_scratch(name='pbso4')" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "### Set Space Group" ] }, { "cell_type": "code", "execution_count": 4, "id": "7", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.366764Z", "iopub.status.busy": "2026-06-04T16:27:14.366610Z", "iopub.status.idle": "2026-06-04T16:27:14.369369Z", "shell.execute_reply": "2026-06-04T16:27:14.368768Z" } }, "outputs": [], "source": [ "structure.space_group.name_h_m = 'P n m a'" ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "### Set Unit Cell" ] }, { "cell_type": "code", "execution_count": 5, "id": "9", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.371105Z", "iopub.status.busy": "2026-06-04T16:27:14.370955Z", "iopub.status.idle": "2026-06-04T16:27:14.374090Z", "shell.execute_reply": "2026-06-04T16:27:14.373244Z" } }, "outputs": [], "source": [ "structure.cell.length_a = 8.47\n", "structure.cell.length_b = 5.39\n", "structure.cell.length_c = 6.95" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "### Set Atom Sites" ] }, { "cell_type": "code", "execution_count": 6, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.375543Z", "iopub.status.busy": "2026-06-04T16:27:14.375380Z", "iopub.status.idle": "2026-06-04T16:27:14.382664Z", "shell.execute_reply": "2026-06-04T16:27:14.381629Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "structure.atom_sites.create(\n", " label='Pb',\n", " type_symbol='Pb',\n", " fract_x=0.1876,\n", " fract_y=0.25,\n", " fract_z=0.167,\n", " adp_iso=1.37,\n", ")\n", "structure.atom_sites.create(\n", " label='S',\n", " type_symbol='S',\n", " fract_x=0.0654,\n", " fract_y=0.25,\n", " fract_z=0.684,\n", " adp_iso=0.3777,\n", ")\n", "structure.atom_sites.create(\n", " label='O1',\n", " type_symbol='O',\n", " fract_x=0.9082,\n", " fract_y=0.25,\n", " fract_z=0.5954,\n", " adp_iso=1.9764,\n", ")\n", "structure.atom_sites.create(\n", " label='O2',\n", " type_symbol='O',\n", " fract_x=0.1935,\n", " fract_y=0.25,\n", " fract_z=0.5432,\n", " adp_iso=1.4456,\n", ")\n", "structure.atom_sites.create(\n", " label='O3',\n", " type_symbol='O',\n", " fract_x=0.0811,\n", " fract_y=0.0272,\n", " fract_z=0.8086,\n", " adp_iso=1.2822,\n", ")" ] }, { "cell_type": "markdown", "id": "12", "metadata": {}, "source": [ "## πŸ”¬ Define Experiments\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", "### Experiment 1: npd\n", "\n", "#### Download Data" ] }, { "cell_type": "code", "execution_count": 7, "id": "13", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.384291Z", "iopub.status.busy": "2026-06-04T16:27:14.384123Z", "iopub.status.idle": "2026-06-04T16:27:14.560343Z", "shell.execute_reply": "2026-06-04T16:27:14.559744Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mGetting data\u001b[0m\u001b[1;36m...\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Data #\u001b[1;36m13\u001b[0m: PbSO4, D1A \u001b[1m(\u001b[0mILL\u001b[1m)\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βœ… Data #\u001b[1;36m13\u001b[0m downloaded to \u001b[32m'../../../data/ed-13.dat'\u001b[0m\n" ] } ], "source": [ "data_path1 = download_data(id=13, destination='data')" ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "#### Create Experiment" ] }, { "cell_type": "code", "execution_count": 8, "id": "15", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.562406Z", "iopub.status.busy": "2026-06-04T16:27:14.562239Z", "iopub.status.idle": "2026-06-04T16:27:14.788731Z", "shell.execute_reply": "2026-06-04T16:27:14.787833Z" } }, "outputs": [], "source": [ "expt1 = ExperimentFactory.from_data_path(\n", " name='npd',\n", " data_path=data_path1,\n", " radiation_probe='neutron',\n", ")" ] }, { "cell_type": "markdown", "id": "16", "metadata": {}, "source": [ "#### Set Instrument" ] }, { "cell_type": "code", "execution_count": 9, "id": "17", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.790484Z", "iopub.status.busy": "2026-06-04T16:27:14.790261Z", "iopub.status.idle": "2026-06-04T16:27:14.793725Z", "shell.execute_reply": "2026-06-04T16:27:14.792950Z" } }, "outputs": [], "source": [ "expt1.instrument.setup_wavelength = 1.91\n", "expt1.instrument.calib_twotheta_offset = -0.1406" ] }, { "cell_type": "markdown", "id": "18", "metadata": {}, "source": [ "#### Set Peak Profile" ] }, { "cell_type": "code", "execution_count": 10, "id": "19", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.795419Z", "iopub.status.busy": "2026-06-04T16:27:14.795258Z", "iopub.status.idle": "2026-06-04T16:27:14.799196Z", "shell.execute_reply": "2026-06-04T16:27:14.798424Z" } }, "outputs": [], "source": [ "expt1.peak.broad_gauss_u = 0.139\n", "expt1.peak.broad_gauss_v = -0.412\n", "expt1.peak.broad_gauss_w = 0.386\n", "expt1.peak.broad_lorentz_x = 0\n", "expt1.peak.broad_lorentz_y = 0.088" ] }, { "cell_type": "markdown", "id": "20", "metadata": {}, "source": [ "#### Set Background" ] }, { "cell_type": "markdown", "id": "21", "metadata": {}, "source": [ "Select the background type." ] }, { "cell_type": "code", "execution_count": 11, "id": "22", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.801091Z", "iopub.status.busy": "2026-06-04T16:27:14.800854Z", "iopub.status.idle": "2026-06-04T16:27:14.806274Z", "shell.execute_reply": "2026-06-04T16:27:14.805363Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mBackground type for experiment \u001b[0m\u001b[32m'npd'\u001b[0m\u001b[1;36m already set to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "line-segment\n" ] } ], "source": [ "expt1.background.type = 'line-segment'" ] }, { "cell_type": "markdown", "id": "23", "metadata": {}, "source": [ "Add background points." ] }, { "cell_type": "code", "execution_count": 12, "id": "24", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.808437Z", "iopub.status.busy": "2026-06-04T16:27:14.808258Z", "iopub.status.idle": "2026-06-04T16:27:14.814093Z", "shell.execute_reply": "2026-06-04T16:27:14.813322Z" } }, "outputs": [], "source": [ "for id, x, y in [\n", " ('1', 11.0, 206.1624),\n", " ('2', 15.0, 194.75),\n", " ('3', 20.0, 194.505),\n", " ('4', 30.0, 188.4375),\n", " ('5', 50.0, 207.7633),\n", " ('6', 70.0, 201.7002),\n", " ('7', 120.0, 244.4525),\n", " ('8', 153.0, 226.0595),\n", "]:\n", " expt1.background.create(id=id, x=x, y=y)" ] }, { "cell_type": "markdown", "id": "25", "metadata": {}, "source": [ "#### Set Linked Phases" ] }, { "cell_type": "code", "execution_count": 13, "id": "26", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.815507Z", "iopub.status.busy": "2026-06-04T16:27:14.815334Z", "iopub.status.idle": "2026-06-04T16:27:14.818338Z", "shell.execute_reply": "2026-06-04T16:27:14.817643Z" } }, "outputs": [], "source": [ "expt1.linked_phases.create(id='pbso4', scale=1.5)" ] }, { "cell_type": "markdown", "id": "27", "metadata": {}, "source": [ "### Experiment 2: xrd\n", "\n", "#### Download Data" ] }, { "cell_type": "code", "execution_count": 14, "id": "28", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.819832Z", "iopub.status.busy": "2026-06-04T16:27:14.819687Z", "iopub.status.idle": "2026-06-04T16:27:14.919678Z", "shell.execute_reply": "2026-06-04T16:27:14.918917Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mGetting data\u001b[0m\u001b[1;36m...\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Data #\u001b[1;36m16\u001b[0m: PbSO4, laboratory X-ray\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "βœ… Data #\u001b[1;36m16\u001b[0m downloaded to \u001b[32m'../../../data/ed-16.dat'\u001b[0m\n" ] } ], "source": [ "data_path2 = download_data(id=16, destination='data')" ] }, { "cell_type": "markdown", "id": "29", "metadata": {}, "source": [ "#### Create Experiment" ] }, { "cell_type": "code", "execution_count": 15, "id": "30", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:14.921513Z", "iopub.status.busy": "2026-06-04T16:27:14.921347Z", "iopub.status.idle": "2026-06-04T16:27:15.358546Z", "shell.execute_reply": "2026-06-04T16:27:15.357842Z" } }, "outputs": [], "source": [ "expt2 = ExperimentFactory.from_data_path(\n", " name='xrd',\n", " data_path=data_path2,\n", " radiation_probe='xray',\n", ")" ] }, { "cell_type": "markdown", "id": "31", "metadata": {}, "source": [ "#### Set Instrument" ] }, { "cell_type": "code", "execution_count": 16, "id": "32", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.360901Z", "iopub.status.busy": "2026-06-04T16:27:15.360726Z", "iopub.status.idle": "2026-06-04T16:27:15.363776Z", "shell.execute_reply": "2026-06-04T16:27:15.362958Z" } }, "outputs": [], "source": [ "expt2.instrument.setup_wavelength = 1.540567\n", "expt2.instrument.calib_twotheta_offset = -0.05181" ] }, { "cell_type": "markdown", "id": "33", "metadata": {}, "source": [ "#### Set Peak Profile" ] }, { "cell_type": "code", "execution_count": 17, "id": "34", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.365218Z", "iopub.status.busy": "2026-06-04T16:27:15.365051Z", "iopub.status.idle": "2026-06-04T16:27:15.368287Z", "shell.execute_reply": "2026-06-04T16:27:15.367528Z" } }, "outputs": [], "source": [ "expt2.peak.broad_gauss_u = 0.304138\n", "expt2.peak.broad_gauss_v = -0.112622\n", "expt2.peak.broad_gauss_w = 0.021272\n", "expt2.peak.broad_lorentz_x = 0\n", "expt2.peak.broad_lorentz_y = 0.057691" ] }, { "cell_type": "markdown", "id": "35", "metadata": {}, "source": [ "#### Set Background" ] }, { "cell_type": "markdown", "id": "36", "metadata": {}, "source": [ "Select background type." ] }, { "cell_type": "code", "execution_count": 18, "id": "37", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.369856Z", "iopub.status.busy": "2026-06-04T16:27:15.369652Z", "iopub.status.idle": "2026-06-04T16:27:15.374587Z", "shell.execute_reply": "2026-06-04T16:27:15.373859Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mBackground type for experiment \u001b[0m\u001b[32m'xrd'\u001b[0m\u001b[1;36m changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "chebyshev\n" ] } ], "source": [ "expt2.background.type = 'chebyshev'" ] }, { "cell_type": "markdown", "id": "38", "metadata": {}, "source": [ "Add background points." ] }, { "cell_type": "code", "execution_count": 19, "id": "39", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.376009Z", "iopub.status.busy": "2026-06-04T16:27:15.375848Z", "iopub.status.idle": "2026-06-04T16:27:15.380109Z", "shell.execute_reply": "2026-06-04T16:27:15.379380Z" } }, "outputs": [], "source": [ "for id, x, y in [\n", " ('1', 0, 119.195),\n", " ('2', 1, 6.221),\n", " ('3', 2, -45.725),\n", " ('4', 3, 8.119),\n", " ('5', 4, 54.552),\n", " ('6', 5, -20.661),\n", "]:\n", " expt2.background.create(id=id, order=x, coef=y)" ] }, { "cell_type": "markdown", "id": "40", "metadata": {}, "source": [ "#### Set Linked Phases" ] }, { "cell_type": "code", "execution_count": 20, "id": "41", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.381842Z", "iopub.status.busy": "2026-06-04T16:27:15.381642Z", "iopub.status.idle": "2026-06-04T16:27:15.385071Z", "shell.execute_reply": "2026-06-04T16:27:15.384228Z" } }, "outputs": [], "source": [ "expt2.linked_phases.create(id='pbso4', scale=0.001)" ] }, { "cell_type": "markdown", "id": "42", "metadata": {}, "source": [ "## πŸ“¦ Define Project\n", "\n", "The project object is used to manage structures, experiments, and\n", "analysis.\n", "\n", "### Create Project" ] }, { "cell_type": "code", "execution_count": 21, "id": "43", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.386553Z", "iopub.status.busy": "2026-06-04T16:27:15.386405Z", "iopub.status.idle": "2026-06-04T16:27:15.870344Z", "shell.execute_reply": "2026-06-04T16:27:15.869493Z" } }, "outputs": [ { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project = Project(name='pbso4_joint')" ] }, { "cell_type": "markdown", "id": "44", "metadata": {}, "source": [ "### Add Structure" ] }, { "cell_type": "code", "execution_count": 22, "id": "45", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.872078Z", "iopub.status.busy": "2026-06-04T16:27:15.871908Z", "iopub.status.idle": "2026-06-04T16:27:15.874845Z", "shell.execute_reply": "2026-06-04T16:27:15.874036Z" } }, "outputs": [], "source": [ "project.structures.add(structure)" ] }, { "cell_type": "markdown", "id": "46", "metadata": {}, "source": [ "### Add Experiments" ] }, { "cell_type": "code", "execution_count": 23, "id": "47", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.876336Z", "iopub.status.busy": "2026-06-04T16:27:15.876169Z", "iopub.status.idle": "2026-06-04T16:27:15.879173Z", "shell.execute_reply": "2026-06-04T16:27:15.878403Z" } }, "outputs": [], "source": [ "project.experiments.add(expt1)\n", "project.experiments.add(expt2)" ] }, { "cell_type": "markdown", "id": "48", "metadata": {}, "source": [ "## πŸš€ Perform Analysis\n", "\n", "This section outlines the analysis process, including how to configure\n", "calculation and fitting engines.\n", "\n", "### Set Fit Mode" ] }, { "cell_type": "code", "execution_count": 24, "id": "49", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.880787Z", "iopub.status.busy": "2026-06-04T16:27:15.880626Z", "iopub.status.idle": "2026-06-04T16:27:15.885221Z", "shell.execute_reply": "2026-06-04T16:27:15.884464Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mFitting mode changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "joint\n" ] } ], "source": [ "project.analysis.fitting_mode.type = 'joint'" ] }, { "cell_type": "markdown", "id": "50", "metadata": {}, "source": [ "### Set Minimizer" ] }, { "cell_type": "code", "execution_count": 25, "id": "51", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.886762Z", "iopub.status.busy": "2026-06-04T16:27:15.886603Z", "iopub.status.idle": "2026-06-04T16:27:15.891632Z", "shell.execute_reply": "2026-06-04T16:27:15.890546Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mCurrent minimizer changed to\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "lmfit\n" ] } ], "source": [ "project.analysis.minimizer.type = 'lmfit'" ] }, { "cell_type": "markdown", "id": "52", "metadata": {}, "source": [ "### Set Free Parameters\n", "\n", "Set structure parameters to be optimized." ] }, { "cell_type": "code", "execution_count": 26, "id": "53", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.893063Z", "iopub.status.busy": "2026-06-04T16:27:15.892920Z", "iopub.status.idle": "2026-06-04T16:27:15.896834Z", "shell.execute_reply": "2026-06-04T16:27:15.895770Z" } }, "outputs": [], "source": [ "structure.cell.length_a.free = True\n", "structure.cell.length_b.free = True\n", "structure.cell.length_c.free = True" ] }, { "cell_type": "markdown", "id": "54", "metadata": {}, "source": [ "Set experiment parameters to be optimized." ] }, { "cell_type": "code", "execution_count": 27, "id": "55", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.898242Z", "iopub.status.busy": "2026-06-04T16:27:15.898103Z", "iopub.status.idle": "2026-06-04T16:27:15.901301Z", "shell.execute_reply": "2026-06-04T16:27:15.900596Z" } }, "outputs": [], "source": [ "expt1.linked_phases['pbso4'].scale.free = True\n", "\n", "expt1.instrument.calib_twotheta_offset.free = True\n", "\n", "expt1.peak.broad_gauss_u.free = True\n", "expt1.peak.broad_gauss_v.free = True\n", "expt1.peak.broad_gauss_w.free = True\n", "expt1.peak.broad_lorentz_y.free = True" ] }, { "cell_type": "code", "execution_count": 28, "id": "56", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.902985Z", "iopub.status.busy": "2026-06-04T16:27:15.902837Z", "iopub.status.idle": "2026-06-04T16:27:15.906467Z", "shell.execute_reply": "2026-06-04T16:27:15.905719Z" } }, "outputs": [], "source": [ "expt2.linked_phases['pbso4'].scale.free = True\n", "\n", "expt2.instrument.calib_twotheta_offset.free = True\n", "\n", "expt2.peak.broad_gauss_u.free = True\n", "expt2.peak.broad_gauss_v.free = True\n", "expt2.peak.broad_gauss_w.free = True\n", "expt2.peak.broad_lorentz_y.free = True\n", "\n", "for term in expt2.background:\n", " term.coef.free = True" ] }, { "cell_type": "markdown", "id": "57", "metadata": {}, "source": [ "### Run Fitting" ] }, { "cell_type": "markdown", "id": "58", "metadata": {}, "source": [ "### Display Structure" ] }, { "cell_type": "code", "execution_count": 29, "id": "59", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:15.907911Z", "iopub.status.busy": "2026-06-04T16:27:15.907765Z", "iopub.status.idle": "2026-06-04T16:27:16.224131Z", "shell.execute_reply": "2026-06-04T16:27:16.223322Z" } }, "outputs": [ { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure 🧩 \u001b[0m\u001b[32m'pbso4'\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='pbso4')" ] }, { "cell_type": "markdown", "id": "60", "metadata": {}, "source": [ "### Display Pattern" ] }, { "cell_type": "code", "execution_count": 30, "id": "61", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:16.226001Z", "iopub.status.busy": "2026-06-04T16:27:16.225827Z", "iopub.status.idle": "2026-06-04T16:27:17.311991Z", "shell.execute_reply": "2026-06-04T16:27:17.311219Z" } }, "outputs": [ { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='npd', x_min=35.5, x_max=38.3)" ] }, { "cell_type": "code", "execution_count": 31, "id": "62", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:17.313655Z", "iopub.status.busy": "2026-06-04T16:27:17.313435Z", "iopub.status.idle": "2026-06-04T16:27:18.763003Z", "shell.execute_reply": "2026-06-04T16:27:18.762165Z" } }, "outputs": [ { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Loading plot…
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "project.display.pattern(expt_name='xrd', x_min=29.0, x_max=30.4)" ] }, { "cell_type": "markdown", "id": "63", "metadata": {}, "source": [ "## πŸ’Ύ Save Project" ] }, { "cell_type": "code", "execution_count": 32, "id": "64", "metadata": { "execution": { "iopub.execute_input": "2026-06-04T16:27:18.764722Z", "iopub.status.busy": "2026-06-04T16:27:18.764493Z", "iopub.status.idle": "2026-06-04T16:27:20.486241Z", "shell.execute_reply": "2026-06-04T16:27:20.485475Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mSaving project πŸ“¦ \u001b[0m\u001b[32m'pbso4_joint'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/ed_4_pbso4_joint'\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“„ project.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ structures/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ pbso4.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ experiments/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ npd.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ xrd.cif\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”œβ”€β”€ πŸ“ analysis/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β”‚ └── πŸ“„ analysis.cif\n" ] }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " (function() {\n", " var isDark = false;\n", "\n", " // Check JupyterLab theme\n", " if (document.body.classList.contains('jp-mod-dark') || \n", " document.body.classList.contains('theme-dark') ||\n", " document.body.classList.contains('vscode-dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check theme attribute\n", " var themeAttr = document.body.getAttribute('data-jp-theme-name');\n", " if (themeAttr && themeAttr.includes('dark')) {\n", " isDark = true;\n", " }\n", "\n", " // Check computed background color\n", " var notebookEl = document.querySelector('.jp-Notebook') || \n", " document.querySelector('.notebook_app') ||\n", " document.body;\n", " if (notebookEl) {\n", " var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n", " var rgb = bgColor.match(/\\d+/g);\n", " if (rgb && rgb.length >= 3) {\n", " var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n", " if (brightness < 128) {\n", " isDark = true;\n", " }\n", " }\n", " }\n", "\n", " // Store result\n", " if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n", " IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n", " }\n", " })();\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", " if (typeof IPython !== 'undefined' && IPython.notebook) {\n", " IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n", " (document.body.classList.contains('theme-dark') || \n", " document.body.classList.contains('jp-mod-dark') ||\n", " (document.body.getAttribute('data-jp-theme-name') && \n", " document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n", " }\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "└── πŸ“ reports/\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " └── πŸ“„ pbso4_joint.html\n" ] } ], "source": [ "project.save_as(dir_path='projects/ed_4_pbso4_joint')" ] } ], "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 }