Radio Pulse API

astrotf.radio.dm_one_delay(freq_lo_mhz, freq_hi_mhz)

Compute the dispersion delay of a DM = 1 signal.

Parameters:
  • freq_lo_mhz (float) – Lowest frequency in the observation range.
  • freq_hi_mhz (float) – Highest frequency in the observation range.
Returns:

The expected delay (in seconds) between the highest and lowest frequency of a DM=1 signal.

Return type:

float

class astrotf.radio.FilterEngine(freq_lo_mhz, freq_hi_mhz, tol=0.0001, buffer_size=256, autoflush=True, nn_size=16, max_dm_diff=0.6)
filter(expression)

Generator function that filters a list of elements

Parameters:expression (An iterable object of elements where the first four values are (t', 'w', 'DM', 'SNR', ..)) –
Returns:An iterator for a subset of the the elements.
is_local_max(k)

Tests if a trigger in the active set is a local maximum

A trigger in the active set is a local maximum if the smallest wrapping and largest contained triggers both don’t have a larger SNR

Parameters:k (int) – the index number of the trigger to test
Returns:True if the k-th trigger in the active set is a local maximum, else False
Return type:bool
polygon(t0, w, dm, num_steps=100)

Generate a list of vertices for plotting a pulse shape polygon.

Parameters:
  • t0 (float) – Start of the pulse at the top frequency
  • w (float) – Width of the pulse
  • dm (float) – Dispersion measure
  • num_steps (int) – Number of ine segments
Returns:

A list of vertices of the pulse [ (x0,y0), (x1,x1), ..

Return type:

List of 2d-coordinate tuples

reset()

Reset the statics and state of this class

Returns:None
sort(data, colnames=None)

sort a list of triggers.

Parameters:
  • data (list of tuples or a pandas DataFrame) – A list of tuples (t0, width, dm, ..) or a pandas DataFrame
  • of columns to sort on (colnames:list) – either [‘time’, ‘pulse_end’] or [‘time’, ‘width’, ‘dm’]
Returns:

No return, sorts in-place.