ilex.par

class FRB_metaparams(t_crop=None, f_crop=None, terr_crop=None, tN=1, fN=1, norm='None', zapchan='', EMPTY=False)[source]

Class for FRB meta-params

t_crop

Time crop

Type:

List

f_crop

Frequency crop

Type:

List

tN

Factor for time averaging

Type:

int

fN

Factor for frequency averaging

Type:

int

zapchan

string used for zapping channels, in format -> “850, 860, 870:900”

each element seperated by a ‘,’ is a seperate channel. If ‘:’ is used, user can specify a range of values

i.e. 870:900 -> from channel 870 to 900 inclusive of both.

Type:

str

norm

Type of normalisation

[max] - normalise using maximum

[absmax] - normalise using absolute maximum

[None] - Skip normalisation

Type:

str

Parameters:
  • t_crop (List) – Time crop

  • f_crop (List) – Frequency crop

  • tN (int) – Factor for time averaging

  • fN (int) – Factor for frequency averaging

  • norm (str) –

    Type of normalisation

    [max] - normalise using maximum

    [absmax] - normalise using absolute maximum

    [None] - Skip normalisation

copy()[source]

Return Copy of Meta-params instance

empty_metapar()[source]

Set all meta parameters to None

metapar2dict()[source]

Return Dictionary of meta-parameters

set_metapar(**kwargs)[source]

Set meta-parameters

class FRB_params(name: str = 'FRBXXXXXX', RA: str = '00:00:00.0000', DEC: str = '00:00:00.0000', MJD: float = 0.0, DM: float = 0.0, bw: int = 336, cfreq: float = 1271.5, t_lim_base=[0.0, 3100.0], f_lim_base=[0.0, 336.0], RM: float | None = None, f0: float | None = None, pa0: float = 0.0, dt: float = 0.001, df: float = 1.0, t_ref: float = 0.0, EMPTY=False)[source]

FRB parameter structure

name

name of FRB

Type:

str

RA

Right ascension

Type:

str

DEC

Declination

Type:

str

MJD

Modified julian date [days]

Type:

float

DM

Dispersion Measure [pc/cm^3]

Type:

float

bw

Bandwidth [MHz]

Type:

float

cfreq

Central Frequency [MHz]

Type:

float

t_lim

Time bounds [ms]

Type:

List

f_lim

Frequency bounds [MHz]

Type:

List

t_ref

Reference point of time-series (0-point)

Type:

float

dt

delta time [ms]

Type:

float

df

delta frequency [MHz]

Type:

float

nchan

Number of channels

Type:

int

nsamp

Number of samples

Type:

int

UP

Upper bandwidth

Type:

bool

RM

Rotation Measure [Rad/m^2]

Type:

float

f0

Reference frequency [MHz]

Type:

float

pa0

Positon angle at f0

Type:

float

tW

time weights

Type:

np.ndarray

fW

frequency weights

Type:

np.ndarray

Parameters:
  • name (str) – name of FRB

  • RA (str) – Right ascension

  • DEC (str) – Declination

  • DM (float) – Dispersion Measure [pc/cm^3]

  • MJD (float) – Modified julian date [days]

  • bw (float) – Bandwidth [MHz]

  • cfreq (float) – Central Frequency [MHz]

  • t_lim (List) – Time bounds [ms]

  • f_lim (List) – Frequency bounds [MHz]

  • t_ref (float) – Reference point of time-series (0-point)

  • dt (float) – delta time [ms]

  • df (float) – delta frequency [MHz]

  • nchan (int) – Number of channels

  • nsamp (int) – Number of samples

  • RM (float) – Rotation Measure [Rad/m^2]

  • f0 (float) – Reference frequency [MHz]

  • pa0 (float) – Positon angle at f0

  • tW (np.ndarray) – time weights

  • fW (np.ndarray) – frequency weights

copy()[source]

Return copy of parameter class

default_par()[source]

Set all parameters to default

empty_par()[source]

Set all parameters to None:

property f_lim
get_freqs()[source]

Get frequencies

get_times()[source]

Get time bins

lim2phase(t_lim: list | None = None, f_lim: list | None = None, snap=False)[source]

Provide time [ms] and Freq [MHz] limits and using params, convert to time and freq phase.

Parameters:
  • t_lim (List) – Time limits in [ms]

  • f_lim (List) – Freq limits in [MHz]

  • snap (bool, optional) – if true, snap to nearest multiple of sample resolution, false by default

Returns:

  • t_crop (list, optional) – Time crop, in phase, by default None

  • f_crop (list, optional) – Freq crop, in phase, by default None

mkpar_from_params(frb_params: dict | None = None)[source]

Make new copy of params instance

Parameters:

frb_params (dict, optional) – keyword parameters, by default None

Returns:

params – New instance of FRB params

Return type:

FRB_params

par2dict()[source]

Return parameters of class as dictionary

phase2lim(t_crop: list | None = None, f_crop: list | None = None, snap=False)[source]

Provide time and frequency phases, based on parameters convert to ms and MHz crops

Parameters:
  • t_crop (list, optional) – Time crop, in phase, by default None

  • f_crop (list, optional) – Freq crop, in phase, by default None

  • snap (bool, optional) – if true, snap to nearest multiple of sample resolution, false by default

Returns:

  • t_lim (List) – Time limits in [ms]

  • f_lim (List) – Freq limits in [MHz]

set_par(**kwargs)[source]

Set attributes of par class

Parameters:

**kwargs (Dict) – Keyword parameters

set_weights(xtype='t', **kwargs)[source]

Set properties of weights instances

Parameters:
  • xtype (str) –

    Type of weights

    ”t” - Time weights

    ”f” - Freq weights

  • **kwargs (Dict) – Keyword arguments for weights instance

property t_lim

t_lim translated by t_ref to the zero point.

Type:

t_lim_ref

update_from_crop(t_crop: list = [0.0, 1.0], f_crop: list = [0.0, 1.0], tN: int = 1, fN: int = 1)[source]

Update Parameters based on time and frequency crops + averaging

Parameters:
  • t_crop (list, optional) – time crop, by default [0.0, 1.0]

  • f_crop (list, optional) – frequency crop, by default [0.0, 1.0]

  • tN (int, optional) – Factor for time averaging, by default 1

  • fN (int, optional) – Factor for frequency averaging, by default 1

class weights(W=None, x=None, func=None, method=None, args=None, norm=True)[source]

Weights structure, used for storing weights or weight functions that can be evaluated.

Parameters:
  • W (ndarray or array-like) – weights

  • x (ndarray or array-like) – sample array defining weights, used for interpolation and function evaluation

  • func (<lambda>) – function to evaluate to get weights

  • method (str) –

    method to retrive weights

    [None] - Retrieve weights as is, either scalar or array

    [interp] - interpolate weights based on bounds and W (weights)

    [func] - Retrieve weights by evaluating function

  • args (dict) – dictionary of arguments used in evaluating weights function

  • norm (bool, optional) – Normalise weights, default is True

get_weights(x=None, method=None)[source]

Get weights, this is a universal function

Parameters:
  • x (ndarray or array-like, optional) – if specified, will interp or evaluate func using this array rather then self.x, by default None

  • method (str, optional) – method used for retrieving weights, if not spefified, uses self.method, by default None

Returns:

W – Weights

Return type:

ndarray or array-like

set(**kwargs)[source]

Set attributes for weights class