Skip to content

Add station_codes and picked_stations_only config parameters for waveform downloading - #8

Closed
claudiodsf with Copilot wants to merge 3 commits into
mainfrom
copilot/propose-pr-solution
Closed

Add station_codes and picked_stations_only config parameters for waveform downloading#8
claudiodsf with Copilot wants to merge 3 commits into
mainfrom
copilot/propose-pr-solution

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses feature request #7 by adding two new station selection criteria for downloading waveforms:

1. station_codes — filter by station name

Similar to the existing channel_codes parameter, but for station names. Supports multiple codes and wildcard patterns (? for single character, * for any characters).

Example config:

# Download only stations named STA1, STA2, or any station starting with "AB"
station_codes = "STA1,STA2,AB*"

2. picked_stations_only — restrict to stations with P/S picks

When set to True, only stations with at least one P or S-wave arrival in the event catalog are downloaded. This requires a QuakeML event details file to be present (generated by seiscat fetch_details). A warning is shown if the file is missing, and the download falls back to other criteria.

Example config:

picked_stations_only = True

Both criteria can be combined: if both station_codes and picked_stations_only are set, only stations that satisfy both conditions are downloaded.

Changes

  • seiscat/config/configspec.conf: two new documented parameters
  • seiscat/fetchdata/event_waveforms_utils.py:
    • check_station() — wildcard pattern matching for station names
    • get_picked_station_codes() — extracts station codes with P/S picks from a QuakeML file
  • seiscat/fetchdata/mass_downloader.py:
    • new _build_station_restriction() helper that builds the combined station restriction
    • passes station restriction to ObsPy Restrictions
  • seiscat/fetchdata/sds.py: applies station restrictions when fetching from local SDS archive
  • tests/test_station_selection.py: 11 new unit tests (wildcard matching and pick extraction)
  • CHANGELOG.md: updated with the new features

Copilot AI and others added 2 commits April 21, 2026 12:21
@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.62963% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
seiscat/fetchdata/mass_downloader.py 6.06% 31 Missing ⚠️
seiscat/fetchdata/event_waveforms_utils.py 75.00% 4 Missing and 4 partials ⚠️
tests/test_station_selection.py 97.14% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Comment thread RELEASE_HEAD.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be touched. It's used for the GitHub action that generates a release

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please make the required changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in a13cf7a.

Agent-Logs-Url: https://github.com/SeismicSource/seiscat/sessions/fcea3539-9c4c-4e3a-8f13-7f2267f2af44

Co-authored-by: claudiodsf <1390993+claudiodsf@users.noreply.github.com>
@claudiodsf

Copy link
Copy Markdown
Member

Branch was renamed to 'copilot/add-waveform-station-filters'. Continuing discussion in the replacement PR: #10

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants