Demonstration of rtpipe analysis with FRB 121102

A walkthrough for data preparation, finding a transient, analyzing, visualizing to catch your own FRB

This notebook demonstrates the Python library rtpipe, which was used to make the first interferometric detection of a Fast Radio Burst on this data set. The results are presented in Chatterjee et al 2017, "The direct localization of a fast radio burst and its host" (http://dx.doi.org/10.1038/nature20797).

Prerequisites to run this analysis:

  1. Python 2.7
  2. Download data from Dataverse at https://doi.org/10.7910/DVN/TLDKXG (9 sets available; 1 used here)
  3. Install dependencies with anaconda (commands listed in rtpipe repo)
  4. pip install rtpipe

The original analysis was run in quasi-real-time on a cluster at the Very Large Array using realfast. This demonstration is tuned to run on a laptop, find one burst from FRB 121102, and perform a rough analysis. For a more exact reproduction of the results in the publication, see the other notebooks in https://github.com/caseyjlaw/FRB121102.

This analysis can be used to reproduce the original detection or refine that analysis. You can also download all 9 data sets to create visualizations of all bursts, such as those at https://youtu.be/i3x0sBCQ_c8 or the sound files at http://dx.doi.org/10.7910/DVN/QSWJE6.


In [22]:
%matplotlib inline

Import rtpipe and scientific python libraries


In [23]:
from __future__ import print_function
import pylab as pl
import numpy as np
import rtpipe
import rtlib_cython as rtlib

In [24]:
# useful function for data visualization in notebook
def correctdata(st, data, u=None, v=None, w=None, corr='ph,dm', lm = None):
    data2 = data.copy()
    
    if 'ph' in corr:
        if lm and len(u) and len(v):
            l1, m1 = lm
            rtlib.phaseshift_threaded(data2, st, l1, m1, u, v)
        else:
            print('No phase center provided')

    if 'dm' in corr:
        rtlib.dedisperse_par(data2, st['freq'], st['inttime'], st['dmarr'][0], [0, st['nbl']])
    
    return data2

Get data and calibration file locally

1) Go to dataverse, download the tarred data file for the first burst (detected 23 August 2016) and appropriate calibration (*.GN) file. E.g.,

- 16A-459_TEST_1hr.57623.72670021991.cut.tar
- 16A-459_TEST_1hr.57623.72670021991.GN

2) Untar data (e.g., 'tar xvf 16A-459_TEST_1hr.57623.72670021991.cut.tar')

3) Move to directory with sdmfile and gainfile


In [25]:
sdmfile = '16A-459_TEST_1hr.57623.72670021991.cut'
gainfile = '16A-459_TEST_1hr.57623.72670021991.GN'

# a segment defines a piece of data in time. some tuning required for other FRB 121102 data files.
segment = 0

Summarize visibility cut-out file

To reduce the data volume, we have cut out small time windows to create the visibility data files. Only one scan contains valid data, so we quickly check for that scan here.


In [26]:
sdm = rtpipe.parsesdm.getsdm(sdmfile)
bdfscan = 6

Search for FRB

The rtpipe library has a few different interfaces. First, we show the end-to-end, real-time analysis that uses Python's multiprocessing library with shared memory. After that, we demonstrate another set of functions to run all the steps of the analysis and visualize the results.

All analysis begins by defining a dictionary with metadata from the observation, preferences for the search pipeline, and parameters derived from the joint consideration of both. The command below is tuned to find the known FRB with modest computational expense.


In [27]:
st = rtpipe.RT.set_pipeline(sdmfile, bdfscan, dmarr=[567.], dtarr=[1], 
                            flaglist=[('badap', 3., 0.2)], uvoversample=1.5, 
                            gainfile=gainfile, flagantsol=True, timesub='mean', 
                            npix_max=1024, logfile=False, savecands=False, savenoise=False)


2017-12-10 19:25:41,449 - rtpipe.parsesdm - INFO - Setting (standard) key logfile to False
2017-12-10 19:25:41,461 - rtpipe.parsesdm - INFO - Setting (standard) key timesub to mean
2017-12-10 19:25:41,464 - rtpipe.parsesdm - INFO - Setting (standard) key gainfile to 16A-459_TEST_1hr.57623.72670021991.GN
2017-12-10 19:25:41,467 - rtpipe.parsesdm - INFO - Setting (standard) key dmarr to [567.0]
2017-12-10 19:25:41,469 - rtpipe.parsesdm - INFO - Setting (standard) key dtarr to [1]
2017-12-10 19:25:41,471 - rtpipe.parsesdm - INFO - Setting (standard) key npix_max to 1024
2017-12-10 19:25:41,473 - rtpipe.parsesdm - INFO - Setting (standard) key savecands to False
2017-12-10 19:25:41,475 - rtpipe.parsesdm - INFO - Setting (standard) key flaglist to [('badap', 3.0, 0.2)]
2017-12-10 19:25:41,479 - rtpipe.parsesdm - INFO - Setting (standard) key savenoise to False
2017-12-10 19:25:41,481 - rtpipe.parsesdm - INFO - Setting (standard) key flagantsol to True
2017-12-10 19:25:41,483 - rtpipe.parsesdm - INFO - Setting (standard) key uvoversample to 1.5
2017-12-10 19:25:41,685 - rtpipe.parsesdm - WARNING - No BDF found for scans [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14]
2017-12-10 19:25:42,106 - rtpipe.parsesdm - WARNING - No BDF found for scans [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14]
2017-12-10 19:25:42,238 - rtpipe.parsesdm - INFO - Calculating uvw for first integration of scan 6 of source FRB121102-off
2017-12-10 19:25:42,541 - rtpipe.parsesdm - INFO - 

2017-12-10 19:25:42,544 - rtpipe.parsesdm - INFO - Metadata summary:
2017-12-10 19:25:42,552 - rtpipe.parsesdm - INFO - 	 Working directory and data at /Users/caseyjlaw/code/FRB121102, 16A-459_TEST_1hr.57623.72670021991.cut
2017-12-10 19:25:42,557 - rtpipe.parsesdm - INFO - 	 Using scan 6, source FRB121102-off
2017-12-10 19:25:42,560 - rtpipe.parsesdm - INFO - 	 nants, nbl: 27, 351
2017-12-10 19:25:42,563 - rtpipe.parsesdm - INFO - 	 Freq range (2.489 -- 3.509). 8 spw with 256 chans.
2017-12-10 19:25:42,565 - rtpipe.parsesdm - INFO - 	 Scan has 800 ints (4.0 s) and inttime 0.005 s
2017-12-10 19:25:42,569 - rtpipe.parsesdm - INFO - 	 2 polarizations: ['RR', 'LL']
2017-12-10 19:25:42,572 - rtpipe.parsesdm - INFO - 	 Ideal uvgrid npix=(2592,3456) and res=104 (oversample 1.5)
2017-12-10 19:25:42,604 - rtpipe - INFO - 
2017-12-10 19:25:42,609 - rtpipe - INFO - Pipeline summary:
2017-12-10 19:25:42,613 - rtpipe - INFO - 	 Products saved with 16A-459_TEST_1hr.57623.72670021991.cut. telcal calibration with 16A-459_TEST_1hr.57623.72670021991.GN
2017-12-10 19:25:42,617 - rtpipe - INFO - 	 Using 1 segment of 800 ints (4.0 s) with overlap of 0.2 s
2017-12-10 19:25:42,620 - rtpipe - INFO - 	 Downsampling in time/freq by 1/1 and skipping 0 ints from start of scan.
2017-12-10 19:25:42,622 - rtpipe - INFO - 	 Excluding ants []
2017-12-10 19:25:42,625 - rtpipe - INFO - 	 Using pols ['RR', 'LL']
2017-12-10 19:25:42,628 - rtpipe - INFO - 
2017-12-10 19:25:42,632 - rtpipe - INFO - 	 Search with image1 and threshold 7.0.
2017-12-10 19:25:42,635 - rtpipe - INFO - 	 Using 1 DMs from 567.0 to 567.0 and dts [1].
2017-12-10 19:25:42,641 - rtpipe - INFO - 	 Using uvgrid npix=(1024,1024) and res=104.
2017-12-10 19:25:42,644 - rtpipe - INFO - 	 Expect 0 thermal false positives per segment.
2017-12-10 19:25:42,648 - rtpipe - INFO - 
2017-12-10 19:25:42,651 - rtpipe - INFO - 	 Visibility memory usage is 4.3 GB/segment
2017-12-10 19:25:42,654 - rtpipe - INFO - 	 Imaging in 1 chunk using max of 6.2 GB/segment
2017-12-10 19:25:42,657 - rtpipe - INFO - 	 Grand total memory usage: 10.5 GB/segment

In [28]:
rtpipe.RT.pipeline(st, segment)


2017-12-10 19:25:42,677 - rtpipe - INFO - Starting search of /Users/caseyjlaw/code/FRB121102/16A-459_TEST_1hr.57623.72670021991.cut, scan 6, segments [0]
2017-12-10 19:25:55,102 - rtpipe.parsesdm - INFO - Reading scan 6, segment 0/0, times 17:51:21.920 to 17:51:25.920
2017-12-10 19:25:55,477 - rtpipe.parsesdm - INFO - Reading 800 ints starting at int 0
2017-12-10 19:26:14,291 - rtpipe.parsesdm - INFO - Found online flags for 144 antenna/time ranges.
2017-12-10 19:26:14,319 - rtpipe.parsesdm - INFO - Applied online flags to 0 ints.
2017-12-10 19:26:25,852 - rtpipe.parsesdm - WARNING - No BDF found for scans [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14]
2017-12-10 19:26:26,007 - rtpipe.parsesdm - INFO - Calculating uvw at 2016/08/23/17:51:23.920 for scan 6 of source FRB121102-off
2017-12-10 19:26:26,186 - rtpipe.parsecal - INFO - Read telcalfile 16A-459_TEST_1hr.57623.72670021991.GN
2017-12-10 19:26:26,212 - rtpipe.parsecal - INFO - Frequency selection cut down to 1296 solutions
2017-12-10 19:26:26,219 - rtpipe.parsecal - INFO - Selection down to 432 solutions separated from given time by 4 minutes
2017-12-10 19:26:26,226 - rtpipe.parsecal - INFO - MJD: [ 57623.74748264]
2017-12-10 19:26:26,228 - rtpipe.parsecal - INFO - Source: ['J0555+3948']
2017-12-10 19:26:26,233 - rtpipe.parsecal - INFO - Solutions for 8 spw: ([ 2553.  2681.  2809.  2937.  3065.  3193.  3321.  3449.])
2017-12-10 19:26:26,235 - rtpipe.parsecal - INFO - Applying gain solution for chans from 0-31
2017-12-10 19:26:27,342 - rtpipe.parsecal - INFO - Applying gain solution for chans from 32-63
2017-12-10 19:26:28,329 - rtpipe.parsecal - INFO - Applying gain solution for chans from 64-95
2017-12-10 19:26:30,683 - rtpipe.parsecal - INFO - Applying gain solution for chans from 96-127
2017-12-10 19:26:32,195 - rtpipe.parsecal - INFO - Applying gain solution for chans from 128-159
2017-12-10 19:26:33,279 - rtpipe.parsecal - INFO - Applying gain solution for chans from 160-191
2017-12-10 19:26:34,437 - rtpipe.parsecal - INFO - Applying gain solution for chans from 192-223
2017-12-10 19:26:35,530 - rtpipe.parsecal - INFO - Applying gain solution for chans from 224-255
2017-12-10 19:26:36,409 - rtpipe - INFO - Flagging with flaglist: [('badap', 3.0, 0.2)]
2017-12-10 19:26:37,763 - rtpipe - INFO - Bad basepol flagging for chans 0-31 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:26:38,614 - rtpipe - INFO - Bad basepol flagging for chans 0-31 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:39,780 - rtpipe - INFO - Bad basepol flagging for chans 32-63 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:26:40,530 - rtpipe - INFO - Bad basepol flagging for chans 32-63 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:41,902 - rtpipe - INFO - Bad basepol flagging for chans 64-95 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:26:42,662 - rtpipe - INFO - Bad basepol flagging for chans 64-95 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:43,910 - rtpipe - INFO - Bad basepol flagging for chans 96-127 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:26:44,713 - rtpipe - INFO - Bad basepol flagging for chans 96-127 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:45,503 - rtpipe - INFO - Bad basepol flagging for chans 128-159 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:46,349 - rtpipe - INFO - Bad basepol flagging for chans 128-159 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:47,101 - rtpipe - INFO - Bad basepol flagging for chans 160-191 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:47,835 - rtpipe - INFO - Bad basepol flagging for chans 160-191 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:48,723 - rtpipe - INFO - Bad basepol flagging for chans 192-223 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:49,506 - rtpipe - INFO - Bad basepol flagging for chans 192-223 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:50,221 - rtpipe - INFO - Bad basepol flagging for chans 224-255 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:50,933 - rtpipe - INFO - Bad basepol flagging for chans 224-255 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:26:50,935 - rtpipe - INFO - Subtracting mean visibility in time...
2017-12-10 19:26:58,396 - rtpipe - INFO - Dedispering to max (DM, dt) of (567, 1) ...
2017-12-10 19:29:17,835 - rtpipe - INFO - Got one!  Int=400, DM=567, dt=1: SNR_im=29.1 @ (-3.85e-04,5.45e-04).
2017-12-10 19:29:17,890 - rtpipe - INFO - Found 1 cands in scan 6 segment 0 of /Users/caseyjlaw/code/FRB121102/16A-459_TEST_1hr.57623.72670021991.cut. 

ZOMG FRB!

The previous command should find the first burst from FRB 121102 with SNR=29. This data was recorded on 23 August 2016 and the burst was found 5 hours later by realfast.

Get calibrated data to play (dedisperse, image)

Rather than using this pipelined approach, we can use another interface to get calibrated, flagged data for playing.


In [29]:
data = rtpipe.RT.pipeline_reproduce(st, candloc=[segment,0,0,0,0], product='data')
print('Data has shape of (integrations, baselines, channels, polarizations): {}'.format(data.shape))


2017-12-10 19:29:30,107 - rtpipe.parsesdm - INFO - Reading scan 6, segment 0/0, times 17:51:21.920 to 17:51:25.920
2017-12-10 19:29:30,490 - rtpipe.parsesdm - INFO - Reading 800 ints starting at int 0
2017-12-10 19:29:42,578 - rtpipe.parsesdm - INFO - Found online flags for 144 antenna/time ranges.
2017-12-10 19:29:42,585 - rtpipe.parsesdm - INFO - Applied online flags to 0 ints.
2017-12-10 19:29:49,246 - rtpipe.parsesdm - WARNING - No BDF found for scans [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14]
2017-12-10 19:29:49,376 - rtpipe.parsesdm - INFO - Calculating uvw at 2016/08/23/17:51:23.920 for scan 6 of source FRB121102-off
2017-12-10 19:29:49,547 - rtpipe.parsecal - INFO - Read telcalfile 16A-459_TEST_1hr.57623.72670021991.GN
2017-12-10 19:29:49,568 - rtpipe.parsecal - INFO - Frequency selection cut down to 1296 solutions
2017-12-10 19:29:49,571 - rtpipe.parsecal - INFO - Selection down to 432 solutions separated from given time by 4 minutes
2017-12-10 19:29:49,579 - rtpipe.parsecal - INFO - MJD: [ 57623.74748264]
2017-12-10 19:29:49,583 - rtpipe.parsecal - INFO - Source: ['J0555+3948']
2017-12-10 19:29:49,585 - rtpipe.parsecal - INFO - Solutions for 8 spw: ([ 2553.  2681.  2809.  2937.  3065.  3193.  3321.  3449.])
2017-12-10 19:29:49,587 - rtpipe.parsecal - INFO - Applying gain solution for chans from 0-31
2017-12-10 19:29:50,514 - rtpipe.parsecal - INFO - Applying gain solution for chans from 32-63
2017-12-10 19:29:51,465 - rtpipe.parsecal - INFO - Applying gain solution for chans from 64-95
2017-12-10 19:29:52,361 - rtpipe.parsecal - INFO - Applying gain solution for chans from 96-127
2017-12-10 19:29:53,186 - rtpipe.parsecal - INFO - Applying gain solution for chans from 128-159
2017-12-10 19:29:54,034 - rtpipe.parsecal - INFO - Applying gain solution for chans from 160-191
2017-12-10 19:29:54,924 - rtpipe.parsecal - INFO - Applying gain solution for chans from 192-223
2017-12-10 19:29:55,775 - rtpipe.parsecal - INFO - Applying gain solution for chans from 224-255
2017-12-10 19:29:56,583 - rtpipe - INFO - Flagging with flaglist: [('badap', 3.0, 0.2)]
2017-12-10 19:29:57,710 - rtpipe - INFO - Bad basepol flagging for chans 0-31 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:29:58,420 - rtpipe - INFO - Bad basepol flagging for chans 0-31 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:29:59,530 - rtpipe - INFO - Bad basepol flagging for chans 32-63 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:30:00,246 - rtpipe - INFO - Bad basepol flagging for chans 32-63 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:01,318 - rtpipe - INFO - Bad basepol flagging for chans 64-95 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:30:02,020 - rtpipe - INFO - Bad basepol flagging for chans 64-95 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:03,149 - rtpipe - INFO - Bad basepol flagging for chans 96-127 at 3.0 sigma: ants/pols [14]/[1], 0.46 % of total flagged
2017-12-10 19:30:03,842 - rtpipe - INFO - Bad basepol flagging for chans 96-127 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:04,515 - rtpipe - INFO - Bad basepol flagging for chans 128-159 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:05,226 - rtpipe - INFO - Bad basepol flagging for chans 128-159 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:06,021 - rtpipe - INFO - Bad basepol flagging for chans 160-191 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:07,287 - rtpipe - INFO - Bad basepol flagging for chans 160-191 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:08,220 - rtpipe - INFO - Bad basepol flagging for chans 192-223 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:09,015 - rtpipe - INFO - Bad basepol flagging for chans 192-223 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:10,373 - rtpipe - INFO - Bad basepol flagging for chans 224-255 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:11,378 - rtpipe - INFO - Bad basepol flagging for chans 224-255 at 3.0 sigma: ants/pols []/[], 0.00 % of total flagged
2017-12-10 19:30:11,383 - rtpipe - INFO - Subtracting mean visibility in time...
2017-12-10 19:30:15,937 - rtpipe - INFO - Returning prepared data...
Data has shape of (integrations, baselines, channels, polarizations): (800, 351, 256, 2)

