Data format description

The significance time series is stored in the snap.datablock.DataBlock.

class snap.datablock.DataBlock(ts, zs, id=None)

Container for the significance time series.

Significance is defined in time bins, so minimal data block can contain a single zs value, but two ts value, defining the time limits of this significance estimation.

Parameters
  • ts (iterable of float) – Time bin edges

  • zs (iterable of float) – Significance values for each time bin. Must be 1 value shorter than ts.

  • id (str) – Identifier of whatever created this datablock.

T0()

Lower time limit

T1()

Upper time limit

add_time_point(t)

Split the bin at time t i.e. for bin ([t0,t1],z) split_time(t) will produce two bins: ([t0,t],z),([t,t1],z) However if t==t0 or t==t1, the data will be unchanged.

Parameters

t (float or floats) – Timstamp where to split the data

Returns

DataBlock with original data, but with one bin split.

apply_precision(precision=0.001)

Round timestamps to given precision

at(t)

Return z value at given time. If outside range, return NaN

drop_tail(t0)

Create new datablock with the data above given t0

update(d)

Update this datablock with the data from another one. This will rewrite the data within [d.T0,d.T1], and leave the other data unchaned.

Parameters

d (DataBlock) – The new data, to update the current datablock

Returns

DataBlock containing data from the original one, with updates from d