Jupyter notebook visualization example ready.
This commit is contained in:
11
analysis/python/jupyter/README.md
Normal file
11
analysis/python/jupyter/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Setting up a remote jupyter session
|
||||
|
||||
1. In remote machine write: `jupyter notebook --no-browser --port=8889`
|
||||
|
||||
2. In the local machine write: `ssh -N -L localhost:8888:localhost:8889 username@remote.machine`
|
||||
|
||||
3. Access jupyter seession with a browser: `http://localhost:8888`
|
||||
|
||||
Now it should work.
|
||||
|
||||
*PLEASE NOTE: Never commit `.ipyb` files without clearing them to the github repo.*
|
87
analysis/python/jupyter/notebook_example.ipynb
Normal file
87
analysis/python/jupyter/notebook_example.ipynb
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import astar.data as ad\n",
|
||||
"import astar.visual as vis\n",
|
||||
"#import pylab as plt \n",
|
||||
"#import numpy as np "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Here we read data from the run directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"imesh = 0\n",
|
||||
"meshdir = \"/scratch/data/mvaisala/iotest/\"\n",
|
||||
"mesh = ad.read.Mesh(imesh, fdir=meshdir)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Example visualization funtion call. "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$', bitmap = False, fname = 'uux')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"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.7.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
Reference in New Issue
Block a user