GenericMappingTools / GenericMappingTools/pygmt

Figure.sac: Plot seismograms in SAC format

Open
#4,853 3 comments 0 reactions 1 assignee Claimed by @Chuan1937 View on GitHub
feature request
Dominant language
Python
Stars
874
Forks
255
Avg merge
1d 21h
Merged PRs (30d)
40

Description

*This issue serves as the central place for discussing and tracking the implementation of the `sac` method in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at https://github.com/orgs/GenericMappingTools/projects/3.*

## Documentation

- GMT: https://docs.generic-mapping-tools.org/dev/supplements/seis/sac.html
- GMT.jl: https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/sac
- PyGMT: https://www.pygmt.org/dev/api/generated/pygmt.Figure.sac.html

## GMT Option Flags and Modifiers

☑️: *Implemented*; ⬜: *To be implemented/discussed*; ~~Strikethrough~~: *Won't implement*.

- [x] `-B`: `frame`
- [x] `-J`: `projection`
- [x] `-R`: `region`
- [x] `-C`: `time_window`
- [x] `-D`: `offset`
- [x] `-E`: `profile`, `trace_number_start`
- [ ] `-F`: `preprocess`
- [ ] `-G`: `fill`
- [ ] `-M`: `amplitude_scale`
- [x] `-Q`: `vertical`
- [ ] `-S`: `time_scale`
- [ ] `-T`: `reduction_velocity`, `time_shift`, `time_reference`
- [x] `-W`: `pen`
- [x] `-V`: `verbose`
- ~~`-X`/`-Y`~~: Use `Figure.shift_origin` instead.
- ~~`--PAR=value`~~: Use `pygmt.config` instead.
- [x] `-c`
- [ ] `-h`
- [x] `-p`
- [x] `-t`

## Related GMT configurations

*List any related GMT configurations that may affect the behavior.*

## Notes on Input Formats

The GMT `sac` module accepts SAC waveform files as input. Since ObsPy is widely used for seismic waveform processing in Python, support for ObsPy `Trace`/`Stream` objects could also be considered.

For example:

```python
from obspy import read

trace = read("example.sac")[0]

fig.sac(spec=trace)
```
## Linked Pull Requests

- [x] Initial feature implementation(#4854)
- [ ] Add a tutorial or gallery example

## Related Issues and Discussions

*Add links to related wrapper discussions, API design threads, or upstream GMT changes here.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.