Skip to content

gmt meca -Sy plots incorrectly - swapped quadrants when P and T dips are equal. #8009

@MarshEnterprises

Description

@MarshEnterprises

Description of the problem

gmt meca: error with focal mechanism plots using the principle strain axes.

When plotting focal mechanisms with meca -Sy the tension and pressure quadrants are swapped if the dips of the T and P axes are equal.

see files below.

Full script that generated the error
error_demo.gmt.txt

#!/usr/bin/env bash

gmt set MAP_FRAME_TYPE plain

gmt begin error_demo pdf

gmt basemap -B -Btblr -JM15.90/-24.45/15c -R22.15/22.5/-32.85/-32.7

# testing faulty focal mechanism (red plot) using regular input
echo -e "22.35	-32.8	5 1	360	45 1	90 0 1 180 45 1 wrong_quadrants" | gmt psmeca -Sy1+m -Gred -Vd # added -Vd for verbose output

echo -e "22.2	-32.8	5 1	360	45 1	90 0 1 180 45.1 1 correct_quadrants" | gmt psmeca -Sy1+m -Gblue

gmt end

Full error message

No error message. When using the -Vd flag the following is output:

gmt [DEBUG]: GMT_Create_Session: Terminal width = 83
gmt [DEBUG]: Obtained the ppid from parent: 173076
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /usr/local/share
gmt [DEBUG]: GMT->session.HOMEDIR = /home/ben
gmt [DEBUG]: GMT->session.USERDIR = /home/ben/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /home/ben/.gmt/cache [created]
gmt [DEBUG]: GMT: 0. Will try to find subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt
gmt [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
gmt [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR /home/ben/.gmt
gmt [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir /home/ben/.gmt/postscriptlight
gmt [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /usr/local/share/postscriptlight
gmt [DEBUG]: GMT: 5. gmt_getsharepath trying SHAREDIR /usr/local/share
gmt [DEBUG]: GMT: 6. gmt_getsharepath failed
gmt [DEBUG]: Map distance calculation will be Cartesian
gmt [DEBUG]: Exit:  gmtinit_new_GMT_ctrl
gmt [DEBUG]: Enter: New_PSL_Ctrl
gmt [DEBUG]: Exit:  New_PSL_Ctrl
gmt [DEBUG]: Enter: gmt_manage_workflow
gmt [DEBUG]: GMT now running in modern mode [Session ID = 173076]
gmt [DEBUG]: Exit : gmt_manage_workflow
gmt [DEBUG]: Enter: PSL_beginsession
gmt [DEBUG]: Exit : PSL_beginsession
gmt [DEBUG]: Enter: PSL_setdefaults
gmt [DEBUG]: Exit : PSL_setdefaults
gmt [DEBUG]: Enter: gmtlib_io_init
gmt [DEBUG]: Exit : gmtlib_io_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_reload_settings
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0
gmt [DEBUG]: Reading GMT Default parameters from file: /home/ben/.gmt/sessions/gmt_session.173076/gmt.conf
gmt [DEBUG]: Exit:  gmt_reload_settings
gmt [DEBUG]: Enter: gmtlib_plot_C_format
gmt [DEBUG]: Exit:  gmtlib_plot_C_format
gmt [DEBUG]: Enter: gmtinit_get_history
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Exit:  gmtinit_get_history
gmt [DEBUG]: Initialize FFTW with 8 threads.
gmt [DEBUG]: GMT_Create_Session initialized GMT structure
gmt [DEBUG]: Loading core GMT shared library: libgmt.so
gmt [DEBUG]: Shared Library # 0 (core). Path = libgmt.so
gmt [DEBUG]: Loading GMT plugins from: /usr/local/lib/gmt/plugins
gmt [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/lib/gmt/plugins/supplements.so
gmt [DEBUG]: GMT now running in modern mode [Session ID = 173076]
gmt [INFORMATION]: Detected a classic module name (psmeca) in modern mode - please use the modern mode name meca instead.
gmt [DEBUG]: Use PS filename /home/ben/.gmt/sessions/gmt_session.173076/gmt_0.ps-
gmt [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
gmt [DEBUG]: Modern mode: Added -R to options since history is available [22.15/22.5/-32.85/-32.7].
gmt [DEBUG]: Modern: Adding -J to options since history is available [M15.90/-24.45/15c].
gmt [DEBUG]: Revised options: -Sy1+m -Gred -Vd -R -J
meca [DEBUG]: History: Process -R
meca [DEBUG]: History: Process -J
meca [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
meca [DEBUG]: Look for file 22.15/22.5/-32.85/-32.7 in /home/ben/.gmt
meca [DEBUG]: Look for file 22.15/22.5/-32.85/-32.7 in /home/ben/.gmt/cache
meca [DEBUG]: Look for file 22.15/22.5/-32.85/-32.7 in /home/ben/.gmt/server
meca [DEBUG]: Got regular w/e/s/n for region (22.15/22.5/-32.85/-32.7)
meca [DEBUG]: Reset MAP_ANNOT_OBLIQUE to anywhere
meca [DEBUG]: Projected values in meters: 633718 669206 -3.50879e+06 -3.49079e+06
meca [DEBUG]: Computed automatic parameters using dimension scaling: 0.909117
meca [INFORMATION]: Map scale is 2.36588 km per cm or 1:236588.
meca [DEBUG]: Running in PS mode modern
meca [DEBUG]: Use PS filename /home/ben/.gmt/sessions/gmt_session.173076/gmt_0.ps-
meca [DEBUG]: Append to hidden PS file /home/ben/.gmt/sessions/gmt_session.173076/gmt_0.ps-
meca [DEBUG]: No figure file /home/ben/.gmt/sessions/gmt_session.173076/gmt.figures - nothing to do
meca [DEBUG]: Got session name as error_demo and default graphics formats as pdf
meca [DEBUG]: Basemap order: Frame = above  Grid = below  Tick/Annot = below
meca [INFORMATION]: Linear magnitude scaling selected, normalizing by 5.
meca [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Point
meca [DEBUG]: gmtapi_init_import: Added 0 new sources
meca [DEBUG]: Object ID 0 : Registered Data Table Stream 7f8d0fce6aa0 as an Input resource with geometry Point [n_objects = 1]
meca [DEBUG]: gmtapi_init_import: Added stdin to registered sources
meca [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
meca [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
meca [DEBUG]: gmtapi_import_dataset: Passed ID = -1 and mode = 0
meca [INFORMATION]: Reading Data Table from Stream 7f8d0fce6aa0
meca [DEBUG]: Source col types: (Number,Number,Number,Number,Number,Number,Number,Number,Number,Number,Number,Number,Number,String)
meca [DEBUG]: ASCII source scanned: Numerical columns: 13, Trailing text: Y, Record type: Numerical with trailing text
meca [DEBUG]: GMT memory: Initialize 13 temporary column double arrays, each of length : 0
meca [DEBUG]: GMT memory: Initialize a temporary column char * array of length : 2097152
meca [DEBUG]: gmtapi_import_dataset processed 1 resources
meca [DEBUG]: GMT_End_IO: Input resource access is now disabled
meca [DEBUG]: GMT_End_IO: Input resource access is now disabled
meca [INFORMATION]: Number of records read: 1
meca [DEBUG]: Current size of half-baked PS file /home/ben/.gmt/sessions/gmt_session.173076/gmt_0.ps- = 23105.
meca [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=1 ID=0 W=Input F=Data Table M=Stream S=Used P=5580c182b610 N=(null)
meca [DEBUG]: GMTAPI_Garbage_Collection freed 1 memory objects
meca [DEBUG]: gmtlib_unregister_io: Unregistering object no 0 [n_objects = 0]
meca [DEBUG]: GMT memory: Free 13 temporary column arrays, each of length : 2097152
gmt [DEBUG]: Entering GMT_Destroy_Session
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0

Actual outcome

T and P quadrants are swapped
error_demo.pdf

Expected outcome

focal mechanism is plotted correctly.

System information

  • Operating system: Ubuntu 22.04.2 LTS x86_64
  • GMT version (gmt --version): GMT V6.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions