Skip to content

Figure.sac: Plot seismograms in SAC format - #4854

Open
Chuan1937 wants to merge 29 commits into
mainfrom
figure-sac
Open

Figure.sac: Plot seismograms in SAC format#4854
Chuan1937 wants to merge 29 commits into
mainfrom
figure-sac

Conversation

@Chuan1937

@Chuan1937 Chuan1937 commented Aug 24, 2026

Copy link
Copy Markdown
Member

This pull request wraps the module sac.

Preview at https://pygmt-dev--4854.org.readthedocs.build/en/4854/api/generated/pygmt.Figure.sac.html

Related to #4853.

@Chuan1937 Chuan1937 changed the title add base parameters and tests for sac module Figure.sac: Plot seismograms in SAC format Aug 24, 2026
@Chuan1937 Chuan1937 self-assigned this Aug 24, 2026
@Chuan1937 Chuan1937 added the feature Brand new feature label Aug 24, 2026
@Chuan1937 Chuan1937 added this to the 0.20.0 milestone Aug 24, 2026
@Chuan1937
Chuan1937 requested a balanced review from Copilot August 24, 2026 05:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Chuan1937 and others added 5 commits August 24, 2026 13:31
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Chuan1937 and others added 4 commits September 7, 2026 14:26
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Chuan1937 and others added 4 commits September 8, 2026 11:06
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Chuan1937 and others added 2 commits September 8, 2026 12:47
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/src/sac.py Outdated
Comment thread pygmt/src/sac.py Outdated
Chuan1937 and others added 4 commits September 8, 2026 19:07
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment thread pygmt/src/sac.py
Comment on lines +189 to +201
preprocess_value = None
if preprocess:
preprocess_values: list[str] = []
for operation in preprocess:
value = Alias(
operation,
name="preprocess",
mapping={"integral": "i", "square": "q", "demean": "r"},
)._value
if not isinstance(value, str):
raise GMTValueError(value, description="preprocess operation")
preprocess_values.append(value)
preprocess_value = "".join(preprocess_values)

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.

Please move this code block into a private function _alias_option_F and add some doctests for it. You can use subplot.py as a reference.

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

Labels

feature Brand new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants