Conversation
- Add time_filter configuration option with night_start and night_stop times - Implement timestamp parsing from .npz filenames - Add filtering logic to plot_ppsd functions in both PPSD_plotter.py and gui.py - Support time ranges that span midnight (e.g., 22:00 to 06:00) - Update example_config.yaml with documentation on usage - Maintain backward compatibility - feature is optional Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
…lity - Add 10 comprehensive unit tests for time filtering functions - Remove __pycache__ files from git tracking - Update .gitignore to exclude PPSD output files (npz_*/ and *.png) - Make timewindow parameter optional with default value of 3600 Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
- Move parse_npz_timestamp, is_time_in_range, and filter_npz_files_by_time to ppsd_plotter_aux.py - Update PPSD_plotter.py and gui.py to import from ppsd_plotter_aux - Update tests to import from ppsd_plotter_aux - Remove duplicate function definitions from PPSD_plotter.py and gui.py - All tests still pass after refactoring Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
- Simplify time format parsing using a loop instead of nested try-except - Add more helpful error messages showing expected formats and invalid input - Define DEFAULT_TIME_WINDOW constant instead of using magic number 3600 - All tests still pass after improvements Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
- Document time_filter configuration in README.md - Include usage examples and notes about time range behavior - Mark day/night TODO item as completed - Provide clear examples of daytime and nighttime filtering Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
|
@copilot It looks like there is a user interface missing... So this probably should be fixed by using |
- Add time_filter to DEFAULT_DATASET with None default - Add Time Filter section in DatasetFrame with Start Time and End Time inputs - Add update_time_filter() method to handle user input - Add localization labels and tooltips for time_filter, night_start, night_stop - Add German translations for new UI elements - Time filter UI placed after plot options and before custom noise section - Input validation: requires both start and stop times or neither Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
Added GUI interface for the time filtering feature in commit 7ec8e35. Changes:
The time filter values are saved to the dataset configuration and used when generating plots. Leave both fields empty to use all data (default behavior). |
|
@copilot There is an issue with this approach. If, for example, we do have hour files (miniseed's) this works, but if we have miniseeds for days (24h in one file) this idea won't work. |
You're absolutely right about the limitation. The current filename-based filtering won't work for long traces (24h+ miniseed files). The Problem: Proposed Solutions: Option 1: Filter during calculation (recommended)
Option 2: Filter from .npz contents
Option 3: Document limitation
Which approach would you prefer? Option 1 seems most robust but requires recalculating for each time filter. Also fixing the missing translations (RU, RS, TR) in the next commit. |
- Add Russian (RU) translations for time_filter, night_start, night_stop - Add Serbian (RS) translations for time_filter, night_start, night_stop - Add Turkish (TR) translations for time_filter, night_start, night_stop - All languages now have complete localization for time filtering feature Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
|
@copilot Let's go with the first option and look into each miniseed file. |
- Add split_trace_by_time_filter() to handle 24h+ miniseed files - Traces are now split at day/night boundaries during calculation - Split segments are labeled with _day or _night suffix in filenames - Updated calculate_ppsd() to split traces before PPSD processing - Updated calculate_ppsd_worker() in GUI to support trace splitting - Updated filter_npz_files_by_time() to handle both old and new filename formats - Backward compatible: old unlabeled files still work with timestamp filtering - Added comprehensive tests for new labeled file filtering - All 13 tests pass Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
Implemented trace splitting solution in commit 68ac9cd. How it works:
Key features:
The splitting happens during the "calculate" phase, so you'll need to recalculate with a time_filter to generate the labeled files. Once calculated, you can plot different time periods instantly by changing the filter. |
|
@copilot Thanks a lot.
|
- Fix split_trace_by_time_filter() midnight spanning logic * Correctly set day_start to current day's night_stop (not next day's) * Correctly set day_end to current day's night_start * Now properly captures data from 00:00 to morning time (e.g., 07:00) - Add warning when using time_filter with unlabeled .npz files * Informs users to recalculate for best results * Clarifies that timestamp-based filtering is being used - All 13 tests still pass Co-authored-by: msbdd <99192142+msbdd@users.noreply.github.com>
Fixed both issues in commit 3327e8f. Issue #2 - Midnight boundary bug (22:00 to 07:00 not capturing 00:00-07:00):
Now correctly captures both night segments (22:00-00:00 and 00:00-07:00). Issue #1 - Ignoring filters with existing unlabeled .npz files:
Added warning message to clarify when timestamp-based fallback is being used. To get properly split files for your existing data, run with |
Update README with completed TODO item for plotting function.

Day/Night Filtering Implementation - Complete ✅
Latest Fixes
Midnight Boundary Bug (Issue #2):
Unlabeled Files Warning (Issue #1):
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.