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

Fix events for infinite symbols #8611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Esteban82
Copy link
Member

Intro

The description about the coda phase in the events documentation mentions:

" You may also wish for symbols to disappear completely after they reach their end time (we call this period the coda), or perhaps remain visible but faded, shrunk, or darkened."

Also, at the end of the -M section, it says:

Optionally, for finite-duration events that should remain visible for all times after their event end time has been reached you must append +c (for coda) to set the corresponding terminal value during the coda. If +c is not given then the defaults are 0 (intensity), 0 (size), 100 (transparency) and 0 (value), meaning the symbols are not plotted unless you change these attributes with one or more +c modifiers (one per directive).

This implies that symbols without a defined duration (infinite) shouldn’t reach the coda phase. However, currently, this is what is happening (as seen in animation #8607 and animation 08).

This also means that I have to define the symbol properties via the coda phase modifiers (-M+c). In fact, I must include these modifiers to make the symbols visible (e.g., like -Mt+c0), because the default behavior is for them to become invisible.

Proposed Fix

I made a fix to address this issue. The problem was (I believe) that only events with finite duration could reach the normal phase. So, in this PR, I remove that condition. I tested it on my PC (with the same script from the previous link) and got this animation, which looks fine to me:

Tutorial_1_Test.mp4

I think this solution is better because now the symbols at the end retain the properties defined by -Sc and -G (without the -M+c modification). This means the code could be simplified:

gmt events violet.t -T${MOVIE_COL0} -Sc2c -W1p -Gblueviolet
gmt events blue.t   -T${MOVIE_COL0} -Sc2c -W1p -Gblue   -Ms1.5 -Mi1 -Mt -Es+r0.25
gmt events green.t  -T${MOVIE_COL0} -Sc2c -W1p -Ggreen  -Ms1.5 -Mi1 -Mt -Es+r0.25+d0.25
gmt events yellow.t -T${MOVIE_COL0} -Sc2c -W1p -Gyellow -Ms1.5 -Mi1 -Mt -Es+r0.25+p0.25
gmt events orange.t -T${MOVIE_COL0} -Sc2c -W1p -Gorange -Ms1.5 -Mi1 -Mt -Es+r0.25+p0.25+d0.25
gmt events red.t    -T${MOVIE_COL0} -Sc2c -W1p -Gred    -Ms1.5 -Mi1 -Mt -Es+r0.25+p0.25+d0.25+f0.25

I also try the original animation made by Paul (WED-A_Vid_1.sh) and I got the same animation.

@Esteban82 Esteban82 added the bug Something isn't working label Nov 2, 2024
@Esteban82 Esteban82 self-assigned this Nov 2, 2024
@Esteban82 Esteban82 requested review from joa-quim and seisman November 2, 2024 19:01
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

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

I can't say that I fully understand the issue but I've not worked with animations for quite some time. But you do, so I trust that this is an improvement.

@Esteban82
Copy link
Member Author

I am quite confident that it is an imporvement necessary. I am confident (although a little less so) that the modification I made to the code is the correct one. But I guess if it is wrong, we will figure it out. My tests were fine.

@Esteban82
Copy link
Member Author

This PR affects the output of this test (test/psevents/events.sh (Failed)).
I have to see how to update that.

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

Successfully merging this pull request may close these issues.

2 participants