Skip to content

Commit 17f8e9c

Browse files
committed
improve filter window ouput
1 parent d171d46 commit 17f8e9c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pypaw/bins/filter_windows.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,23 @@ def run_window_filter(paths, params, verbose=False):
8181

8282
windows = load_json(window_file)
8383
# count the number of windows in the original window file
84-
nchans_old, nwins_old = count_windows(windows)
84+
nchans_old, nwins_old, nwins_comp_old = count_windows(windows)
8585
stations = load_json(station_file)
8686
measurements = load_json(measurement_file)
8787

8888
# filter the window based on given sensor types
8989
windows_new, measures_new, log = filter_windows(
9090
windows, stations, measurements, params, verbose=verbose)
9191

92-
nchans_new, nwins_new = count_windows(windows_new)
92+
nchans_new, nwins_new, nwins_comp_new = count_windows(windows_new)
9393

9494
assert_windows_and_measurements_same_length(windows_new, measures_new)
9595
print("=" * 10 + " Summary " + "=" * 10)
96+
print("channels: %d --> %d" % (nchans_old, nchans_new))
97+
print("windows: %d -- > %d" % (nwins_old, nwins_new))
98+
print("Old component windows: %s" % (nwins_comp_old))
99+
print("New component windows: %s" % (nwins_comp_new))
100+
96101
# dump the new windows file to replace the original one
97102
print("Filtered window files: %s" % output_file)
98103
dump_json(windows_new, output_file)
@@ -103,11 +108,8 @@ def run_window_filter(paths, params, verbose=False):
103108

104109
# dump the log file
105110
logfile = os.path.join(os.path.dirname(output_file), "filter.log")
106-
dump_json(log, logfile)
107-
108-
print("channels: %d --> %d" % (nchans_old, nchans_new))
109-
print("windows: %d -- > %d" % (nwins_old, nwins_new))
110111
print("Log file located at: %s" % logfile)
112+
dump_json(log, logfile)
111113

112114

113115
def main():

0 commit comments

Comments
 (0)