Skip to content

Introduction

chime-frb-api is a python library for connecting with the CHIME/FRB backends. It is built on top of the requests python package and provides a secure access through the use of JSON Web Tokens (JWT).

Here is some of the functionality access chime-frb-api offers:

  • Realtime pipeline triggers
  • Injection backend
  • Verified astrophysical sources
  • General software parameters
  • Calibrated data products
  • Support for inter-pipeline communication via distributors

chime-frb-api aims to keep easy-of-use for scientific developers as its core foundation. Here is an example of what that means:

from chime_frb_api.backends import frb_master

master = frb_master.FRBMaster()
master.events.get_event(9386707)
{
    "beam_numbers": [166, 1166],
    "event_type": "EXTRAGALACTIC",
    "fpga_time": 39927134208,
    id: 9386707,
}

A few things happened here so lets break them down:

  1. We connect to the frb_master backend from chime-frb-api
from chime_frb_api.backends import frb_master

master = frb_master.FRBMaster()

Behind the scences, chime-frb-api connects to the CHIME/FRB DRAO Backend by starting a requests session.

Info

chime-frb-api is recogonizes when you are using it from within a site network, before accessing backends through public ip addresses.

  1. chime-frb-api then authenticates with the backend. Underneath the hood, it contacts the backend with your ACCESS_TOKEN/REFRESH_TOKEN. It then uses these tokens to authenticate the actual API request made to the backend to ask for events parameters. For in-depth documentation on authenticaion, see here.

  2. We ask the Events API to fetch us the parameters for the event id 9386707.

master.events.get_event(9386707)
  1. Once authenticated, the CHIME/FRB backend replies with the event parameters,
{
    "beam_numbers": [166, 1166],
    "event_type": "EXTRAGALACTIC",
    "fpga_time": 39927134208,
    id: 9386707,
}

For advanced examples check out the tutorials section.