{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "0", "metadata": { "execution": { "iopub.execute_input": "2026-08-18T18:32:12.241203Z", "iopub.status.busy": "2026-08-18T18:32:12.241024Z", "iopub.status.idle": "2026-08-18T18:32:12.244879Z", "shell.execute_reply": "2026-08-18T18:32:12.244322Z" }, "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": [ "# 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-08-18T18:32:12.246466Z", "iopub.status.busy": "2026-08-18T18:32:12.246302Z", "iopub.status.idle": "2026-08-18T18:32:15.006278Z", "shell.execute_reply": "2026-08-18T18:32:15.005367Z" } }, "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-08-18T18:32:15.008344Z", "iopub.status.busy": "2026-08-18T18:32:15.008044Z", "iopub.status.idle": "2026-08-18T18:32:15.657312Z", "shell.execute_reply": "2026-08-18T18:32:15.656417Z" } }, "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-08-18T18:32:15.659099Z", "iopub.status.busy": "2026-08-18T18:32:15.658824Z", "iopub.status.idle": "2026-08-18T18:32:16.913491Z", "shell.execute_reply": "2026-08-18T18:32:16.912625Z" } }, "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-08-18T18:32:16.915264Z", "iopub.status.busy": "2026-08-18T18:32:16.915096Z", "iopub.status.idle": "2026-08-18T18:32:16.946586Z", "shell.execute_reply": "2026-08-18T18:32:16.946107Z" } }, "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% | 64.70 | 002p3630_all594632.dat - 002p3440_all594631.dat | 3 | 53.31 | β |