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

pssac produces different polarity by Y-size in J-option #6448

Open
lowbontimp opened this issue Mar 15, 2022 · 3 comments
Open

pssac produces different polarity by Y-size in J-option #6448

lowbontimp opened this issue Mar 15, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@lowbontimp
Copy link

I have updated gmt6 recently and found a very useful module pssac (gmt sac as a modern name). It reads sac files directly and make a record section while pswiggle needs an additional conversion from the sac file to xy-file. But, I like to notice that a feature of pssac can mislead gmt users. pssac represents the seismograms with different polarity when Y-size in J-option is positive and negative.

For example, "-J10c/5c" and "-J10c/-5c" make two reversed plots. This behavior is not natural because one expects that the upward direction of the paper is positive, in my opinion.

Let us make a sac file.

sac <<END
funcgen seismogram
write seismogram.sac
quit
END

Cap 2022-03-15 16-44-52-554
Captured image of the seismogram.sac

gmt pssac seismogram.sac -R10/12/-1/1 -JX10c/10c -P -M1 -Ba -Xc -Yc > a.ps

a
Normal polarity (a.ps)

gmt pssac seismogram.sac -R10/12/-1/1 -JX10c/-10c -P -M1 -Ba -Xc -Yc > b.ps

b
Reversed polarity with the negative Y-size in J-option (b.ps)

The similar module pswiggle does not behave like this way.

Suggestion
The polarity of the seismograms should be fixed as positive upward in the paper.

@lowbontimp lowbontimp added the bug Something isn't working label Mar 15, 2022
@welcome
Copy link

welcome bot commented Mar 15, 2022

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

Please make sure you read our Contributing Guide and abide by our Code of Conduct.

@seisman
Copy link
Member

seisman commented Mar 15, 2022

Thanks for reporting the issue.

In pssac, the Y-axis can have different meanings, depending on if -E option is used or not.


In your case, -E option is not used, so the Y-axis means waveform amplitudes. When you give a negative Y-size (e.g., -JX10c/-10c), I think the waveform polarity should be reversed becase now upward means negative amplitude. So I think in your case, it's not a bug. Do you agree?


When -E option is used, the Y-axis means different profiles, for example -Ek means a distance profile. Using your data as an example:

gmt pssac seismogram.sac -R10/12/350/400 -JX10c/10c -Ba -M3 -Ek > positive.ps
gmt pssac seismogram.sac -R10/12/350/400 -JX10c/-10c -Ba -M3 -Ek > negative.ps
positive.ps negative.ps
positive negative

I agree this is a bug and should be fixed.

@lowbontimp
Copy link
Author

Ah, I have missed -E option. Thanks for your comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants