G-TeCS (gee-teks) is the GOTO Telescope Control System.
This package (gtecs-alert) contains functions for receiving and processing transient alerts.
Note this module is Python3 only and has been developed for Linux, otherwise use at your own risk.
This package requires several Python modules, which should be included during installation.
This package requires the following G-TeCS packages to function fully:
It also requires the following packages created for GOTO:
Once you've downloaded or cloned the repository, in the base directory run:
pip3 install . --user
You should then be able to import the module from within Python.
Several scripts from the scripts folder should also be added to your path, in particular the sentinel script which will listen for live GCN alerts (see Usage below).
You'll need to make sure PostgreSQL is installed and configured before setting up the database. The config file contains parameters for the user and password to use when interacting with the database, make sure you create this user with rights first (e.g. sudo -u postgres createuser -edP gtecs) (a useful hint from https://stackoverflow.com/a/26735105: edit /etc/postgresql/12/main/pg_hba.conf to change local all all peer to local all all md5 to remove the annoying user bits, then restart sudo service postgresql restart).
Then you can create the database with createdb -O gtecs gtecs, or just log into PostgreSQL as the gtecs user and run CREATE DATABASE gtecs;.
Database migrations are handled using Alembic, which should be installed as part of the package. To create the initial database schema, run:
alembic upgrade head
The module will look for a file named .alert.conf either in the user's home directory, the gtecs subdirectory, or a path specified by the GTECS_CONF environment variable. An example file is included in the base directory of this repository.
To use the newer GCN Kafka streams (https://gcn.nasa.gov) you will need to register here using https://gcn.nasa.gov/quickstart and get a client ID and secret, then add them to your config file.
After installing the module, you can test it works correctly using the included test_gotoalert.py script in the gotoalert/tests/ directory.
To run the sentinel alert listener after the package is installed the script can be started with.
sentinel start
For a list of arguments use sentinel help.
To have the sentinel run continuously as a system service edit the sentinel.service file to add your username (the default is goto, note you need to edit both the User= and ExecStart= entries), then copy it to the right location with
sudo cp sentinel.service /etc/systemd/system/
Then enable and start the service with
sudo systemctl enable sentinel
sudo systemctl start sentinel