-
Notifications
You must be signed in to change notification settings - Fork 0
Install instructions
This page should detail how to install and setup G-TeCS and its sibling modules. If there are any issues contact me (MJD @martinjohndyer).
- Linux (tested with Ubuntu, operations use CentOS, others at your own risk), untested on MacOS/Windows but some bits might be usable
-
python3
(note: G-TeCS and the other modules are Py3 only) python3-pip
python3-devel
git
The GOTO telescope control code is split across multiple GitHub repositories, which are all inter-dependent:
-
gtecs-common
doesn't require any of the other packages to be installed, but it is a requirement of the others. -
gtecs-obs
contains the structure of the observation database and scheduling code, and only requiresgtecs-common
(and GOTO-tile, see below) -
gtecs-alert
contains code for handling transient alerts, and requiresgtecs-common
andgtecs-obs
(and GOTO-tile) -
gtecs-control
contains the telescope control code, and requires all three of the above (although that will change eventually - see https://github.com/GOTO-OBS/g-tecs/issues/496) as well as FLI-API (see below) -
gtecs-simulations
contains code for simulating the telescopes, and essentially replaces anything ingtecs-control
. It currently requires every other module.
There are two other modules that are sort of independent and therefore should be mentioned here:
- GOTO-tile is used for tiling the sky and handling event skymaps, but it tecnically doesn't do anything specific to GOTO. Therefore it's not part of G-TeCS, and ultimately I plan to refactor it into it's own public package (renaming it to remove GOTO).
- FLI-API is a Cython package to control the FLI cameras, it is separate from the main
gtecs-control
package as it has to be installed in a specific way.
If you want to get G-TeCS working fully I'd recommend installing in this order:
These instructions should install the entire system on a Linux machine, tested on a clean Ubuntu 18.04 LTS. If you're installing on an existing system odds are a lot of the requirements will already be installed, it assumes you have at least Python3, PIP and git.
GOTO-tile used to be a pain to install because it required Cartopy. That's been removed now, so this should work:
test@test:~$ git clone https://github.com/GOTO-OBS/goto-tile.git
...
test@test:~$ cd goto-tile
test@test:~$ pip3 install . --user
...
test@test:~$ gototile -s gn4 -gaussian 45 45 5 --plot
...
This should output a list of tiles and create an image in the current directory gaussian.png
with the tiles overlaid.
- If instead you get a message saying
gototile: command not found
it might be due to this annoying Ubuntu PATH bug: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562). Addexport PATH="$(systemd-path user-binaries):$PATH"
to your~/.bashrc
and try again. - If you get an error
fatal error: gsl/gsl_cblas.h: No such file or directory
when trying to installligo.skymap
then trysudo yum install gsl-devel
, orpip3 install ligo.skymap==0.2.2 --user
. It seems something changed in the update to 0.3.0, I don't know what (https://lscsoft.docs.ligo.org/ligo.skymap/changes.html).
ObsDB should be easy to install, but it's not much use without a database to query. It was initially written for MySQL, but I would now suggest MariaDB instead because that's what used on the computers on La Palma (so that's what it's been developed for now). Most distributions should have one or the other, and MariaDB has a very nice website for how to install it on all sorts of distributions: https://downloads.mariadb.org/mariadb/repositories/, it will give the specific commands. Once you you've added the repository do
test@test:~$ sudo apt update
...
test@test:~$ sudo apt install mariadb-server
... (this should include setting a root password)
At this point I'd also suggest running the secure setup command:
test@test:~$ sudo mysql_secure_installation
...
Once MariaDB/MySQL is installed you can clone the ObsDB repo and installing the module.
test@test:~$ git clone https://github.com/GOTO-OBS/goto-obsdb.git
...
test@test:~$ cd goto-obsdb
test@test:~$ pip3 install . --user
...
Then before testing you need to set up the database. You'll need to connect to the database manager and create the database using the schema provided within the repository.
test@test:~$ mysql -u root -p
...
MariaDB [(none)]> source schema.sql
...
Ideally that should be the only time you need to access the database directly unless you want to, I find using the Python module much easier than SQL. It can be useful however if you want to wipe the database and start from scratch, which I do a lot when testing, just run the source schema.sql
command again.
After that try running the test script provided within the repo:
test@test:~$ python3 obsdb/tests/test_database.py
...
Hopefully that will run through a load of test targets. It does expect an empty database though, so if you want to do it again redo the commands above.
To make sure the scripts are working and ObsDB and GOTO-tile are working correctly try the command add_allsky_survey 10 10 0 0
, which should create a 10x10 grid of tiles with no overlap and add their pointings into the database.
ObsDB does also have a config file, .obsdb.conf
, which you can use to change a few settings. You shouldn't need to use it though, unlike the modules below the defaults should be fine and there are no system-specific settings you need to change (e.g. file paths).
Thankfully GOTO-alert doesn't have any particular requirements, aside from the modules above. So if they are installed the below commands should work fine:
test@test:~$ git clone https://github.com/GOTO-OBS/goto-alert.git
...
test@test:~$ cd goto-alert
test@test:~$ pip3 install . --user
...
Before running the tests however you will need to create a config file and setup the directories used to save web pages created by GOTO-alert. To do this, copy the provided .gotoalert.conf
file to somewhere it can be found. Default and easiest is in your home directory, if you want it somewhere else you'll need to set the GOTOALERT_CONF
environment variable to point to the directory. Then when you've copied the file edit and change the HTML_PATH
to add where you'd like web pages to be saved.
After that's done run the provided setup_gotoalert.py
script to create the directory structure, it should explicitly print the directories and files created.
test@test:~$ pyhton3 setup_gotoalert.py
Finally now you can run the test script, and any web pages that are created will be added to the location specified by the HTML_PATH
you set before.
test@test:~$ python3 gotoalert/tests/test_gotoalert.py
This is an annoying one. FLI-API is the whole module to interface with the FLI cameras, it's written in Cython (a combination of C and Python) and unless you have the actual cameras you'd think you shouldn't need it. However it also includes simulated versions of the cameras, focusers and filter wheels which are useful if you want to run G-TeCS locally. So it's worth installing. Be aware this has ended up being Linux-only, although it's original reason for existing was to run on MacOS we had to switch back.
The following commands should install it. Note it does require Cython3, which if you're following this whole guide was installed as part of GOTO-tile. Also note you should run setup.py
explicitly instead of using PIP to install the module (because you need to compile the Cython code, which pip doesn't do correctly).
test@test:~$ git clone https://github.com/GOTO-OBS/fli-api.git
...
test@test:~$ cd fli-api/libfli-1.104
test@test:~$ make
...
test@test:~$ cd ../fliapi
test@test:~$ pip3 install pyudev --user
test@test:~$ python3 setup.py install --user
...
Once it's installed you can run the test_fliapi.py
script which should run through some tests on the fake focuser simulator (or a real one if you happen to have one attached).
test@test:~$ cd ..
test@test:~$ python3 test_fliapi.py
...
This the big one. G-TeCS is a complicated module to configure, so there are a few steps. Thankfully just installing it should be straightforward, although it might take a while to download all the requirements:
test@test:~$ git clone https://github.com/GOTO-OBS/g-tecs.git
...
test@test:~$ cd g-tecs
test@test:~$ pip3 install . --user
...
Once that's done you can check the scripts have been installed correctly by trying one of the commands, cam
for instance should print the camera daemon help text.
Then, just as with GOTO-alert, you need to create the config file and directories. Copy the default config file .gtecs.conf
from the git repository to wherever, either in your home or wherever GTECS_CONF
environment variable points. Then edit it and change the FILE_PATH
parameter to wherever you want G-TeCS system files to be saved (historically that's been /home/<username>/g-tecs-config/
). If you need the images to go somewhere separately then edit the IMAGE_PATH
too. G-TeCS has a lot of configuration parameters, some of which are already in the .gtecs.conf
file with test values.
Once that's set run the script setup_gtecs
. Hopefully this should create the directories and files needed by G-TeCS in the location defined by the above paths.
test@test:~$ pyhton3 setup_gtecs.py
Each of the daemons will create two log files, e.g. cam.log
and cam-stdout.log
. You can find them within the FILE_DIR/logs/
directory, or use the commands cam log
or cam log stdout
which are aliases to tail FILE_DIR/logs/cam.log
/tail FILE_DIR/logs/cam-stdout.log
. Therefore you can use tail
commands, e.g. cam log -n 50
shows the most recent 50 lines, while cam log -f
will auto-update.
To get started, try the command fli start
. This should start two interface daemons, that simulate the separate interfaces needed for four GOTO unit telescopes. Once it's started try fli ping
to check it's running, and fli info
to list the (fake) hardware units attached.
If fli
is working, then try filt start
followed by filt info
, which should show four fake filter wheels. Use filt home
and then filt set B
to move them to the position of the B filter, and filt info
to check. Thrilling. You can see all of the commands of a given daemon by just entering (e.g.) filt
or filt help
.
There are a lot of different parts to G-TeCS, so I really should write more about it! Out of the box the FLI daemons (fli
, cam
, foc
, filt
, exq
) should work with the simulators within FLI-API. dome
and power
also have fake units so should also work, and conditions
should have fake files for it to read. sentinel
and scheduler
likewise should work if you have a local database for them to talk to. The only one that's tricky is mnt
, the mount control daemon. That's built to talk to the SiTech controller which runs on Windows. I simulate that using a VirtualBox Windows instillation, I should write some instructions of how to get that working.
Finally here's a tip - there's a script lilith
that sends commands to all the daemons. So if you're playing around and want to shut down anything that's running lilith shutdown
is your answer.