Correct data for known dispersion and image integration with burst


In [30]:
u, v, w = rtpipe.parsesdm.get_uvw_segment(st, segment)
burst_int = 400 # the burst starts in this integration at the top of the band

datadm = correctdata(st, data, corr='dm')

im = rtpipe.RT.sample_image(st, datadm, u, v, w, i=burst_int)
l,m = rtpipe.RT.calc_lm(st, im)
ra_center, dec_center = st['radec']
ra, dec = rtpipe.reproduce.source_location(ra_center, dec_center, l, m)

print('\nDirty image:')
print('Peak significance: {0:.1f}'.format(im.max()/im.std()))
print('Peak location (J2000): {0}, {1}'.format(ra, dec))


2017-12-10 19:30:16,279 - rtpipe.parsesdm - WARNING - No BDF found for scans [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14]
2017-12-10 19:30:16,405 - rtpipe.parsesdm - INFO - Calculating uvw at 2016/08/23/17:51:23.920 for scan 6 of source FRB121102-off
Dirty image:
Peak significance: 29.1
Peak location (J2000): 5 31 58.6792300322, 33 8 53.3362355172

In [31]:
# show me!
fig = pl.figure(figsize=(12,5))

# full field
ax = fig.add_subplot(121)
pl.imshow(im.transpose(), interpolation='nearest', cmap='magma_r')
pl.xlabel('RA offset (pix)', fontsize=20)
pl.ylabel('Dec offset (pix)', fontsize=20)
xt = pl.setp(ax.get_xticklabels(), fontsize=14)
yt = pl.setp(ax.get_yticklabels(), fontsize=14)
ax.xaxis.set_tick_params(width=3, color='w')
ax.yaxis.set_tick_params(width=3, color='w')

