chipmuenk / pyfda

Python Filter Design Analysis Tool
http://chipmuenk.github.io/
MIT License
649 stars 93 forks source link

CSV Files with header crash pyfda #172

Open chipmuenk opened 4 years ago

chipmuenk commented 4 years ago

When trying to import a CSV file with a header inspite of setting Header = Off, the following warning occurs:

[WARNING] [pyfda.libs.pyfda_fix_lib:804] Can't convert coefficient_set_1: could not convert string to complex: 'coefficient_set_1'

The values are imported correctly to the table but the first row contains a zero. When copying the table to the internal dict, pyfda crashes with

Traceback (most recent call last):
    File "d:\daten\design\python\git\pyfda\pyfda\libs\pyfda_lib.py", line 1465, in fil_convert
    zpk = sig.tf2zpk(b,a)
    File "C:\Users\Chris\Anaconda3\lib\site-packages\scipy\signal\filter_design.py", line 1069, in tf2zpk
     z = roots(b)
     ...
    File "C:\Users\Chris\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 218, in _assert_finite
   raise LinAlgError("Array must not contain infs or NaNs")

This exception is not caught:

Traceback (most recent call last):
   File "d:\daten\design\python\git\pyfda\pyfda\input_widgets\input_coeffs.py", line 773, in _save_dict
     fil_save(fb.fil[0], self.ba, 'ba', __name__)
   File "d:\daten\design\python\git\pyfda\pyfda\libs\pyfda_lib.py", line 1382, in fil_save
      fil_convert(fil_dict, format_in)
   File "d:\daten\design\python\git\pyfda\pyfda\libs\pyfda_lib.py", line 1469, in fil_convert
      raise ValueError(e)
   ValueError: Array must not contain infs or NaNs
chipmuenk commented 1 year ago

The software no longer crashes, however, data in row format with headers still cannot be read. Headers in column format can be suppressed.