Get Database Statistics
Get Database Statistics
This is a small script which allows you to calculate per-proposal statistics including hours used, number of objects, what objects are observed, start date, and end date.
The script lives in /priv/debass/software/get_stats. To run, first make sure you've activated the debass conda environment: conda activate /priv/debass/website/venv then cd into the get_stats directory and run python get_obs_stats.py.
If the script has not been run yet, it will read through all objects in /priv/debass/database/reduced, loading various information into a python dictionary. The script will then save this dictionary to stats.pkl. If that file exists, the script will skip reading the database and just use that file (thus if you wish to reread the database, delete this file).
After the dictionary has been created, the data is written to stats.txt in a useful format which lists:
Proposal ID
Number of targets
Name of targets
Date of first observation
Date of last observation
Filepath of first observation
Filepath of last observation
Total time used by Proposal
The script also calculates the total number of observations and the total number of targets.