better CSV file filtering
This commit is contained in:
@@ -457,8 +457,8 @@ def belts_calibration(lognames, klipperdir='~/klipper', max_freq=200.0, st_versi
|
||||
global shaper_calibrate
|
||||
shaper_calibrate = setup_klipper_import(klipperdir)
|
||||
|
||||
# Parse data
|
||||
datas = [parse_log(fn) for fn in lognames]
|
||||
# Parse data from the log files while ignoring CSV in the wrong format
|
||||
datas = [data for data in (parse_log(fn) for fn in lognames) if data is not None]
|
||||
if len(datas) > 2:
|
||||
raise ValueError('Incorrect number of .csv files used (this function needs exactly two files to compare them)!')
|
||||
|
||||
|
||||
@@ -299,8 +299,8 @@ def shaper_calibration(lognames, klipperdir='~/klipper', max_smoothing=None, scv
|
||||
global shaper_calibrate
|
||||
shaper_calibrate = setup_klipper_import(klipperdir)
|
||||
|
||||
# Parse data
|
||||
datas = [parse_log(fn) for fn in lognames]
|
||||
# Parse data from the log files while ignoring CSV in the wrong format
|
||||
datas = [data for data in (parse_log(fn) for fn in lognames) if data is not None]
|
||||
if len(datas) > 1:
|
||||
print_with_c_locale('Warning: incorrect number of .csv files detected. Only the first one will be used!')
|
||||
|
||||
|
||||
@@ -651,6 +651,8 @@ def vibrations_profile(
|
||||
|
||||
for logname in lognames:
|
||||
data = parse_log(logname)
|
||||
if data is None:
|
||||
continue # File is not in the expected format, skip it
|
||||
angle, speed = extract_angle_and_speed(logname)
|
||||
freq_response = calc_freq_response(data)
|
||||
first_freqs = freq_response.freq_bins
|
||||
|
||||
Reference in New Issue
Block a user