TraRecord

class vallenae.io.TraRecord(time: float, channel: int, param_id: int, pretrigger: int, threshold: float, samplerate: int, samples: int, data: ~numpy.ndarray, status: ~vallenae.io.datatypes.HitFlags = <HitFlags: 0>, trai: int | None = None, rms: float | None = None, raw: bool = False)[source]

Transient data record in tradb.

__init__()

Methods

__init__()

count(value, /)

Return number of occurrences of value.

from_sql(row, *[, raw])

Create TraRecord from SQL row.

index(value[, start, stop])

Return first index of value.

Attributes

channel

Channel number

data

Transient signal in volts or ADC values if raw = True

param_id

Parameter ID of table tr_params for ADC value conversion

pretrigger

Pretrigger samples

raw

data is stored as ADC values (int16)

rms

RMS of the noise before the hit

samplerate

Samplerate in Hz

samples

Number of samples

status

Status flags

threshold

Threshold amplitude in volts

time

Time in seconds

trai

Transient recorder index (foreign key between pridb and tradb)

time: float

Time in seconds

channel: int

Channel number

param_id: int

Parameter ID of table tr_params for ADC value conversion

pretrigger: int

Pretrigger samples

threshold: float

Threshold amplitude in volts

samplerate: int

Samplerate in Hz

samples: int

Number of samples

data: ndarray

Transient signal in volts or ADC values if raw = True

status: HitFlags

Status flags

trai: Optional[int]

Transient recorder index (foreign key between pridb and tradb)

rms: Optional[float]

RMS of the noise before the hit

raw: bool

data is stored as ADC values (int16)

classmethod from_sql(row, *, raw=False)[source]

Create TraRecord from SQL row.

Parameters:
  • row (Dict[str, Any]) – Dict of column names and values

  • raw (bool) – Provide data as ADC values (int16)

Return type:

TraRecord

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.