station_beamf

Overview

configure station beamformer

Python Class & Methods Index

class pyfabil.plugins.tpm.station_beamf.StationBeamformer(board, **kwargs)[source]

Ring (station) beamformer

abort()[source]

Stop the beamformer :return: True if OK

check_ddr_parity_error_counter()[source]
clean_up()[source]

Perform cleanup :return: Success

clear_errors()[source]

Clear frame errors and general error flag

current_frame()[source]

Current frame as seen by the station beamformer :return: current frame, in units of 256 ADC frames (276,48 us)

defineChannelTable(region_array)[source]

Set frequency regions (legacy version, note the CamelCase name). Regions are defined in a 2-d array, for a maximum of 16 regions. Each element in the array defines a region, with the form [start_ch, nof_ch, beam_index]

  • start_ch: region starting channel (currently must be a

    multiple of 2, LS bit discarded)

  • nof_ch: size of the region: must be multiple of 8 chans

  • beam_index: beam used for this region, range [0:8)

Total number of channels must be <= 384 The routine computes the arrays beam_index, region_off, region_sel, and the total number of channels nof_chans, and programs it in the HW

define_channel_table(region_array)[source]

Set frequency regions. Regions are defined in a 2-d array, for a maximum of 16 regions. Each element in the array defines a region, with the form:

[start_ch, nof_ch, beam_index,

<optional>

subarray_id, subarray_logical_ch, aperture_id, substation_id] 0: start_ch: region starting channel (currently must be a

multiple of 2, LS bit discarded)

1: nof_ch: size of the region: must be multiple of 8 chans 2: beam_index: subarray beam used for this region, range [0:48) 3: subarray_id: ID of the subarray [1:48] 4: subarray_logical_channel: Logical channel in the subarray

it is the same for all (sub)stations in the subarray Defaults to station logical channel

5: subarray_beam_id: ID of the subarray beam

Defaults to beam index

6: substation_ID: ID of the substation

Defaults to 0 (no substation)

7: aperture_id: ID of the aperture (station*100+substation?)

Defaults to

Total number of channels must be <= 384 The routine computes the arrays beam_index, region_off, region_sel, and the total number of channels nof_chans, and programs it in the hardware. Optional parameters are placeholders for firmware supporting more than 1 subarray. Current firmware supports only one subarray and substation, so corresponding IDs must be the same in each row :param region_array: bidimensional array, one row for each

spectral region, 3 or 8 items long

Returns:

True if OK

Raises:

PluginError – if parameters are illegal

define_spead_header(stationId, subarrayId=0, apertureId=0, refEpoch=-1, startTime=0)[source]

Define_spead_header() used to define SPEAD header for last tile requires stationId, subarrayId and apertureId from LMC Only stationId is require :param stationId: ID of the station: 1-512 :param subarrayId: ID of the subarray. can be overrided by defineChannelTable :param apertureId: ID of the aperture. :param refEpoch: Reference peoch. -1 (default) uses value already i

defined in set_epoch()

Parameters:

startTime – (in seconds): offset from frame time, default 0

Returns:

True if OK

get_channel_table()[source]

Returns a table with the following entries for each 8-channel block: 0: start physical channel (64-440) 1: beam_index: subarray beam used for this region, range [0:48) 2: subarray_id: ID of the subarray [1:48]

Here is the same for all channels

3: subarray_logical_channel: Logical channel in the subarray

Here equal to the station logical channel

4: subarray_beam_id: ID of the subarray beam 5: substation_id: ID of the substation 6: aperture_id: ID of the aperture (station*100+substation?)

Returns:

Nx7 table with one row every 8 channels

initialise(**kwargs)[source]

Abstract method where all firmware block initialisation should be performed :param kwargs: Initialisation arguments :return: True or False, depending on whether initialisation was successful

initialise_beamf()[source]

Initialise Station Beamformer

is_running()[source]

Check if the beamformer is still running. Compares current frame to programmed start and last frame :return: True if beamformer is running

report_errors()[source]
Returns:

error flags

set_csp_rounding(rounding)[source]

Sets the number of bits rounded off before sending the result to the CSP. For white noise it should be log2(sqrt(nof_antennas)), i.e. 4 for 256 antennas :param rounding: either scalar or list, of number of bits rounded off

before sending the result to the CSP. If list, only 1st element is used. In future firmware, one value per channel.

Returns:

True if OK

set_epoch(epoch)[source]

Set the Unix epoch in seconds since Unix reference time

Parameters:

epoch – Unix time for reference time (TPM synch time) 48 bit int

Returns:

True if OK

set_first_last_tile(is_first, is_last)[source]

Defines if a tile is first, last, both or intermediate One, and only one tile must be first, and last, in a chain A tile can be both (one tile chain), or none

Parameters:
  • isFirst – Tile is first in the beamformer chain

  • isLast – Tile is first in the beamformer chain

start(time=0, duration=-1, scan_id=0, mask=281474976710655)[source]

starts an integration The integration is specified in units of 256 ADC frames from start_frame (included) to stop_frame (excluded). Default for stop_frame is -1 = “forever” :param time: first frame (as seen by current_frame) in integration :param duration: Integration duration, in frames. If -1, forever :param mask: chanell groups to start, default all (unsupported by FW) :return: True if OK, False if not possible (integration already active)

status_check()[source]

Perform status check Checks if framing errors are present :return: Status