Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAC output ignores sampling rate from Trace metadata #1317

Merged
merged 5 commits into from Mar 12, 2016

Conversation

Projects
None yet
4 participants
@jkmacc-LANL
Copy link
Contributor

jkmacc-LANL commented Mar 10, 2016

When using the trace.decimate() function in v.1.0.0 on .SAC formatted traces, the new sampling rate isn't updated in the trace metadata. I've tried to work around it by decimating, then forcing the trace to update the stats with the new sampling rate using trace.stats.update. This does work for the current instance, however, when writing the trace out as a .SAC, the old sampling rate is written into the stats.

@QuLogic QuLogic added this to the 1.0.x milestone Mar 5, 2016

@QuLogic QuLogic changed the title trace.decimate() not updating the new sampling rate when using .SAC format. (v.1.0.0) SAC output ignores sampling rate from Trace metadata Mar 5, 2016

@QuLogic

This comment has been minimized.

Copy link
Member

QuLogic commented Mar 5, 2016

I have updated the title; nothing is wrong with trace.decimate. It is SAC output that is incorrect.

@s-g-mo

This comment has been minimized.

Copy link
Author

s-g-mo commented Mar 5, 2016

Oh, of course! Thanks for the clarification.

jkmacc-LANL added some commits Mar 10, 2016

Propagate new stats.delta,npts to SAC header
Updates in stats.npts and stats.delta due to resampling/decimation are
propagated to new SAC header.  Fixes #1317.
@jkmacc-LANL

This comment has been minimized.

Copy link
Contributor

jkmacc-LANL commented Mar 11, 2016

This was pretty straightforward. Ready to merge.

@@ -22,7 +22,7 @@
when read into sac. [required]''',
'b': 'F Beginning value of the independent variable. [required]',
'e': 'F Ending value of the independent variable. [required]',
'iftype': '''I Type of file [required]:
'iftype': '''I Type of file [required]:\n

This comment has been minimized.

Copy link
@QuLogic

QuLogic Mar 11, 2016

Member

What is this escaped newline? Why just add a real newline?

This comment has been minimized.

Copy link
@jkmacc-LANL

jkmacc-LANL Mar 11, 2016

Author Contributor

Doesn't pass flake8:-( This just helps the docs look nicer.

This comment has been minimized.

Copy link
@QuLogic

QuLogic Mar 11, 2016

Member

Uh, no it won't. It's in a docstring; the only relevant check is line-length.

This comment has been minimized.

Copy link
@jkmacc-LANL

jkmacc-LANL Mar 11, 2016

Author Contributor

Hmmm, you're right. Could've sworn it mattered. Fixed. BTW, man those docs take for ever to build.

This comment has been minimized.

Copy link
@QuLogic

QuLogic Mar 11, 2016

Member

Yea, it's all those networked examples...

This comment has been minimized.

Copy link
@megies

megies Mar 12, 2016

Member

Maybe it'd worth a shot to do something similar to obspy-runtests, i.e. add the possibility to build only one specific module..

@megies

This comment has been minimized.

Copy link
Member

megies commented Mar 12, 2016

This was pretty straightforward. Ready to merge.

Alright, merging then.

megies added a commit that referenced this pull request Mar 12, 2016

Merge pull request #1317 from obspy/fix_SAC_sampling_rate
SAC output ignores sampling rate from Trace metadata

@megies megies merged commit 0bca971 into maintenance_1.0.x Mar 12, 2016

3 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@megies megies deleted the fix_SAC_sampling_rate branch Mar 12, 2016

@QuLogic QuLogic modified the milestones: 1.0.x, 1.0.1 Mar 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.