Database Details
Setup and Login
First connect to midden via `ssh username@midden.anu.edu.au`, then navigate to the website codebase via `cd /priv/debass/website` and activate the website conda environment via `conda activate ./venv`. Then, to get to the database codebase `cd debass/database`.
Database Files
- `models.py`: Contains implementation details of objects that can populate the database. Currently includes:
- `Log`: A log file
- `Supernova`: A supernova with a name, url, and human classification file (notes.txt).
- `Observation`: A specific observation of a supernova, contains the date of the observation, and a link to the supernova.
- `Version`: The pipeline version number of the obsevation. Contains the version number and a link to the observation.
- `Metadata`: The pipeline metadata version number. Contains the metadata version number and a link to the version.
- `Data`: The actual data of the observersion. Contains a link to the metadata version number (which links all the way back up to the supernova) and the following datum:
- Observer Name
- Whether the observation was a ToO
- The amount of ToO time used
- The program affected by the ToO
- Who reduced the data
- The date of reduction
- The p12_SN.fits file
- The p12_SN.dats file
- The p12_HOST.fits file
- The p12_host.dat file
- Marz host z
- Marz qop
- Superfit SN z
- Superfit type
- Superfit likelihood number
- Superfit plot
- Dash parameter 1
- Dash parameter 2
- SNFIT parameter 1
- SNFIT parameter 2
- `admin.py`: Register models here so that an admin (Patrick) can manually modify them if things go wrong.
- `./management/commands/`: Contains scripts which can be used to interact with the database. Called by navigating to `/priv/debass/website/debass` and running `./manage.py script_name`. Currently includes:
- `database_status.py`: Read through `/priv/debass/database/reduced` and compare the physical database with the online database. Finds missing and out of date supernovae.
- `clear_database.py`: Remove all supernovae from the database. Mostly used for cleaning things up if something went wrong during development.
- `clean_update_database.py`: Remove all supernovae and reingest. Takes a long time, but ensures everything is correct.
- `update_database.py`: Find changes between the state of the online database and the local database and update the differences. This is run daily.
- `./templates/database/`: Contains html templates for pages within the database. Of particular interest in `supernova_detail.html` which are the pages containing information on specific supernovae.