European Southern Obervatory Facility module for TOM Toolkit
NOTE: This TOM Toolkit facility module is in the prototype stage. Any type of feedback is greatly appreciated. Please feel free to create an Issue.
This module is designed mainly to facilitate getting Target and Observation data from your TOM to the ESO P2 Tool (without having to re-enter it). Submitting observations is still expected to be done through the P2 Tool itself.
This facility is still in prototype stage and feature requests are welcome. Please let us know your use cases.
-
Install the module into your TOM environment:
pip install tom-eso
You'll want to update your pyproject.toml or requirements.txt file as well.
-
In your project
settings.py, addtom_esoto yourINSTALLED_APPSsetting:INSTALLED_APPS = [ ... 'tom_eso', ]
-
Add
tom_eso.eso.ESOFacilityto theTOM_FACILITY_CLASSESin your TOM'ssettings.py:TOM_FACILITY_CLASSES = [ 'tom_observations.facilities.lco.LCOFacility', ... 'tom_eso.eso.ESOFacility', ]
-
Create the ESOProfile tables in your database:
$ ./manage.py migrate
After installation, each user will have an ESOProfile card in their TOM user profile where they can
enter their ESO P2 Tool username and password and set the ESO environment to Demo, Production,
or Production La Silla.
If a TOM admin wants to have a single default set of ESO credentials accessible by all of their TOM's users, they can
include the following to thier settings.py:
FACILITIES = {
...
# defaults set from ESO p2 API Tutorial
# https://www.eso.org/sci/observing/phase2/p2intro/Phase2API/api--python-programming-tutorial.html
# You should have your own credentials.
'ESO': {
'environment': os.getenv('ESO_ENVIRONMENT', 'demo'),
'username': os.getenv('ESO_USERNAME', '52052'),
'password': os.getenv('ESO_PASSWORD', 'tutorial'),
},
}Note: The user specific credentials will always take precendence over these TOM-wide defaults.