TOMToolkit / tom_swift

Neil Gehrels Swift Observatory facility module for TOM Toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tom_swift

Note: This repository is under active development. It is a not-yet-functional, work in progress.

Neil Gehrels Swift Observatory facility module for TOM Toolkit. This module uses the Swift TOO API for all its interactions with the Swift Observatory. When installed and configured, your TOM can query target visibility, submit TOO observation requests to Swift, and check TOO observation status.

Swift TOO Prerequisites

In order to submit TOO requests to Swift, you must register with the Swift TOO system. Once you are registered and have logged in, you can get your shared secret, which you will use, along with your username, to make TOO requests. See the Configuration section below.

Installation

Install the module into your TOM environment:

pip install tom-swift

Add tom_swift.swift.SwiftFacility to the TOM_FACILITY_CLASSES in your TOM's settings.py:

    TOM_FACILITY_CLASSES = [
        'tom_observations.facilities.lco.LCOFacility',
        ...
        'tom_swift.swift.SwiftFacility',
    ]

Configuration

Include the following settings inside the FACILITIES dictionary inside settings.py:

    FACILITIES = {
        ...
        'SWIFT': {
            'SWIFT_USERNAME': os.getenv('SWIFT_USERNAME', 'anonymous'),
            'SWIFT_SHARED_SECRET': os.getenv('SWIFT_SHARED_SECRET', 'anonymous'),
        },
    }

If you followed the Prerequsites section above, then you have a Swift TOO username and shared secret. (Your shared secret is not your Swift TOO account password). Set environment variables SWIFT_USERNAME and SWIFT_SHARED_SECRET to your Swift TOO username and shared secret, respectively. (Do not check them into any software repository).

export SWIFT_USERNAME='<your Swift TOO usename>'
export SWIFT_SHARED_SECRET='<your Swift TOO shared secret>'

The settings.FACILITIES['Swift'] configuration dictionary above will get the values from the environment variables that you set. Your TOM will then use them to interact with the Swift TOO API.

About

Neil Gehrels Swift Observatory facility module for TOM Toolkit

License:GNU General Public License v3.0


Languages

Language:Python 100.0%