{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:35:10.235892Z", "iopub.status.busy": "2026-06-30T22:35:10.235695Z", "iopub.status.idle": "2026-06-30T22:35:10.240029Z", "shell.execute_reply": "2026-06-30T22:35:10.239205Z" }, "tags": [ "hide-in-docs" ] }, "outputs": [], "source": [ "# Check whether easydiffraction is installed; install it if needed.\n", "# Required for remote environments such as Google Colab.\n", "import importlib.util\n", "\n", "if importlib.util.find_spec('easydiffraction') is None:\n", " %pip install easydiffraction==0.19.1" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Co2SiO4 T-scan Resume\n", "\n", "This example loads a previously saved Co2SiO4 project after a\n", "sequential refinement was stopped before all scan files were\n", "processed. The saved project contains 213 scan files and a partial\n", "`analysis/results.csv` with 210 completed rows. Running\n", "`project.analysis.fit()` resumes from the remaining three datasets and\n", "appends the missing results." ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "## π οΈ Import Library" ] }, { "cell_type": "code", "execution_count": 2, "id": "3", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:35:10.241706Z", "iopub.status.busy": "2026-06-30T22:35:10.241524Z", "iopub.status.idle": "2026-06-30T22:35:13.069691Z", "shell.execute_reply": "2026-06-30T22:35:13.068675Z" } }, "outputs": [], "source": [ "import easydiffraction as edi" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "## π Load Project" ] }, { "cell_type": "markdown", "id": "5", "metadata": {}, "source": [ "### Locate Project\n", "\n", "Download and extract the saved Co2SiO4 scan project from the\n", "EasyDiffraction data repository. The project contains the scan data and\n", "the partial sequential-fit results needed for resuming." ] }, { "cell_type": "code", "execution_count": 3, "id": "6", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:35:13.071635Z", "iopub.status.busy": "2026-06-30T22:35:13.071347Z", "iopub.status.idle": "2026-06-30T22:35:13.466234Z", "shell.execute_reply": "2026-06-30T22:35:13.465336Z" } }, "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'proj-cosio-d20-scan'\u001b[0m: Co2SiO4, D20 \u001b[1m(\u001b[0mILL\u001b[1m)\u001b[0m, \u001b[1;36m213\u001b[0m-file T-scan resume project with \u001b[1;36m210\u001b[0m completed results\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "β Data \u001b[32m'proj-cosio-d20-scan'\u001b[0m downloaded and extracted to \u001b[32m'../../../projects/proj-cosio-d20-scan-cee816aee63d'\u001b[0m\n" ] } ], "source": [ "project_dir = edi.download_data('proj-cosio-d20-scan', destination='projects', overwrite=True)" ] }, { "cell_type": "markdown", "id": "7", "metadata": {}, "source": [ "### Load Project\n", "\n", "The project is downloaded into a fresh writable working directory so\n", "resuming the sequential fit appends to its `analysis/results.csv`." ] }, { "cell_type": "code", "execution_count": 4, "id": "8", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:35:13.467836Z", "iopub.status.busy": "2026-06-30T22:35:13.467650Z", "iopub.status.idle": "2026-06-30T22:35:14.742660Z", "shell.execute_reply": "2026-06-30T22:35:14.741665Z" } }, "outputs": [], "source": [ "project = edi.Project.load(project_dir)" ] }, { "cell_type": "markdown", "id": "9", "metadata": {}, "source": [ "## π Perform Analysis" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "### Display Structure\n", "\n", "Render the Co2SiO4 structure restored from the saved project." ] }, { "cell_type": "code", "execution_count": 5, "id": "11", "metadata": { "execution": { "iopub.execute_input": "2026-06-30T22:35:14.744469Z", "iopub.status.busy": "2026-06-30T22:35:14.744303Z", "iopub.status.idle": "2026-06-30T22:35:14.777177Z", "shell.execute_reply": "2026-06-30T22:35:14.776264Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36mStructure π§© \u001b[0m\u001b[32m'cosio'\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": [ "
| chunk | progress | time (s) | files | count | average ΟΒ² | status | |
|---|---|---|---|---|---|---|---|
| 1 | 1/1 | 100.0% | 58.99 | 002p3630_all594632.dat - 002p3440_all594631.dat | 3 | 53.31 | β |