Skip to content

poreflow.RawDataFrame

Bases: BaseDataFrame

i_loc property

Get column index for current data.

Returns:

Name Type Description
int

Column index of the current data column.

v_loc property

Get column index for voltage data.

Returns:

Name Type Description
int

Column index of the voltage data column.

as_dataframe()

Converts the BaseDataFrame to a regular pandas DataFrame.

Returns:

Type Description

pd.DataFrame: Regular pandas DataFrame without poreflow metadata.

from_labview(filename, sfreq=5000, bfreq=None, bamp=None, verbose=False) classmethod

Reads measurement data from a LabView .dat file and creates a Raw data object.

Parameters:

Name Type Description Default
verbose bool
False
filename PathLike

Path to the measurement data file to be loaded.

required
sfreq Optional[float]

Target frequency for optional downsampling. Defaults to 5000 Hz.

5000
bfreq Optional[float]

Bias voltage frequency in Hz. Defaults to None, which corresponds to a constant voltage measurement.

None
bamp Optional[float]

Bias voltage amplitude in mV. Defaults to None, which corresponds to a constant voltage measurement.

None

Returns:

Type Description
RawDataFrame

poreflow.base.RawDataFrame: A RawDataFrame object containing the processed voltage and current data.

get_nyquist()

Calculates the Nyquist frequency.

The Nyquist frequency is half the sampling frequency and represents the highest frequency that can be accurately represented in the signal.

Returns:

Name Type Description
float

Nyquist frequency in Hz.

get_t(absolute=False, n=None)

Get time array

Parameters:

Name Type Description Default
absolute bool

Whether to return absolute time (start from start time). Defaults to False.

False
n int

Number of time points to return. Defaults to None, in which case an number of time points is equal to the current data is returned

None

Returns:

has_state()

Checks if the DataFrame has a state column.

Returns:

Name Type Description
bool

True if the DataFrame contains a state column.

is_varv()

Checks if the measurement uses variable voltage

Returns:

Name Type Description
bool

True if bias frequency (bfreq) is not None, indicating a variable voltage measurement.

load(path) classmethod

Load data from an HDF5 file.

Parameters:

Name Type Description Default
path str or Path

Path to load the file from.

required

Returns:

Name Type Description
BaseData

The loaded data.

plot(y='i', x='abs', ax=None, ms=False, stats=True, ios=True, max_points=0, hue=None, events=None, **kwargs)

Parameters:

Name Type Description Default
y str
'i'
events EventsDataFrame
None
ios bool
True
ms
False
stats bool | str
True
x str | ndarray
'abs'
ax
None
max_points
0
hue str

Column to find states in

None
**kwargs
{}

Returns:

reset_indices()

Resets indices of data.

Resets the start_idx to the first index and resets the DataFrame index to start from 0.

Returns:

Type Description

None

reset_states()

Resets all states to the good state value.

Returns:

Type Description

None

save(path)

Save data to an HDF5 file.

Parameters:

Name Type Description Default
path str or Path

Path to save the file to.

required