Skip to content

Bug. Data get filter twice with psevents -q0:inc: #8460

Closed

Description

@Esteban82

With the improve version of animation 1 (#8459) I use the -q option to plot every 10 values (so I can avoid creating the point_sin.txt file).

I add -qi0:10: to events and I the values of 90, 190, 290 were plot (so every 100th value starting in 0). If I use plot instead, then I got the image ok.

gmt plot     sin_curve.txt -Sc0.3 -Gyellow -qi0:10:${MOVIE_FRAME}
gmt events sin_curve.txt -i0,1,0 -T${MOVIE_FRAME} -Sc0.2c -Gdarkred -qi0:10: -Vi

In the terminal, I got this message:
events [INFORMATION]: Events read: 37 Event symbols plotted: 35 Event labels plotted: 0

So, it thinks that 35 symbols were plotted (as gmt plot did) but there are only 3.

I suspect the events uses plot under the hood. And the data is filter by both modules. I tried to understand if this really happens (and where) but I couldn't. If someone could give a hint, I could try to solve it.

Bug_anim01

Full script:

# 1. Create files needed in the loop
cat << 'EOF' > pre.sh
gmt math -T0/360/1 T SIND = sin_curve.txt
gmt begin
	gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c \
	-BWSne+glightskyblue -Bxagf -Bya0.5f0.1g1 --FONT_ANNOT_PRIMARY=9p
gmt end
EOF
# 2. Set up the main frame script
cat << 'EOF' > main.sh
gmt begin
	gmt basemap -R0/360/-1.2/1.6 -JX22c/11.5c -X1c -Y1c -B+n
	i=10
	gmt plot   sin_curve.txt -Sc0.3 -Gyellow -qi0:$i:${MOVIE_FRAME}
	gmt events sin_curve.txt -i0,1,0 -T${MOVIE_FRAME} -Sc0.2c -Gdarkred -qi0:$i: -Vi
	
gmt end
EOF
# 3. Run the movie
gmt movie main.sh -Sbpre.sh -Chd -Tsin_curve.txt -D50 -NBug_anim01 \
	-Lf+t"a = %3.3d"+f14p,Helvetica-Bold+jTL+o1.25/1.15 -M345,png

Activity

  1. added
    bug
    on Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions