Skip to content

csv_to_wfdb ignores several parameters when writing #592

Closed

Description

@tompollard

Found while reviewing #591.

csv_to_wfdb accepts several parameters that have no effect on the written record:

  • dat_file_name is always overwritten with <record_name>.dat (
    dat_file_name = record_name + ".dat"
    dat_file_name = [dat_file_name] * n_sig
    ), in both modes.
  • When writing (record_only=False), only some arguments are passed to wrsamp (
    # Write the information to a record and header file
    wrsamp(
    record_name=record_name,
    fs=fs,
    units=units,
    sig_name=sig_name,
    p_signal=p_signal,
    fmt=fmt,
    adc_gain=adc_gain,
    baseline=baseline,
    comments=comments,
    base_time=base_time,
    base_date=base_date,
    write_dir=write_dir,
    ):
    • samps_per_frame is dropped, although wrsamp accepts it.
    • counter_freq, base_counter, skew and byte_offset are dropped, and wrsamp has no matching parameters.
    • adc_res, adc_zero, init_value, checksum and block_size are computed or accepted but then recomputed by wrsamp.

One option is to build a Record in both modes and call Record.wrsamp(write_dir=...), so that writing uses the same fields as record_only=True. For parameters that don't make sense for CSV input (for example checksum or init_value, which should follow from the samples), deprecating them may be better than passing them through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions