Welcome to the Treasure TROVE: a Tool for Rapid Object Vetting and Examination!
Documentation: https://datatrove.as.arizona.edu/docs/
Enter the Treasure TROVE: https://datatrove.as.arizona.edu/
- https://github.com/astro-trove/candidate_vetting
- https://github.com/astro-trove/trove-mpc
- https://github.com/phelipedarc/KilonovaSCORER
- https://github.com/SAGUARO-MMA/saguaro_tom
Prerequisites: Python 3.11 or 3.12 (django-autocomplete-light==4.0.0 requires 3.11+, and the tom-nonlocalizedevents dependency does not support 3.13+). A database connection is required for the application (reach out to existing developers or create a local PostgreSQL or SQLite database with sample data).
- Clone the repository:
% cd /var/www
% git clone https://github.com/astro-trove/trove.git- Copy settings_local.template.py to settings_local.py and edit as needed. At minimum, set
SECRET_KEY, and thePOSTGRES_*database settings so the app can connect. For local development you may setDEBUG = True. For certain functionality, you will need to talk to the TROVE team to find out how to set certain environmental variables (if you want to connect to a mirror of the production database).
% cd /var/www/trove/trove_tom
% cp settings_local.template.py settings_local.py
% vi settings_local.py- Create virtual environment and install dependencies.
Option A — Conda (from the project root, so requirements.txt is found):
% cd /var/www/trove
% conda env create -f environment.yml
% conda activate troveOption B — venv + pip:
% cd /var/www/trove
% python3 -m venv venv # name venv whatever you want, e.g., trove
% source venv/bin/activate
% pip install --upgrade pip
% pip install -r requirements.txt- Apply migrations. Use PostgreSQL for the database; the project's migrations are not fully compatible with SQLite (e.g.
tom_nonlocalizedevents.0016can raise "near None: syntax error" on SQLite). On a fresh database, the packaged migrationtom_targets.0025(RunPython) can run beforeguardianortrove_targetsexist in the migration state, and faking it can triggerpost_migratebeforetom_commonis applied (causing "no such table: tom_common_profile"). So run a full migrate first (it will fail on 0025), then fake 0025, then migrate again:
% python3 manage.py migrateIf you use SQLite, run python manage.py repair_migrate instead of migrate alone. It creates missing tables (e.g. tom_nonlocalizedevents_superevent), fakes renames when the target table already exists, and retries migrate by faking any migration that fails with "table already exists" or "no such column" until migrate succeeds. For one-off fixes you can still use python manage.py repair_superevent_table then migrate. Prefer PostgreSQL to avoid these issues.
- Run the development server. Milky Way extinction uses a cached SFD dust map if present; otherwise
mwebvdefaults to 0. To download the map once, run withFETCH_DUSTMAPS=1(network access required). CI setsSKIP_DUSTMAP=1so tests never depend on that download.
% python3 manage.py collectstatic # only the first time you start the development server
% python3 manage.py runserverThen open http://127.0.0.1:8000/ or http://localhost:8000/ in your browser to view the TROVE. If you use PostgreSQL, create the database first (e.g. createdb trove) and set the POSTGRES_* values in settings_local.py to match.
This is basically only necessary for a production environment.
Enable WSGI within Apache2 in the usual way (there are plenty of web tutorials on this).
Edit trove.conf and trove-ssl.conf as you see fit to reflect your source
code directory and security certificates. You should probably rename 'localhost' to something
more suitable. If you do, you will also need to add that name to /etc/hosts and set
ALLOWED_HOST in settings_local.py. If you are hosting from a subdomain, you must also set
FORCE_SCRIPT_NAME in settings_local.py.
Then (as root) enable the sites:
% cd /var/www/trove
% cp trove.conf /etc/apache2/sites-available/
% cp trove-ssl.conf /etc/apache2/sites-available/
% cd /etc/apache2/sites-available/
% apache2ctl configtest
% a2ensite trove.conf
% a2ensite trove-ssl.conf
% service apache2 restartSee https://github.com/SAGUARO-MMA/saguaro_tom .
If you use TROVE, please cite the following: