A Tornado baseds server for sending your simulation data.
You must locally host a python server on at each place where you have simulation data you would like to access. The server should be only locally hosted with port-forwarding to access from your computer. To start the server, clone the git directory to a folder in a location where you have read access to simulation data.
To run the server on tigressdata, e.g.
$ module load anaconda3
$ python app.py 50111
This will start a python instance that opens a socket on 127.0.0.1:5011. To access the server from your local machine, you must use port forwarding. e.g.
$ ssh -N -f -L localhost:8080:localhost:50111 [email protected]
The above code makes it so you can access the IseultServer interface by opening your browser and pointing to localhost:8080.
The python code that provides the RESTful api is located in the ./src/ directory. You can easily make new APIs for different simulations using ./src/tristan_sim.py as a starting point.
The data will eventually be visualized with Iseult.js—a javascript front-end for the server located here: http://github.com/pcrumley/IseultJS The directory is private for now, but I plan on hosting it online when it is further along.
Right now, it's not very useful as it is still in heavy development, but you can play around by manually editing the urls to handle the calls.
Watch this space!
It is recommended to setup a virtual python environment to keep all the right dependencies. You can either do this with anaconda, or with pip.
You can create a virtual environment with anaconda using the following command:
$ conda create -n yourenvname python=3.6 anaconda
$ source activate yourenvname
Note this will create a new directory .conda
in your current directory that contains all the packages necessary for the environment. It is recommended you choose a directory that has reasonable storage quota (many clusters limit the home directory to a very small quota). To install the dependencies, use the following command:
$ conda install --yes --file requirements.txt
Now you should have all the required python packages installed to run the server. To exit from the virtual environment, use
$ source deactivate
Anaconda is the easier way to get numba installed on your machine since is include prebuilt binaries for llvmlite. If you prefer to use pip, you must first build llvmlite yourself or install it via anaconda. See here for details http://llvmlite.pydata.org/en/latest/admin-guide/install.html
Then, you need the python package virtualenv
installed. To create a virtual environment, use the following commands:
$ virtualenv yourenvname
$ source ./yourenvname/bin/activate
Similar to the conda solution, this creates a directory under the current path that contains the necessary package and environment files. To install the dependencies, use:
$ pip install -r requirements.txt
To exit the environment, simply use:
$ deactivate
Add access to field & spectral quantities. Make rendering images more efficient by not rendering full image then resizing as is currently done ....
Dependencies: |
---|
Matplotlib — (just for colormaps) |
Python 3.6—http://python.org |
pyZMQ—https://github.com/zeromq/pyzmq/ |
NumPy—http://numpy.org |
Numba—http://numba.pydata.org/ |
Pillow—http://pillow.readthedocs.io/en/3.1.x/installation.html |
h5py—http://h5py.org |
These things are in the default anaconda package. If the installation becomes more complicated I will detail it here.