{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# Analysing simulation results\n",
"\n",
"With `micromagneticdata` we can analyse simulation results created with `oommfc`. This notebook summarises the available functionality."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"import micromagneticdata as md"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We have a set of example simulations stored in the test directory of `micromagneticdata` that we use to demonstrate its functionality."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"dirname = os.path.join(\"..\", \"micromagneticdata\", \"tests\", \"test_sample\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## `Data`\n",
"First, we creata a `Data` object. We need to pass the name of the `micromagneticmodel.System` that we used to run the simulation and optionally an additional path to the base directory."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"data = md.Data(name=\"system_name\", dirname=dirname)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The `Data` object contains all simulation runs of the `System`. These are called drives."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"