# zoom
ax = fig.add_subplot(122)
zoom = (450, 650, 550, 350)
pl.imshow(im.transpose()[zoom[3]:zoom[2], zoom[0]:zoom[1]], interpolation='nearest',
          cmap='magma_r', extent=zoom)
pl.xlabel('RA offset (pix)', fontsize=20)
pl.ylabel('Dec offset (pix)', fontsize=20)
xt = pl.setp(ax.get_xticklabels(), fontsize=14)
yt = pl.setp(ax.get_yticklabels(), fontsize=14)
ax.xaxis.set_tick_params(width=3, color='w')
ax.yaxis.set_tick_params(width=3, color='w')


With location and time known, we can now visualize the burst spectrum


In [32]:
# info to phase data
(l1, m1) = (-3.85e-04, 5.45e-04)

# phase up
dataph = correctdata(st, data, u, v, w, corr='ph', lm = (-3.85e-04,5.45e-04))
sgram = dataph[burst_int-50:burst_int+100].mean(axis=3).mean(axis=1).real.transpose()

# phase up and dedisperse
dataphdm = correctdata(st, data, u, v, w, corr='ph,dm', lm = (-3.85e-04,5.45e-04))
sgramd = dataphdm[burst_int-50:burst_int+100].mean(axis=3).mean(axis=1).real.transpose()

In [33]:
fig = pl.figure(figsize=(12,5))

# dynamic spectrum without dedispersion
ax = fig.add_subplot(121)
pl.imshow(sgram, interpolation='nearest', origin='lower', cmap='viridis',
         extent=(0, len(sgram)*0.005, 2.5, 3.5), vmax=0.8*sgram.max())
pl.xlabel('Time (seconds)', fontsize=20)
pl.ylabel('Frequency (GHz)', fontsize=20)
ax.set_title('No dedispersion', fontsize=20)

# dynamic spectrum corrected for dispersion
ax = fig.add_subplot(122)
pl.imshow(sgramd, interpolation='nearest', origin='lower', cmap='viridis',
         extent=(0, len(sgram)*0.005, 2.5, 3.5), vmax=0.8*sgram.max())
pl.xlabel('Time (seconds)', fontsize=20)
pl.ylabel('Frequency (GHz)', fontsize=20)
xt = pl.setp(ax.get_xticklabels(), fontsize=14)
yt = pl.setp(ax.get_yticklabels(), fontsize=14)
ax.xaxis.set_tick_params(width=3, color='w')
ax.yaxis.set_tick_params(width=3, color='w')
ax.set_title('Dedispersed', fontsize=20)


Out[33]:
Text(0.5,1,u'Dedispersed')

Plot the spectrum of the burst


In [34]:
spectra = dataphdm[burst_int].mean(axis=0).real
fig = pl.figure(figsize=(15,8))
ax = fig.add_subplot(111)
pl.plot(spectra[:,0], 'c.', label='RR')
pl.plot(spectra[:,1], 'm.', label='LL')
pl.xlabel('Channel', fontsize=20)
pl.ylabel('Amplitude (system units)', fontsize=20)
xt = pl.setp(ax.get_xticklabels(), fontsize=14)
yt = pl.setp(ax.get_yticklabels(), fontsize=14)
ax.xaxis.set_tick_params(width=3, color='w')
ax.yaxis.set_tick_params(width=3, color='w')
pl.legend(fontsize=14)


Out[34]:
<matplotlib.legend.Legend at 0x1271750d0>

Looking for more?

In total, the VLA found 9 bursts from FRB 121102 from August through September 2016. Eight other data sets (visibility cutout plus calibration file) can be downloaded from the dataverse at https://doi.org/10.7910/DVN/TLDKXG.

You can also play with the next generation search pipeline at http://github.com/realfastvla/rfpipe.