Skip to content

Commit

Permalink
Refs #82. explicitly import mantid in example notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
yxqd committed Jan 29, 2018
1 parent a65dcf0 commit 47a4e57
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 32 deletions.
60 changes: 44 additions & 16 deletions examples/getdos2-V_Ei120meV-noUI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Get python tools ready"
"Get python tools ready. This may takes a while"
]
},
{
Expand All @@ -50,7 +50,7 @@
"from matplotlib import pyplot as plt\n",
"%matplotlib notebook\n",
"# %matplotlib inline\n",
"\n",
"import mantid\n",
"from multiphonon import getdos\n",
"from multiphonon.sqe import plot as plot_sqe"
]
Expand All @@ -65,7 +65,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"projectdir = os.path.abspath('./V_Ei120meV-noUI')\n",
Expand Down Expand Up @@ -93,7 +95,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"dest = 'ARCS_V_annulus.nxs'\n",
Expand All @@ -112,7 +116,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%%time\n",
Expand All @@ -129,7 +135,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ls"
Expand Down Expand Up @@ -225,7 +233,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%%time\n",
Expand All @@ -238,7 +248,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ls -tl {workdir}/{iqe_h5}"
Expand All @@ -254,7 +266,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"iqe = hh.load(os.path.join(workdir, iqe_h5))\n",
Expand Down Expand Up @@ -286,7 +300,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"iqe2 = iqe.copy()\n",
Expand Down Expand Up @@ -328,7 +344,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for msg in getdos.getDOS(\n",
Expand Down Expand Up @@ -362,7 +380,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ls {workdir}/"
Expand All @@ -378,7 +398,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"dos = hh.load(os.path.join(workdir, 'final-dos.h5'))\n",
Expand Down Expand Up @@ -410,7 +432,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(5,3))\n",
Expand All @@ -421,7 +445,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(6,4))\n",
Expand All @@ -431,7 +457,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(8, 4))\n",
Expand Down
61 changes: 45 additions & 16 deletions examples/getdos2-V_Ei120meV.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Get python tools ready"
"Get python tools ready, this may take a while"
]
},
{
Expand All @@ -54,7 +54,7 @@
"from matplotlib import pyplot as plt\n",
"%matplotlib notebook\n",
"# %matplotlib inline\n",
"\n",
"import mantid\n",
"from multiphonon.sqe import plot as plot_sqe\n",
"from multiphonon.ui.getdos import Context, NxsWizardStart, QEGridWizardStart, GetDOSWizStart"
]
Expand Down Expand Up @@ -89,7 +89,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"workdir = os.path.abspath('./V_Ei120meV')\n",
Expand Down Expand Up @@ -135,7 +137,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"dest = 'ARCS_V_annulus.nxs'\n",
Expand All @@ -154,7 +158,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%%time\n",
Expand All @@ -171,7 +177,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ls"
Expand Down Expand Up @@ -225,7 +233,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"NxsWizardStart(context).show()"
Expand Down Expand Up @@ -276,7 +286,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"QEGridWizardStart(context).show()"
Expand All @@ -292,7 +304,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%%script bash\n",
Expand All @@ -309,7 +323,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"iqe = hh.load('work/iqe.h5')\n",
Expand Down Expand Up @@ -342,7 +358,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"iqe2 = iqe.copy()\n",
Expand Down Expand Up @@ -406,6 +424,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -467,7 +486,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ls work/"
Expand All @@ -483,7 +504,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"dos = hh.load('work/final-dos.h5')\n",
Expand Down Expand Up @@ -515,7 +538,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(5,3))\n",
Expand All @@ -525,7 +550,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(6,4))\n",
Expand All @@ -535,7 +562,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"plt.figure(figsize=(8, 4))\n",
Expand Down

0 comments on commit 47a4e57

Please sign in to comment.