Skip to content

Commit 47cbedd

Browse files
authored
Merge pull request #1402 from TOMToolkit/default-redirect-facility
Default to LCORedirect facility for new TOMS
2 parents ae31a03 + 8873314 commit 47cbedd

4 files changed

Lines changed: 40 additions & 4 deletions

File tree

docs/api/tom_observations/facilities.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ Gemini
1717
:members:
1818

1919

20+
************************
21+
LCO/SOAR/Blanco Redirect
22+
************************
23+
24+
.. automodule:: tom_observations.facilities.lco_redirect
25+
:members:
26+
2027
***********************
2128
Las Cumbres Observatory
2229
***********************
2330

2431
.. automodule:: tom_observations.facilities.lco
2532
:members:
26-
2733

2834
****
2935
SOAR

tom_base/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213

214214

215215
TOM_FACILITY_CLASSES = [
216+
'tom_observations.facilities.lco_redirect.LCORedirectFacility',
216217
'tom_observations.facilities.lco.LCOFacility',
217218
'tom_observations.facilities.gemini.GEMFacility',
218219
'tom_observations.facilities.soar.SOARFacility',

tom_observations/facilities/lco_redirect.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,37 @@
1515

1616

1717
class LCORedirectFacility(BaseRedirectObservationFacility):
18+
"""
19+
The ``LCORedirectFacility`` is a little different from the other TOMToolkit Facilities. This facility temporarily
20+
redirects users from the TOM to the LCO observing portal, providing them with full access to the observation request
21+
options provided by that interface. Once the observation, or group of observations, are submitted, the user is
22+
redirected back to the TOM. The user must have access to the LCO observing portal, but will log in with their own
23+
credentials, rather than those stored by the TOM. In order to retrieve the observations, the TOM must have access
24+
to an LCO API token with permission to access the relevant proposals.
25+
26+
For more information on submitting to LCO, Soar, or Blanco, see the
27+
`LCO Documentation <https://lco.global/documentation/>`__ .
28+
To use this facility you will need to add it to your `TOM_FACILITY_CLASSES` list in ``settings.py`` and have an
29+
`api_key` in your `LCO` dictionary in `FACILITIES`:
30+
31+
32+
.. code-block:: python
33+
:caption: settings.py
34+
35+
TOM_FACILITY_CLASSES = [
36+
...
37+
'tom_observations.facilities.LCORedirectFacility',
38+
...
39+
]
40+
41+
FACILITIES = {
42+
'LCO': {
43+
'portal_url': 'https://observe.lco.global',
44+
'api_key': os.getenv('LCO_API_KEY'),
45+
},
46+
}
47+
48+
"""
1849
name = "LCORedirect"
1950
observation_types = [("Default", "")]
2051
button_label = "LCO/SOAR/BLANCO"

tom_setup/templates/tom_setup/settings.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@ DATA_PROCESSORS = {
266266
}
267267

268268
TOM_FACILITY_CLASSES = [
269-
'tom_observations.facilities.lco.LCOFacility',
269+
'tom_observations.facilities.lco_redirect.LCORedirectFacility',
270270
'tom_observations.facilities.gemini.GEMFacility',
271-
'tom_observations.facilities.soar.SOARFacility',
272-
'tom_observations.facilities.blanco.BLANCOFacility',
273271
]
274272

275273
TOM_ALERT_CLASSES = [

0 commit comments

Comments
 (0)