## http://heliopropa.irap.omp.eu # What ### Rationale - Reading NetCDF from javascript is doable, but still *very* hacky. - The bridge can handle pagination and collecting multiple NetCDF into one CSV. # How ## Source https://gitlab.irap.omp.eu/CDPP/SPACEWEATHERONLINE ## Install ### Prerequisites gcc libncurses-dev python3 python3-virtualenv libapache2-mod-wsgi-py3 ### CentOs 6 Shenanigans ``` bash yum install https://centos6.iuscommunity.org/ius-release.rpm yum install python27* ``` But then `virtualenv` yields ``` File "/var/www/html/HELIOPROPA/web/run.py", line 24, in [Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from netCDF4 import Dataset, date2num [Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] File "/var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/__init__.py", line 3, in [Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] from ._netCDF4 import * [Fri Nov 30 14:30:38 2018] [error] [client 10.10.135.119] ImportError: /var/www/html/HELIOPROPA/venv/lib/python2.7/site-packages/netCDF4/_netCDF4.so: undefined symbol: PyUnicodeUCS2_FromStringAndSize ``` _Solution:_ Configure Apache to use `web/run_ssa.wsgi` and use pip2.7 install system wide. ### Install libcdf. ``` bash wget https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf38_1/cdf38_1-dist-all.tar.gz tar -xzvf cdf38_1-dist-all.tar.gz cd cdf38_1-dist make all OS=linux ENV=gnu make INSTALLDIR=/usr/local/lib/libcdf install ``` ## Troubleshoot ### 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 ```