Prerequisites

In order to run this sample code, you will need Python >= 3.8 on a Unix-like operating system (Linux or macOS) and a few third-party Python packages.

Python Packages

If you want to consume notices over Kafka (recommended), you will need one of either:

Note

The Kafka servers hosted by GCN Kafka and HOPSKOTCH should be accessible using any Kafka client, however we will only provide directions in this guide that use gcn-kafka for the former and hop-client for the latter.

If you want to consume notices from GCN Classic, you will need:

The following libraries are needed for working with the sky maps associated with notices:

Installation

The fastest way to install the dependencies is with pip, a package manager that comes with most Python distributions. Another option is the Anaconda Python distribution.

Pip

Run the following command to install gcn-kafka and the packages needed to work with sky maps:

$ pip install gcn-kafka healpy

Run the following command to install hop-client and the packages needed to work with sky maps:

$ pip install hop-client healpy

Run the following command to install PyGCN, lxml, and the packages needed to work with sky maps:

$ pip install pygcn healpy

Anaconda

To install these packages using Anaconda, first install conda.

Run the following command to install gcn-kafka and the packages needed to work with sky maps:

$ conda install -c conda-forge gcn-kafka healpy

Run the following command to install hop-client and the packages needed to work with sky maps:

$ conda install -c conda-forge hop-client healpy

Run the following command to install PyGCN, lxml, and the packages needed to work with sky maps:

$ conda install -c conda-forge pygcn healpy