{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "0",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:05.486610Z",
"iopub.status.busy": "2026-06-30T22:33:05.486406Z",
"iopub.status.idle": "2026-06-30T22:33:05.490840Z",
"shell.execute_reply": "2026-06-30T22:33:05.490080Z"
},
"tags": [
"hide-in-docs"
]
},
"outputs": [],
"source": [
"# Check whether easydiffraction is installed; install it if needed.\n",
"# Required for remote environments such as Google Colab.\n",
"import importlib.util\n",
"\n",
"if importlib.util.find_spec('easydiffraction') is None:\n",
" %pip install easydiffraction==0.19.1"
]
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"# Structure Refinement: LBCO+Si, McStas\n",
"\n",
"This example demonstrates a Rietveld refinement of La0.5Ba0.5CoO3\n",
"crystal structure with a small amount of Si phase using time-of-flight\n",
"neutron powder diffraction data simulated with McStas."
]
},
{
"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:33:05.492392Z",
"iopub.status.busy": "2026-06-30T22:33:05.492239Z",
"iopub.status.idle": "2026-06-30T22:33:08.333241Z",
"shell.execute_reply": "2026-06-30T22:33:08.332133Z"
}
},
"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 Structures\n",
"\n",
"This section shows how to add structures and modify their\n",
"parameters.\n",
"\n",
"### Create Structure 1: LBCO"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "5",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.334935Z",
"iopub.status.busy": "2026-06-30T22:33:08.334662Z",
"iopub.status.idle": "2026-06-30T22:33:08.339535Z",
"shell.execute_reply": "2026-06-30T22:33:08.338595Z"
}
},
"outputs": [],
"source": [
"structure_1 = StructureFactory.from_scratch(name='lbco')"
]
},
{
"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-30T22:33:08.341184Z",
"iopub.status.busy": "2026-06-30T22:33:08.340963Z",
"iopub.status.idle": "2026-06-30T22:33:08.344606Z",
"shell.execute_reply": "2026-06-30T22:33:08.343737Z"
}
},
"outputs": [],
"source": [
"structure_1.space_group.name_h_m = 'P m -3 m'\n",
"structure_1.space_group.coord_system_code = '1'"
]
},
{
"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-30T22:33:08.346367Z",
"iopub.status.busy": "2026-06-30T22:33:08.346135Z",
"iopub.status.idle": "2026-06-30T22:33:08.349405Z",
"shell.execute_reply": "2026-06-30T22:33:08.348634Z"
}
},
"outputs": [],
"source": [
"structure_1.cell.length_a = 3.8909"
]
},
{
"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-30T22:33:08.351006Z",
"iopub.status.busy": "2026-06-30T22:33:08.350843Z",
"iopub.status.idle": "2026-06-30T22:33:08.357505Z",
"shell.execute_reply": "2026-06-30T22:33:08.356643Z"
}
},
"outputs": [],
"source": [
"structure_1.atom_sites.create(\n",
" id='La',\n",
" type_symbol='La',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" adp_iso=0.2,\n",
" occupancy=0.5,\n",
")\n",
"structure_1.atom_sites.create(\n",
" id='Ba',\n",
" type_symbol='Ba',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" adp_iso=0.2,\n",
" occupancy=0.5,\n",
")\n",
"structure_1.atom_sites.create(\n",
" id='Co',\n",
" type_symbol='Co',\n",
" fract_x=0.5,\n",
" fract_y=0.5,\n",
" fract_z=0.5,\n",
" adp_iso=0.2567,\n",
")\n",
"structure_1.atom_sites.create(\n",
" id='O',\n",
" type_symbol='O',\n",
" fract_x=0,\n",
" fract_y=0.5,\n",
" fract_z=0.5,\n",
" adp_iso=1.4041,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "12",
"metadata": {},
"source": [
"### Create Structure 2: Si"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "13",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.359319Z",
"iopub.status.busy": "2026-06-30T22:33:08.358958Z",
"iopub.status.idle": "2026-06-30T22:33:08.363228Z",
"shell.execute_reply": "2026-06-30T22:33:08.362498Z"
}
},
"outputs": [],
"source": [
"structure_2 = StructureFactory.from_scratch(name='si')"
]
},
{
"cell_type": "markdown",
"id": "14",
"metadata": {},
"source": [
"#### Set Space Group"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "15",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.365253Z",
"iopub.status.busy": "2026-06-30T22:33:08.365034Z",
"iopub.status.idle": "2026-06-30T22:33:08.368549Z",
"shell.execute_reply": "2026-06-30T22:33:08.367677Z"
}
},
"outputs": [],
"source": [
"structure_2.space_group.name_h_m = 'F d -3 m'\n",
"structure_2.space_group.coord_system_code = '2'"
]
},
{
"cell_type": "markdown",
"id": "16",
"metadata": {},
"source": [
"#### Set Unit Cell"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "17",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.370053Z",
"iopub.status.busy": "2026-06-30T22:33:08.369888Z",
"iopub.status.idle": "2026-06-30T22:33:08.372468Z",
"shell.execute_reply": "2026-06-30T22:33:08.371977Z"
}
},
"outputs": [],
"source": [
"structure_2.cell.length_a = 5.43146"
]
},
{
"cell_type": "markdown",
"id": "18",
"metadata": {},
"source": [
"#### Set Atom Sites"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "19",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.374220Z",
"iopub.status.busy": "2026-06-30T22:33:08.374047Z",
"iopub.status.idle": "2026-06-30T22:33:08.378106Z",
"shell.execute_reply": "2026-06-30T22:33:08.377257Z"
}
},
"outputs": [],
"source": [
"structure_2.atom_sites.create(\n",
" id='Si',\n",
" type_symbol='Si',\n",
" fract_x=0.0,\n",
" fract_y=0.0,\n",
" fract_z=0.0,\n",
" adp_iso=0.0,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "20",
"metadata": {},
"source": [
"## π¬ Define Experiment\n",
"\n",
"This section shows how to add experiments, configure their parameters,\n",
"and link the structures defined in the previous step.\n",
"\n",
"### Download Data"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "21",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.379603Z",
"iopub.status.busy": "2026-06-30T22:33:08.379455Z",
"iopub.status.idle": "2026-06-30T22:33:08.527842Z",
"shell.execute_reply": "2026-06-30T22:33:08.527078Z"
}
},
"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-lbco-si-mcstas'\u001b[0m: La0.5Ba0.5CoO3 + Si, McStas simulation\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β
Data \u001b[32m'meas-lbco-si-mcstas'\u001b[0m downloaded to \u001b[32m'../../../data/meas-lbco-si-mcstas.xye'\u001b[0m\n"
]
}
],
"source": [
"data_path = download_data('meas-lbco-si-mcstas', destination='data')"
]
},
{
"cell_type": "markdown",
"id": "22",
"metadata": {},
"source": [
"### Create Experiment"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "23",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.529671Z",
"iopub.status.busy": "2026-06-30T22:33:08.529502Z",
"iopub.status.idle": "2026-06-30T22:33:08.714589Z",
"shell.execute_reply": "2026-06-30T22:33:08.713545Z"
}
},
"outputs": [],
"source": [
"experiment = ExperimentFactory.from_data_path(\n",
" name='mcstas',\n",
" data_path=data_path,\n",
" sample_form='powder',\n",
" beam_mode='time-of-flight',\n",
" radiation_probe='neutron',\n",
" scattering_type='bragg',\n",
")"
]
},
{
"cell_type": "markdown",
"id": "24",
"metadata": {},
"source": [
"### Set Instrument"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "25",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.716439Z",
"iopub.status.busy": "2026-06-30T22:33:08.716204Z",
"iopub.status.idle": "2026-06-30T22:33:08.719763Z",
"shell.execute_reply": "2026-06-30T22:33:08.718996Z"
}
},
"outputs": [],
"source": [
"experiment.instrument.setup_twotheta_bank = 94.90931761529106\n",
"experiment.instrument.calib_d_to_tof_linear = 58724.76869981215"
]
},
{
"cell_type": "markdown",
"id": "26",
"metadata": {},
"source": [
"### Set Peak Profile"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "27",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.721219Z",
"iopub.status.busy": "2026-06-30T22:33:08.721047Z",
"iopub.status.idle": "2026-06-30T22:33:08.724732Z",
"shell.execute_reply": "2026-06-30T22:33:08.723916Z"
}
},
"outputs": [],
"source": [
"experiment.peak.broad_gauss_sigma_0 = 45137\n",
"experiment.peak.broad_gauss_sigma_1 = -52394\n",
"experiment.peak.broad_gauss_sigma_2 = 22998\n",
"experiment.peak.decay_beta_0 = 0.0055\n",
"experiment.peak.decay_beta_1 = 0.0041\n",
"experiment.peak.rise_alpha_0 = 0\n",
"experiment.peak.rise_alpha_1 = 0.0097"
]
},
{
"cell_type": "markdown",
"id": "28",
"metadata": {},
"source": [
"### Set Background"
]
},
{
"cell_type": "markdown",
"id": "29",
"metadata": {},
"source": [
"Select the background type."
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "30",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.726491Z",
"iopub.status.busy": "2026-06-30T22:33:08.726351Z",
"iopub.status.idle": "2026-06-30T22:33:08.731319Z",
"shell.execute_reply": "2026-06-30T22:33:08.730531Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mBackground type for experiment \u001b[0m\u001b[32m'mcstas'\u001b[0m\u001b[1;36m already set to\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"line-segment\n"
]
}
],
"source": [
"experiment.background.type = 'line-segment'"
]
},
{
"cell_type": "markdown",
"id": "31",
"metadata": {},
"source": [
"Add background points."
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "32",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.732834Z",
"iopub.status.busy": "2026-06-30T22:33:08.732685Z",
"iopub.status.idle": "2026-06-30T22:33:08.740024Z",
"shell.execute_reply": "2026-06-30T22:33:08.739195Z"
}
},
"outputs": [],
"source": [
"experiment.background.create(id='1', position=45000, intensity=0.2)\n",
"experiment.background.create(id='2', position=50000, intensity=0.2)\n",
"experiment.background.create(id='3', position=55000, intensity=0.2)\n",
"experiment.background.create(id='4', position=65000, intensity=0.2)\n",
"experiment.background.create(id='5', position=70000, intensity=0.2)\n",
"experiment.background.create(id='6', position=75000, intensity=0.2)\n",
"experiment.background.create(id='7', position=80000, intensity=0.2)\n",
"experiment.background.create(id='8', position=85000, intensity=0.2)\n",
"experiment.background.create(id='9', position=90000, intensity=0.2)\n",
"experiment.background.create(id='10', position=95000, intensity=0.2)\n",
"experiment.background.create(id='11', position=100000, intensity=0.2)\n",
"experiment.background.create(id='12', position=105000, intensity=0.2)\n",
"experiment.background.create(id='13', position=110000, intensity=0.2)"
]
},
{
"cell_type": "markdown",
"id": "33",
"metadata": {},
"source": [
"### Set Linked Structures"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "34",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.741671Z",
"iopub.status.busy": "2026-06-30T22:33:08.741452Z",
"iopub.status.idle": "2026-06-30T22:33:08.745694Z",
"shell.execute_reply": "2026-06-30T22:33:08.744966Z"
}
},
"outputs": [],
"source": [
"experiment.linked_structures.create(structure_id='lbco', scale=4.0)\n",
"experiment.linked_structures.create(structure_id='si', scale=0.2)"
]
},
{
"cell_type": "markdown",
"id": "35",
"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": 18,
"id": "36",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.747180Z",
"iopub.status.busy": "2026-06-30T22:33:08.747021Z",
"iopub.status.idle": "2026-06-30T22:33:08.963966Z",
"shell.execute_reply": "2026-06-30T22:33:08.963131Z"
}
},
"outputs": [],
"source": [
"project = Project(name='lbco_si_mcstas')"
]
},
{
"cell_type": "markdown",
"id": "37",
"metadata": {},
"source": [
"### Add Structures"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "38",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.965733Z",
"iopub.status.busy": "2026-06-30T22:33:08.965551Z",
"iopub.status.idle": "2026-06-30T22:33:08.968413Z",
"shell.execute_reply": "2026-06-30T22:33:08.967757Z"
}
},
"outputs": [],
"source": [
"project.structures.add(structure_1)\n",
"project.structures.add(structure_2)"
]
},
{
"cell_type": "markdown",
"id": "39",
"metadata": {},
"source": [
"### Show Structures"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "40",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.970544Z",
"iopub.status.busy": "2026-06-30T22:33:08.970386Z",
"iopub.status.idle": "2026-06-30T22:33:08.974994Z",
"shell.execute_reply": "2026-06-30T22:33:08.974252Z"
}
},
"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'lbco'\u001b[0m, \u001b[32m'si'\u001b[0m\u001b[1m]\u001b[0m\n"
]
}
],
"source": [
"project.structures.show_names()"
]
},
{
"cell_type": "markdown",
"id": "41",
"metadata": {},
"source": [
"### Add Experiments"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "42",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.976329Z",
"iopub.status.busy": "2026-06-30T22:33:08.976180Z",
"iopub.status.idle": "2026-06-30T22:33:08.978883Z",
"shell.execute_reply": "2026-06-30T22:33:08.978120Z"
}
},
"outputs": [],
"source": [
"project.experiments.add(experiment)"
]
},
{
"cell_type": "markdown",
"id": "43",
"metadata": {},
"source": [
"### Display Structure"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "44",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:08.980569Z",
"iopub.status.busy": "2026-06-30T22:33:08.980422Z",
"iopub.status.idle": "2026-06-30T22:33:09.686515Z",
"shell.execute_reply": "2026-06-30T22:33:09.685737Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mStructure π§© \u001b[0m\u001b[32m'lbco'\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"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mStructure π§© \u001b[0m\u001b[32m'si'\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='lbco')\n",
"project.display.structure(struct_name='si')"
]
},
{
"cell_type": "markdown",
"id": "45",
"metadata": {},
"source": [
"### Set Excluded Regions\n",
"\n",
"Show measured data as loaded from the file."
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "46",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:09.688016Z",
"iopub.status.busy": "2026-06-30T22:33:09.687856Z",
"iopub.status.idle": "2026-06-30T22:33:10.138299Z",
"shell.execute_reply": "2026-06-30T22:33:10.137488Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='mcstas')"
]
},
{
"cell_type": "markdown",
"id": "47",
"metadata": {},
"source": [
"Add excluded regions."
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "48",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.140463Z",
"iopub.status.busy": "2026-06-30T22:33:10.140057Z",
"iopub.status.idle": "2026-06-30T22:33:10.144644Z",
"shell.execute_reply": "2026-06-30T22:33:10.143884Z"
}
},
"outputs": [],
"source": [
"experiment.excluded_regions.create(id='1', start=0, end=40000)\n",
"experiment.excluded_regions.create(id='2', start=108000, end=200000)"
]
},
{
"cell_type": "markdown",
"id": "49",
"metadata": {},
"source": [
"Show excluded regions."
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "50",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.146230Z",
"iopub.status.busy": "2026-06-30T22:33:10.146058Z",
"iopub.status.idle": "2026-06-30T22:33:10.152340Z",
"shell.execute_reply": "2026-06-30T22:33:10.151803Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mExcluded regions\u001b[0m\n"
]
},
{
"data": {
"text/html": [
" | start | end |
|---|
| 1 | 0.00000 | 40000.00000 |
|---|
| 2 | 108000.00000 | 200000.00000 |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"experiment.excluded_regions.show()"
]
},
{
"cell_type": "markdown",
"id": "51",
"metadata": {},
"source": [
"Show measured data after adding excluded regions."
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "52",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.154279Z",
"iopub.status.busy": "2026-06-30T22:33:10.154130Z",
"iopub.status.idle": "2026-06-30T22:33:10.548980Z",
"shell.execute_reply": "2026-06-30T22:33:10.548254Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='mcstas')"
]
},
{
"cell_type": "markdown",
"id": "53",
"metadata": {},
"source": [
"Show experiment as text."
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "54",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.552028Z",
"iopub.status.busy": "2026-06-30T22:33:10.551862Z",
"iopub.status.idle": "2026-06-30T22:33:10.567525Z",
"shell.execute_reply": "2026-06-30T22:33:10.566563Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mExperiment π¬ \u001b[0m\u001b[32m'mcstas'\u001b[0m\u001b[1;36m as text\u001b[0m\n"
]
},
{
"data": {
"text/html": [
" | Edi |
|---|
| 1 | data_mcstas |
|---|
| 2 | |
|---|
| 3 | _experiment_type.sample_form powder |
|---|
| 4 | _experiment_type.beam_mode time-of-flight |
|---|
| 5 | _experiment_type.radiation_probe neutron |
|---|
| 6 | _experiment_type.scattering_type bragg |
|---|
| 7 | |
|---|
| 8 | _diffrn.ambient_temperature ? |
|---|
| 9 | _diffrn.ambient_pressure ? |
|---|
| 10 | _diffrn.ambient_magnetic_field ? |
|---|
| 11 | _diffrn.ambient_electric_field ? |
|---|
| 12 | |
|---|
| 13 | _calculator.type cryspy |
|---|
| 14 | |
|---|
| 15 | _peak.rise_alpha_0 0. |
|---|
| 16 | _peak.rise_alpha_1 0.0097 |
|---|
| 17 | _peak.decay_beta_0 0.0055 |
|---|
| 18 | _peak.decay_beta_1 0.0041 |
|---|
| 19 | _peak.broad_gauss_sigma_0 45137 |
|---|
| 20 | _peak.broad_gauss_sigma_1 -52394 |
|---|
| 21 | _peak.broad_gauss_sigma_2 22998 |
|---|
| 22 | _peak.broad_gauss_size_g 0. |
|---|
| 23 | _peak.broad_gauss_strain_g 0. |
|---|
| 24 | _peak.cutoff_fwhm 0. |
|---|
| 25 | _peak.type tof-jorgensen |
|---|
| 26 | |
|---|
| 27 | _instrument.setup_twotheta_bank 94.90931762 |
|---|
| 28 | _instrument.calib_d_to_tof_offset 0. |
|---|
| 29 | _instrument.calib_d_to_tof_linear 58724.76869981 |
|---|
| 30 | _instrument.calib_d_to_tof_quadratic 0. |
|---|
| 31 | _instrument.calib_d_to_tof_reciprocal 0. |
|---|
| 32 | |
|---|
| 33 | _absorption.type none |
|---|
| 34 | |
|---|
| 35 | loop_ |
|---|
| 36 | _linked_structure.structure_id |
|---|
| 37 | _linked_structure.scale |
|---|
| 38 | lbco 4. |
|---|
| 39 | si 0.2 |
|---|
| 40 | |
|---|
| 41 | loop_ |
|---|
| 42 | _excluded_region.id |
|---|
| 43 | _excluded_region.start |
|---|
| 44 | _excluded_region.end |
|---|
| 45 | 1 0. 40000 |
|---|
| 46 | 2 108000 200000 |
|---|
| 47 | |
|---|
| 48 | _background.type line-segment |
|---|
| 49 | |
|---|
| 50 | loop_ |
|---|
| 51 | _background.id |
|---|
| 52 | _background.position |
|---|
| 53 | _background.intensity |
|---|
| 54 | 1 45000 0.2 |
|---|
| 55 | 2 50000 0.2 |
|---|
| 56 | 3 55000 0.2 |
|---|
| 57 | 4 65000 0.2 |
|---|
| 58 | 5 70000 0.2 |
|---|
| 59 | 6 75000 0.2 |
|---|
| 60 | 7 80000 0.2 |
|---|
| 61 | 8 85000 0.2 |
|---|
| 62 | 9 90000 0.2 |
|---|
| 63 | 10 95000 0.2 |
|---|
| 64 | 11 100000 0.2 |
|---|
| 65 | 12 105000 0.2 |
|---|
| 66 | 13 110000 0.2 |
|---|
| 67 | |
|---|
| 68 | loop_ |
|---|
| 69 | _data.time_of_flight |
|---|
| 70 | _data.id |
|---|
| 71 | _data.d_spacing |
|---|
| 72 | _data.intensity_meas |
|---|
| 73 | _data.intensity_meas_su |
|---|
| 74 | _data.intensity_calc |
|---|
| 75 | _data.intensity_bkg |
|---|
| 76 | _data.calc_status |
|---|
| 77 | 41168.1286 1 0.70103518 0.21537107 0.02485114 0.21632254 0.2 incl |
|---|
| 78 | 41273.8536 2 0.70283552 0.26087313 0.03329888 0.24071375 0.2 incl |
|---|
| 79 | 41379.5785 3 0.70463587 0.30433686 0.03547088 0.27614644 0.2 incl |
|---|
| 80 | 41485.3035 4 0.70643622 0.47366708 0.04206284 0.30440757 0.2 incl |
|---|
| 81 | 41591.0285 5 0.70823657 0.6002652 0.04196648 0.30520219 0.2 incl |
|---|
| 82 | 41696.7534 6 0.71003691 0.60174483 0.03965186 0.27954292 0.2 incl |
|---|
| 83 | 41802.4784 7 0.71183726 0.50118258 0.03810349 0.24616907 0.2 incl |
|---|
| 84 | 41908.2034 8 0.71363761 0.37702264 0.03458906 0.22068129 0.2 incl |
|---|
| 85 | 42013.9284 9 0.71543795 0.27533183 0.03190951 0.20713221 0.2 incl |
|---|
| 86 | 42119.6533 10 0.7172383 0.26182311 0.02830043 0.20214356 0.2 incl |
|---|
| 87 | ... |
|---|
| 88 | 145835.8489 991 2.48337886 0.2240686 0.01131008 0.2 0.2 excl |
|---|
| 89 | 145941.5739 992 2.4851792 0.21377274 0.01070627 0.2 0.2 excl |
|---|
| 90 | 146047.2988 993 2.48697955 0.20927726 0.0108552 0.2 0.2 excl |
|---|
| 91 | 146153.0238 994 2.4887799 0.21839779 0.01091455 0.2 0.2 excl |
|---|
| 92 | 146258.7488 995 2.49058024 0.21613293 0.01104795 0.2 0.2 excl |
|---|
| 93 | 146364.4737 996 2.49238059 0.20571926 0.01109275 0.2 0.2 excl |
|---|
| 94 | 146470.1987 997 2.49418094 0.22615941 0.01142946 0.2 0.2 excl |
|---|
| 95 | 146575.9237 998 2.49598129 0.22113311 0.01151463 0.2 0.2 excl |
|---|
| 96 | 146681.6486 999 2.49778163 0.2086239 0.01097638 0.2 0.2 excl |
|---|
| 97 | 146787.3736 1000 2.49958198 0.20883912 0.01092893 0.2 0.2 excl |
|---|
| 98 | |
|---|
| 99 | loop_ |
|---|
| 100 | _refln.id |
|---|
| 101 | _refln.structure_id |
|---|
| 102 | _refln.d_spacing |
|---|
| 103 | _refln.sin_theta_over_lambda |
|---|
| 104 | _refln.index_h |
|---|
| 105 | _refln.index_k |
|---|
| 106 | _refln.index_l |
|---|
| 107 | _refln.f_calc |
|---|
| 108 | _refln.f_squared_calc |
|---|
| 109 | _refln.time_of_flight |
|---|
| 110 | 1 lbco 1.74006338 0.28734586 2 1 0 0.10595474 0.01122641 102184.81943898 |
|---|
| 111 | 2 lbco 1.58845327 0.31477161 2 1 1 0.39025607 0.1522998 93281.55106887 |
|---|
| 112 | 3 lbco 1.37564089 0.36346695 2 2 0 2.33500019 5.45222587 80784.19293006 |
|---|
| 113 | 4 lbco 1.29696667 0.38551492 2 2 1 0.06467317 0.00418262 76164.06751137 |
|---|
| 114 | 5 lbco 1.29696667 0.38551492 3 0 0 0.06467317 0.00418262 76164.06751137 |
|---|
| 115 | 6 lbco 1.23041061 0.40636841 3 1 0 0.42233682 0.17836839 72255.57875963 |
|---|
| 116 | 7 lbco 1.17315049 0.42620278 3 1 1 1.7530811 3.07329336 68892.99121159 |
|---|
| 117 | 8 lbco 1.12320608 0.44515429 2 2 2 2.19435299 4.81518503 65960.0173204 |
|---|
| 118 | 9 lbco 1.0791415 0.46333127 3 2 0 0.02740221 0.00075088 63372.3347908 |
|---|
| 119 | 10 lbco 1.03988677 0.48082158 3 2 1 0.45063705 0.20307375 61067.10981657 |
|---|
| 120 | ... |
|---|
| 121 | 42 si 0.85878923 0.58221503 6 2 0 0. 0. 50432.19895265 |
|---|
| 122 | 43 si 0.82828988 0.60365339 5 3 3 3.31928 11.01761972 48641.13190237 |
|---|
| 123 | 44 si 0.8188234 0.61063228 6 2 2 6.63856 44.07047887 48085.21499475 |
|---|
| 124 | 45 si 0.78396372 0.63778461 4 4 4 6.63856 44.07047887 46038.08831826 |
|---|
| 125 | 46 si 0.76055653 0.65741333 5 5 1 3.31928 11.01761972 44663.50610299 |
|---|
| 126 | 47 si 0.76055653 0.65741333 7 1 1 3.31928 11.01761972 44663.50610299 |
|---|
| 127 | 48 si 0.75320798 0.66382727 6 4 0 0. 0. 44231.96452271 |
|---|
| 128 | 49 si 0.72580937 0.68888612 6 4 2 0. 0. 42622.98752015 |
|---|
| 129 | 50 si 0.70711586 0.7070977 7 3 1 3.31928 11.01761972 41525.21546552 |
|---|
| 130 | 51 si 0.70711586 0.7070977 5 5 3 3.31928 11.01761972 41525.21546552 |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.experiments['mcstas'].show_as_text()"
]
},
{
"cell_type": "markdown",
"id": "55",
"metadata": {},
"source": [
"## π Perform Analysis\n",
"\n",
"This section outlines the analysis process, including how to configure\n",
"calculation and fitting engines.\n",
"\n",
"### Set Free Parameters\n",
"\n",
"Set structure parameters to be optimized."
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "56",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.569617Z",
"iopub.status.busy": "2026-06-30T22:33:10.569445Z",
"iopub.status.idle": "2026-06-30T22:33:10.573210Z",
"shell.execute_reply": "2026-06-30T22:33:10.572183Z"
}
},
"outputs": [],
"source": [
"structure_1.cell.length_a.free = True\n",
"structure_1.atom_sites['Co'].adp_iso.free = True\n",
"structure_1.atom_sites['O'].adp_iso.free = True\n",
"\n",
"structure_2.cell.length_a.free = True"
]
},
{
"cell_type": "markdown",
"id": "57",
"metadata": {},
"source": [
"Set experiment parameters to be optimized."
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "58",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.574977Z",
"iopub.status.busy": "2026-06-30T22:33:10.574731Z",
"iopub.status.idle": "2026-06-30T22:33:10.581927Z",
"shell.execute_reply": "2026-06-30T22:33:10.580988Z"
}
},
"outputs": [],
"source": [
"experiment.linked_structures['lbco'].scale.free = True\n",
"experiment.linked_structures['si'].scale.free = True\n",
"\n",
"experiment.peak.broad_gauss_sigma_0.free = True\n",
"experiment.peak.broad_gauss_sigma_1.free = True\n",
"experiment.peak.broad_gauss_sigma_2.free = True\n",
"\n",
"experiment.peak.rise_alpha_1.free = True\n",
"experiment.peak.decay_beta_0.free = True\n",
"experiment.peak.decay_beta_1.free = True\n",
"\n",
"for point in experiment.background:\n",
" point.intensity.free = True"
]
},
{
"cell_type": "markdown",
"id": "59",
"metadata": {},
"source": [
"### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "60",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:10.583731Z",
"iopub.status.busy": "2026-06-30T22:33:10.583562Z",
"iopub.status.idle": "2026-06-30T22:33:21.066043Z",
"shell.execute_reply": "2026-06-30T22:33:21.065322Z"
}
},
"outputs": [
{
"data": {
"text/html": [],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"(function() {\n",
" const button = document.getElementById('ed-fit-stop-5303ae0f3f9d4371bb5bb8c53cb7400c-button');\n",
" const status = document.getElementById('ed-fit-stop-5303ae0f3f9d4371bb5bb8c53cb7400c-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'mcstas'\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": [
" | iteration | time (s) | ΟΒ² | change / status |
|---|
| 1 | 1 | 0.04 | 480.81 | |
|---|
| 2 | 29 | 1.06 | 283.04 | 41.1% β |
|---|
| 3 | 57 | 2.28 | 37.92 | 86.6% β |
|---|
| 4 | 83 | 3.22 | 28.78 | 24.1% β |
|---|
| 5 | 84 | 3.26 | 28.43 | 1.2% β |
|---|
| 6 | 109 | 4.16 | 10.81 | 62.0% β |
|---|
| 7 | 135 | 5.33 | 9.64 | 10.8% β |
|---|
| 8 | 161 | 6.28 | 9.53 | 1.1% β |
|---|
| 9 | 243 | 9.82 | 9.53 | |
|---|
"
],
"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;36m9.53\u001b[0m at iteration \u001b[1;36m220\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β
Fitting complete.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βοΈ Settings used:\n"
]
},
{
"data": {
"text/html": [
" | Name | Value | Description |
|---|
| 1 | max_iterations | 1000 | Maximum solver iterations. |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π Least-squares fit results:\n"
]
},
{
"data": {
"text/html": [
" | Metric | Value |
|---|
| 1 | π§ͺ Minimizer | lmfit (leastsq) |
|---|
| 2 | β
Overall status | success |
|---|
| 3 | β±οΈ Fitting time (seconds) | 9.82 |
|---|
| 4 | π Iterations | 240 |
|---|
| 5 | π Goodness-of-fit (reduced ΟΒ²) | 9.53 |
|---|
| 6 | π R-factor (Rf, %) | 5.81 |
|---|
| 7 | π R-factor squared (RfΒ², %) | 5.35 |
|---|
| 8 | π Weighted R-factor (wR, %) | 4.92 |
|---|
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"π Refined parameters:\n"
]
},
{
"data": {
"text/html": [
" | datablock | category | entry | parameter | units | start | value | s.u. | change |
|---|
| 1 | lbco | cell | | length_a | Γ
| 3.8909 | 3.8905 | 0.0002 | 0.01 % β |
|---|
| 2 | lbco | atom_site | Co | adp_iso | Γ
Β² | 0.2567 | 0.2309 | 0.1435 | 10.05 % β |
|---|
| 3 | lbco | atom_site | O | adp_iso | Γ
Β² | 1.4041 | 2.1179 | 0.0478 | 50.84 % β |
|---|
| 4 | si | cell | | length_a | Γ
| 5.4315 | 5.4358 | 0.0019 | 0.08 % β |
|---|
| 5 | mcstas | linked_structure | lbco | scale | | 4.0000 | 28.9466 | 0.3453 | 623.66 % β |
|---|
| 6 | mcstas | linked_structure | si | scale | | 0.2000 | 0.0305 | 0.0026 | 84.77 % β |
|---|
| 7 | mcstas | peak | | rise_alpha_1 | ΞΌs/Γ
| 0.0097 | 0.0098 | 0.0004 | 0.58 % β |
|---|
| 8 | mcstas | peak | | decay_beta_0 | ΞΌs | 0.0055 | 0.0055 | 0.0002 | 0.85 % β |
|---|
| 9 | mcstas | peak | | decay_beta_1 | ΞΌs/Γ
| 0.0041 | 0.0043 | 0.0005 | 4.31 % β |
|---|
| 10 | mcstas | peak | | broad_gauss_sigma_0 | ΞΌsΒ² | 45137.0000 | 39762.7217 | 4803.0374 | 11.91 % β |
|---|
| 11 | mcstas | peak | | broad_gauss_sigma_1 | ΞΌs/Γ
| -52394.0000 | -43393.9085 | 6407.9091 | 17.18 % β |
|---|
| 12 | mcstas | peak | | broad_gauss_sigma_2 | ΞΌsΒ²/Γ
Β² | 22998.0000 | 19740.9596 | 2007.9207 | 14.16 % β |
|---|
| 13 | mcstas | background | 1 | intensity | | 0.2000 | 0.2568 | 0.0140 | 28.38 % β |
|---|
| 14 | mcstas | background | 2 | intensity | | 0.2000 | 0.2598 | 0.0137 | 29.91 % β |
|---|
| 15 | mcstas | background | 3 | intensity | | 0.2000 | 0.2674 | 0.0081 | 33.69 % β |
|---|
| 16 | mcstas | background | 4 | intensity | | 0.2000 | 0.2691 | 0.0062 | 34.57 % β |
|---|
| 17 | mcstas | background | 5 | intensity | | 0.2000 | 0.2498 | 0.0061 | 24.88 % β |
|---|
| 18 | mcstas | background | 6 | intensity | | 0.2000 | 0.2468 | 0.0047 | 23.40 % β |
|---|
| 19 | mcstas | background | 7 | intensity | | 0.2000 | 0.2451 | 0.0057 | 22.57 % β |
|---|
| 20 | mcstas | background | 8 | intensity | | 0.2000 | 0.2412 | 0.0036 | 20.60 % β |
|---|
| 21 | mcstas | background | 9 | intensity | | 0.2000 | 0.2229 | 0.0035 | 11.47 % β |
|---|
| 22 | mcstas | background | 10 | intensity | | 0.2000 | 0.2599 | 0.0043 | 29.93 % β |
|---|
| 23 | mcstas | background | 11 | intensity | | 0.2000 | 0.2276 | 0.0037 | 13.78 % β |
|---|
| 24 | mcstas | background | 12 | intensity | | 0.2000 | 0.2215 | 0.0045 | 10.75 % β |
|---|
| 25 | mcstas | background | 13 | intensity | | 0.2000 | 0.2244 | 0.0134 | 12.21 % β |
|---|
"
],
"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"
},
{
"data": {
"text/html": [
"\n",
"\n",
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.fit()\n",
"project.display.fit.results()\n",
"project.display.fit.correlations()"
]
},
{
"cell_type": "markdown",
"id": "61",
"metadata": {},
"source": [
"### Display Pattern"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "62",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:21.067817Z",
"iopub.status.busy": "2026-06-30T22:33:21.067662Z",
"iopub.status.idle": "2026-06-30T22:33:21.118307Z",
"shell.execute_reply": "2026-06-30T22:33:21.117389Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.display.pattern(expt_name='mcstas')"
]
},
{
"cell_type": "markdown",
"id": "63",
"metadata": {},
"source": [
"## πΎ Save Project"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "64",
"metadata": {
"execution": {
"iopub.execute_input": "2026-06-30T22:33:21.120072Z",
"iopub.status.busy": "2026-06-30T22:33:21.119903Z",
"iopub.status.idle": "2026-06-30T22:33:21.375921Z",
"shell.execute_reply": "2026-06-30T22:33:21.374956Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36mSaving project π¦ \u001b[0m\u001b[32m'lbco_si_mcstas'\u001b[0m\u001b[1;36m to \u001b[0m\u001b[32m'../../../projects/refine-lbco-si-mcstas'\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βββ π project.edi\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βββ π structures/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β βββ π lbco.edi\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β βββ π si.edi\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βββ π experiments/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β βββ π mcstas.edi\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βββ π analysis/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"β βββ π analysis.edi\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"βββ π reports/\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" βββ π lbco_si_mcstas.html\n"
]
}
],
"source": [
"project.save_as(dir_path='projects/refine-lbco-si-mcstas')"
]
}
],
"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
}