Web Server

Build and serve heliopropa's visualizations. It's a flask webserver, serving d3.js plots. It also gathers NetCDF data from AMDA, and serves it as CSV to the plotter.


  • Reading NetCDF from javascript is doable, but still very hacky.
  • The bridge can handle pagination and collecting multiple NetCDF into one CSV.




  • config.yml : the main configuration file.
  • web/ : the front controller, holding most of the code.
  • web/run.log : you'll find more information about failures in the log.
  • web/view/home.html.jinja2 : the HTML template.
  • web/static/js/ : most of the javascript client-side.


virtualenv venv
source venv/bin/activate
pip install matplotlib
pip install numpy==1.8.*
pip install -r requirements.txt

CentOs 6 Shenanigans

yum install
yum install python27*

But then virtualenv yields

File "/var/www/html/HELIOPROPA/web/", line 24, in <module>
[Fri Nov 30 14:30:38 2018] [error] [client]     from netCDF4 import Dataset, date2num
[Fri Nov 30 14:30:38 2018] [error] [client]   File "/var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/", line 3, in <module>
[Fri Nov 30 14:30:38 2018] [error] [client]     from ._netCDF4 import *
[Fri Nov 30 14:30:38 2018] [error] [client] ImportError: /var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/ undefined symbol: PyUnicodeUCS2_FromStringAndSize

Solution: Configure Apache to use web/run_ssa.wsgi and use pip2.7 install system wide.

Install libcdf.

tar -xzvf cdf37_0-dist-all.tar.gz
cd cdf37_0-dist
make all OS=linux ENV=gnu
make INSTALLDIR=/usr/local/lib/libcdf install


source venv/bin/activate
DEBUG=true python web/

Then, browse localhost:5000.


Installing scipy

Getting MemoryErrors ? Try with the --no-cache-dir option.

pip install scipy --no-cache-dir

Fix permissions problems with the cache

sudo setfacl  -R -m u:apache:rwx -m u:`whoami`:rwx cache
sudo setfacl -dR -m u:apache:rwx -m u:`whoami`:rwx cache