Trouble coloring events symbols with cpt

Hello all,

I’ve been experimenting with the movie and events modules to create animations of earthquake timeseries. My goal is to color the earthquakes by date and set the symbol size by the earthquake magnitude. However, I’m running into a problem that I can’t resolve using -C with a cpt file to color the earthquakes by time. Here are some of the inputs I’m working with:

Earthquake data (quakes.txt) are taken from the USGS catalog and formatted into 5 columns: longitude, latitude, time, magnitude, and time (again). For example:

-114.291  44.5621667  2020-03-31T18:17:41  2.05  2020-03-31T18:17:41

I created the quakes_date.cpt with a different color for each day in the range using the following command:

gmt makecpt -Cjet -T2020-03-01T/2021-04-01T/1d > quakes_date.cpt

I also have a times.txt file that movie uses to advance through frames (using the first column):

2020-01-01T00:00:00  18262

Following the example code from a recent UNAVCO shortcourse (2020-unavco-course/animation/ at master · GenericMappingTools/2020-unavco-course · GitHub), I created a script that includes the following command:

gmt events quakes.txt -T${MOVIE_COL0} \
                -SE- -Cquakes_date.cpt -Es+r2+d6 \
                -Ms5+c0.5 -Mi1+c-0.6 -Mt+c40 --TIME_UNIT=d

The events man page states that if no size is specified with -S, it will read size from the third column of data input (or fourth data column if -C is also used). Since I’m using -C and not specifying size with -S it should read the third column (time) for symbol color and the fourth column (magnitude) for size. However, when I run movie to create a single frame or an entire movie, the earthquake symbols only show up as black or gray.

The rising and decaying “flashes” do show up in this frame as larger white circles. For some reason when using events, the symbols are not being colored by date. I tried a simpler version using plot

gmt plot quakes.txt -Cquakes_date -SE-

and it produced a figure that correctly colored the earthquakes by date:

It seems that there is a difference in how plot and events is reading the cpt file or the input quakes file. I tried ordering the earthquake data columns in many different ways, but could not get the correct result.

Am I misunderstanding something with events or is something else going on here?


Don’t think I have tried time-coloring via events so it is possibly/probably it is a bug. Perhaps you can try to add a suitable -f option to events, i.e. -f?T where ? is the column number with your date used for CPT lookup. I think -f2T for you. You can also do some sleuting by using the events -Q option and examine the intermediate data file going into plot via events. Just do this for one frame via movie -M and use -Fnone.

Thank you Paul for the reply. I tried out -f2T, but couldn’t get any earthquakes to plot. When I have some time I’ll try out -Q to see what the intermediate data looks like.


1 Like