Skip to content

Repository files navigation

Volcano deformation

Flask based website to display University of Miami geodesylab volcano displacement timeseries data.

Repository copy vs production on the server

Location Role
$MINSAR_HOME/tools/VolcDef_web (this repo) Where you edit code in development (e.g. under minsar/tools/VolcDef_web).
/var/www/VolcDef_web What Apache/WSGI actually runs (web.wsgi, volcdef_web/app.py, web_env).

Changes made in the MinSAR repo are not live until you deploy them to /var/www/VolcDef_web, for example:

# Example: sync Python package (adjust host/user as needed)
sudo rsync -a --delete /path/to/minsar/tools/VolcDef_web/volcdef_web/ /var/www/VolcDef_web/volcdef_web/
sudo systemctl reload apache2

Or maintain /var/www/VolcDef_web as a git clone / git pull of VolcDef_web and pull on the server after merging changes from the minsar copy. c## Installation

  1. Go to /var/www/ and clone the repository (on a new server you may need your private and public key in ~/.ssh for git to work)
git clone git@github.com:geodesymiami/VolcDef_web
git clone git@github.com:geodesymiami/webconfig

(preferred), or if cloned into the $MINSAR_HOME/tools directory create a symbolic link:

sudo ln -s /home/exouser/code/minsar/tools/VolcDef_web /var/www
  1. Install the required packages into a virtual environment (first adjust ownership):
USER=exouser
sudo chown -R $USER:$USER /var/www/VolcDef_web

python -m venv web_env
source web_env/bin/activate
pip install -r requirements.txt
  1. Make sure the MAPBOX_ACCESS_TOKEN is set in mapbox_access_token.env (or cp ~/accounts/mapbox_access_token.env .).

  2. Volcano list (production)
    The app uses /var/www/webconfig/volcanoes_volcdef.json (if not available sibling ../webconfig/volcanoes_volcdef.json, then WEBCONFIG_DIR/volcanoes_volcdef.json. See volcdef_web/app.py (get_volcanoes_json_path). SetEnv WEBCONFIG_DIR /var/www/webconfig is set involcdef_web.conf.

  3. Run the website

cd volcdef_web/
python run.py
  1. Check whether website is running using
curl -s http://127.0.0.1:5001

or open website at the given address (chrome/safari)

127.0.0.1:5001
  1. On the remote server, configure Apache by copying volcdef_web.conf to /etc/apache2/sites-available/ (sudo cp volcdef_web.conf /etc/apache2/sites-available/)((Ubuntu, /etc/httpd/conf.d for Alma/RedHat) (use volcdef_web.conf_jetstream is /data/HDFEOS5 lives on server running Apache).

  2. Start Apache using:

sudo a2ensite volcdef_web.conf
sudo systemctl restart apache2
  1. Check for errors using:
sudo tail -20 /var/log/apache2/error.log

If you see a Traceback, then python could not properly run your web.wsgi or app.py.

Update volcano list

To update the volcano allowlist/metadata, go to /var/www/webconfig and git pull, or regenerate:

cd /var/www/VolcDef_web/volcdef_web
python3 make_volcdef_volcanoes_json.py --outdir /var/www/webconfig
sudo systemctl restart apache2

HDF5EOS product discovery (automatic)

/api/volcanoes expands each HDF5EOS volcano entry by scanning /data/HDF5EOS/<Volcano>/ for subdirs starting with miaplpy, mintpy, sarvey, dolphin, opera, or egms.

  • Preferred volcdef_link in Excel/JSON: http://HOST/data/HDF5EOS/Fernandina/
  • Also accepted: .../Fernandina/miaplpy, .../mintpy/overlay.html, etc. (volcano folder is parsed from the URL)
  • New product folders appear on the map without editing Excel (cache TTL ~60s; set VOLCDEF_EXPAND_CACHE_TTL)
  • Optional offline materialize: python3 make_volcdef_volcanoes_json.py --outdir /var/www/webconfig --expand-hdf5eos /data/HDF5EOS

One Excel/JSON row per volcano is enough; multi-product rows for the same folder are merged and re-expanded from disk.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages