Hello,
I’m using gmt 6.5.0 with shell commands for a while, but don’t understand why the meca module doesn’t change the color of the beachballs with depth as expected using -C.
My code is : gmt meca CMT_file.txt -R -J -Sd0.25c+f0 -Chaxby
The “CMT_file” comes from globalcmt.org and is formatted for psmeca, with depth in 3rd column, as required.
The meca module description says for -C : “give a CPT and let compressive part color be determined by the z-value in the third column.” But what I have is :
“meca [ERROR]: Pen name haxby not recognized!”
I don’t understand why -C is taken as a “pen”, and why the meca module doesn’t give me the expected result.
Thanks for any help.
Cyril
Hi @Cyrkhan,
difficult to say what is the issue here. Can you please provide an example file for your CMT_file.txt?
Hello,
Here is an extract of my CMT_file.txt
# Results
# Output in GMT psmeca (GMT v>3.3) format
# Columns: lon lat depth mrr mtt mpp mrt mrp mtp iexp name
#
-72.62 18.61 12 1.74 -3.87 2.13 -0.53 -1.06 2.74 26 X Y 201001122153A
-72.88 18.58 12 1.22 -0.91 -0.31 -0.03 0.19 0.50 25 X Y 201001122200A
-72.97 18.66 12 0.81 -0.70 -0.11 -0.36 -0.26 0.23 24 X Y 201001130059B
-72.98 18.63 13 3.34 -3.03 -0.31 -0.97 0.21 0.81 24 X Y 201001130132A
-72.98 18.60 13 2.80 -2.74 -0.06 -0.13 -0.31 0.21 24 X Y 201001130136A
-73.08 18.59 14 5.84 -4.66 -1.17 -0.86 -3.02 1.91 23 X Y 201001130155A
-73.02 18.64 12 1.84 -1.58 -0.26 -0.11 -0.42 0.23 24 X Y 201001130157A
-72.92 18.64 12 5.53 -4.83 -0.69 0.18 -0.11 1.22 24 X Y 201001130503A
-72.83 18.51 14 0.77 -0.38 -0.39 -0.10 0.25 0.61 24 X Y 201001130518A
-72.95 18.71 12 5.87 -5.62 -0.26 0.62 0.06 0.21 23 X Y 201001131443A
-63.53 10.55 14 -0.22 0.56 -0.35 0.13 -0.35 -2.77 24 X Y 201001151800A
-80.91 18.99 19 -0.29 -3.15 3.44 1.34 -0.59 7.84 24 X Y 201001191423A
-72.81 18.67 12 0.76 -0.63 -0.13 -0.02 -0.04 0.21 25 X Y 201001201103A
-83.02 8.36 12 1.08 -0.99 -0.09 0.27 -0.02 0.48 24 X Y 201001230908A
-83.03 8.42 15 2.09 -1.84 -0.25 -0.16 0.35 0.74 23 X Y 201001231436A
-82.97 8.39 15 3.50 -3.10 -0.41 0.31 1.54 1.40 23 X Y 201001231443A
-83.01 8.33 12 3.62 -3.82 0.20 1.02 -0.02 1.01 23 X Y 201001232022A
-60.86 16.15 60 -1.73 -2.34 4.07 -2.53 0.98 -0.73 23 X Y 201001242243A
-85.49 17.10 28 -0.49 -3.97 4.45 -0.39 1.56 4.77 23 X Y 201002210056A
-75.25 19.86 18 2.91 -3.31 0.40 -0.44 -1.30 1.37 24 X Y 201003201808A
-75.30 19.84 22 3.75 -4.38 0.63 0.91 -1.35 1.40 23 X Y 201003201931A
-81.71 18.04 14 -6.24 0.84 5.40 -0.60 0.03 -2.10 23 X Y 201004050729A
-76.55 19.94 18 1.96 -1.33 -0.64 1.54 -0.83 0.69 23 X Y 201004130237A
-81.74 18.04 12 -3.90 0.89 3.01 -1.79 0.53 -2.24 23 X Y 201004180138A
-68.51 18.25 77 1.27 -5.20 3.93 -1.34 3.02 -0.14 23 X Y 201004182016A
-60.88 16.56 47 0.70 -0.19 -0.51 -0.19 0.34 0.41 24 X Y 201005072312A
-67.13 18.41 116 -4.23 -1.92 6.15 3.13 3.66 0.64 24 X Y 201005160516A
But since my question, I’ve obtained the map I need, using the command:
gmt meca CMT_file.tx $region $projection -Sd0.25c/0 -D0/10 -Ggold
and repeating this for several depth ranges in -D (-D10/30, -D30/100…), and distinct colors for -G.
So, first I don’t understand the use of the -C argument. Second, is there a way to make a loop in bash shell to repeat the gmt meca command for several depth ranges and different colors ? I thinked it was the role of the -C argument.
Please, if you want help you must help yourself and post a full working command. And I’ll note that using $region is NOT a reproducible command. Not to mention that doesn’t work on Windows cmd.
Yes, my apologies, the full command is
gmt meca CMT_file.txt -R-86/-54/8/22 -JM-70/15/15c -Sd0.25c+f0 -D0/10 -Ggold
but the precise geographical zone and the projection used are not the point here.
Reading the GMT manual, I thinked that the command
gmt meca CMT_file.txt -R-86/-54/8/22 -JM-70/15/15c -Sd0.25c/f0 -Chaxby
would change the focal ball color according to the seismic depth and more easily than the combination of -D and -G.
This looks a bug. Please open an issue with this (but note that this is invalid -Sd0.25c/f0)
It doesn’t work with a master CPT.
As a workaround you could use makecpt first:
gmt begin map png
gmt makecpt -T0/200 -Chaxby -I
gmt meca CMT_file.txt -R-86/-54/8/22 -JM-70/15/15c -Sd0.25c+f0 -C
gmt end
Great ! That works !
Thanks a lot ! I think I see now a little better how to use makecpt.
This limitation has been fixed in master (dev version).