DDFBinaryMetadata#

class neurodent.core.DDFBinaryMetadata(metadata_path: str | Path | None, *, n_channels: int | None = None, f_s: float | None = None, dt_end: datetime | None = None, channel_names: list[str] | None = None, V_units: str | None = None, mult_to_uV: float | None = None) None[source]#

Bases: object

Parameters:
  • metadata_path (str | Path | None)

  • n_channels (int | None)

  • f_s (float | None)

  • dt_end (datetime | None)

  • channel_names (list[str] | None)

  • V_units (str | None)

  • mult_to_uV (float | None)

__init__(metadata_path: str | Path | None, *, n_channels: int | None = None, f_s: float | None = None, dt_end: datetime | None = None, channel_names: list[str] | None = None, V_units: str | None = None, mult_to_uV: float | None = None) None[source]#

Initialize DDFBinaryMetadata either from a file path or direct parameters.

Parameters:
  • metadata_path (str, optional) – Path to metadata CSV file. If provided, other parameters are ignored.

  • n_channels (int, optional) – Number of channels

  • f_s (float, optional) – Sampling frequency in Hz

  • dt_end (datetime, optional) – End datetime of recording

  • channel_names (list, optional) – List of channel names

  • V_units (str, optional) – Voltage units (e.g., ‘µV’, ‘mV’, ‘V’)

  • mult_to_uV (float, optional) – Multiplication factor to convert to microvolts

Return type:

None

to_dict() dict[source]#

Convert DDFBinaryMetadata to a dictionary for JSON serialization.

Return type:

dict

classmethod from_dict(data: dict) DDFBinaryMetadata[source]#

Create DDFBinaryMetadata from a dictionary (from JSON deserialization).

Return type:

DDFBinaryMetadata

Parameters:

data (dict)

to_json(file_path: Path) None[source]#

Save DDFBinaryMetadata to a JSON file.

Return type:

None

Parameters:

file_path (Path)

classmethod from_json(file_path: Path) DDFBinaryMetadata[source]#

Load DDFBinaryMetadata from a JSON file.

Return type:

DDFBinaryMetadata

Parameters:

file_path (Path)

update_sampling_rate(new_f_s: float) None[source]#

Update the sampling rate in this metadata object.

This should be called when the associated recording is resampled.

Return type:

None

Parameters:

new_f_s (float)