frb.frb - FRB Event Module

Module for an FRB event

class frb.frb.GenericFRB(S, nu_c, DM, coord=None, cosmo=None, repeater=None)[source]

Bases: object

Parent object for FRBs

Args:
  • S – Quantity Source density of the burst

  • nu_c – Quantity Centre frequency

  • DM – Quantity

  • coord (astropy.coordinates.SkyCoord) – multi-format, optional RA/DEC in one of many formats (see utils.radec_to_coord)

  • cosmo

fluence

Fluence

Type:

Quantity

fluence_err
Type:

Quantity

DM

Dispersion Measure

Type:

Quantity

DM_err
Type:

Quantity

RM

Rotation Measure

Type:

Quantity

RM_err
Type:

Quantity

lpol

Linear Polarization (%)

Type:

float

lpol_err
Type:

Quantity

refs

List of str, reference names

Type:

list

z

Redshift

Type:

float

z_err

Uncertainty in the redshift

Type:

float

repeater

Marks the FRB as being a Repeater

Type:

bool

classmethod from_dict(idict, **kwargs)[source]

Instantiate from a dict

Args:
  • idict (dict)

  • **kwargs – Passed to the __init__ call

Returns:

classmethod from_json(json_file, **kwargs)[source]
Instantiate from a JSON file

A simple wrapper to the from_dict method

Args:
  • json_file (str)

  • **kwargs – Passed to from_dict()

Returns:

slf

__init__(S, nu_c, DM, coord=None, cosmo=None, repeater=None)[source]
set_DMISM()[source]
set_ee(a, b, theta, cl, stat=True)[source]

Set an error ellipse for the FRB position

Args:
  • a (float) – major axis; Arcsec

  • b (float) – minor axis; Arcsec

  • theta (float) – rotation of the major axis E from N (deg)

  • cl (float) – confidence level

  • stat (bool, optional) – If True, fill in statistical error if False, fill in systematic

property sig_a

Combined semi-major axis error

Return type:

float

property sig_b

Combined semi-minor axis error

Return type:

float

set_pulse(freq, time_res=None, t0=None, Wi=None, Wi_err=None, tscatt=None, tscatt_err=None, scatt_index=None, scatt_index_err=None, DM_smear=None)[source]
Args:
  • freq (Quantity) – Frequency at which the pulse was analyzed

  • time_res (Quantity) – Time resolution of the telescope/instrument

  • t0 (Quantity) – Pulse arrival time (MJD) at top band frequency

  • Wi (Quantity) – Intrinsic width

  • Wi_err (Quantity) – Error in intrinsic width

  • tscatt (Quantity) – Scattering broadening time

  • tscatt_err (Quantity) – Error in Scattering broadening time

  • scatt_index (float) – Scattering index

  • scatt_index_err (float) – Error in scattering index

  • DM_smear (float) – Dispersion smearing generated observed width

make_outfile()[source]

Simple method for naming the output file

Returns:

str

write_to_json(outfile=None, path='./', overwrite=True)[source]

Write key aspects of the class to disk in a JSON file

Args:
  • outfile (str, optional) – Output filename If not provided, one will be generated with make_outfile()

  • path (str, optional) – Path for the output file

  • overwrite (bool, optional) – Overwrite?

Returns:

class frb.frb.FRB(frb_name, coord, DM, S=None, nu_c=None, z_frb=None, **kwargs)[source]

Bases: GenericFRB

FRB class used for actual, observed FRBs

classmethod from_dict(idict, **kwargs)[source]

Instantiate from a dict

Args:
  • idict (dict)

  • **kwargs – Passed to the __init__ call

Returns:

classmethod by_name(frb_name, **kwargs)[source]

Method to instantiate an FRB by its name

Args:
  • frb_name (str) –

    Name of the FRB, with format FRBYYYYMMDDX

    i.e. FRB + TNS

  • **kwargs

Returns:

__init__(frb_name, coord, DM, S=None, nu_c=None, z_frb=None, **kwargs)[source]
Args:
  • frb_name (str)

  • coord (astropy.coordinates.SkyCoord)

  • DM (Quantity)

  • S (Quantity) – Source density

  • nu_c

  • z_frb (float) – Redshift

  • **kwargs

grab_host(verbose: bool = True)[source]

Returns the FRBHost object for this FRB

Returns:

frb.galaxies.frbgalaxy.FRBHost

frb.frb.list_of_frbs(require_z=False)[source]

Generate a list of FRB objects for all the FRBs in the Repo

Args:

require_z (bool, optional) – If True, require z be set

Return type:

list

frb.frb.build_table_of_frbs(frbs=None, fattrs=None)[source]

Generate a Pandas table of FRB data

Warning: As standard, missing values are given NaN in the Pandas table

Be careful!

Args:

fattrs (list, optional) – Float attributes for the Table The code also, by default, looks for accompanying _err attributes

Returns:

Table of data on FRBs, dict of their units

Return type:

pd.DataFrame, dict

frb.frb.load_frb_data(tbl_file: str = None)[source]