diff --git a/doc/rst/source/plot_common.rst_ b/doc/rst/source/plot_common.rst_ index 576d15d697b..446ef98b2ce 100644 --- a/doc/rst/source/plot_common.rst_ +++ b/doc/rst/source/plot_common.rst_ @@ -133,7 +133,7 @@ Optional Arguments .. _-H: -**-H** +**-H**\ [*scale*] Scale symbol sizes and pen widths on a per-record basis using the *scale* read from the data set, given as the first column after the (optional) *z* and *size* columns [no scaling]. The symbol size is either provided by **-S** or via the input *size* column. Alternatively, diff --git a/doc/rst/source/supplements/geodesy/psvelo.rst b/doc/rst/source/supplements/geodesy/psvelo.rst index b3ee3fde6e7..8f0cbcd2f6e 100644 --- a/doc/rst/source/supplements/geodesy/psvelo.rst +++ b/doc/rst/source/supplements/geodesy/psvelo.rst @@ -20,6 +20,7 @@ Synopsis [ |-C|\ *cpt*] [ |-E|\ *fill* ] [ |-G|\ *fill* ] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] [ |-K| ] [ |-L|\ [*pen*\ [**+c**\ [**f**\|\ **l**]]] ] diff --git a/doc/rst/source/supplements/geodesy/velo.rst b/doc/rst/source/supplements/geodesy/velo.rst index 1bfafda7421..70cd13a5bac 100644 --- a/doc/rst/source/supplements/geodesy/velo.rst +++ b/doc/rst/source/supplements/geodesy/velo.rst @@ -20,6 +20,7 @@ Synopsis [ |-C|\ *cpt*] [ |-E|\ *fill* ] [ |-G|\ *fill* ] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] [ |-L|\ [*pen*\ [**+c**\ [**f**\|\ **l**]]] ] [ |-N| ] diff --git a/doc/rst/source/supplements/geodesy/velo_common.rst_ b/doc/rst/source/supplements/geodesy/velo_common.rst_ index 94f554e4193..52ab33f906c 100644 --- a/doc/rst/source/supplements/geodesy/velo_common.rst_ +++ b/doc/rst/source/supplements/geodesy/velo_common.rst_ @@ -162,6 +162,14 @@ Optional Arguments **Note**: Using **-C** (and optionally **-Z**) will update the symbol fill color based on the selected measure in **-Z** [magnitude]. +.. _-H: + +**-H**\ [*scale*] + Scale symbol sizes and pen widths on a per-record basis using the *scale* read from the + data set, given as the first column after the (optional) *z* and *size* columns [no scaling]. + The symbol size is either provided by **-S** or via the input *size* column. Alternatively, + append a constant *scale* that should be used instead of reading a scale column. + .. _-I: **-I**\ *intens* @@ -246,13 +254,13 @@ Data Column Order ----------------- The **-S** option determines how many data columns are required to generate -the selected symbol. In addition, your use of options **-I** and **-t** will -require extra columns, as will a **-S** option without the *scale* or a user-column +the selected symbol. In addition, your use of options **-H**, **-I** and **-t** will +require extra columns, as will a **-S** option without the *size* or a user-column selected via **-Zu** for color lookup purposes. The order of the data record is fixed regardless of option order, even if not all items may be activated. We expect data columns to come in the following order:: - lon lat symbol-columns [usercol] [scale] [intens] [transp [transp2]] [trailing-text] + lon lat symbol-columns [usercol] [size] [scale] [intens] [transp [transp2]] [trailing-text] where *symbol-columns* represent the normally required data columns, and items given in brackets are optional and under the control of the stated options diff --git a/doc/rst/source/supplements/seis/coupe.rst b/doc/rst/source/supplements/seis/coupe.rst index 97d9d86d8ff..7a5b8424bd1 100644 --- a/doc/rst/source/supplements/seis/coupe.rst +++ b/doc/rst/source/supplements/seis/coupe.rst @@ -20,6 +20,7 @@ Synopsis [ |-E|\ *fill* ] [ |-F|\ *mode*\ [*args*] ] [ |-G|\ *fill* ] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] [ |-L|\ [*pen*] ] [ |-M| ] [ |-N| ] diff --git a/doc/rst/source/supplements/seis/coupe_common.rst_ b/doc/rst/source/supplements/seis/coupe_common.rst_ index 7ab13b82962..653a8024431 100644 --- a/doc/rst/source/supplements/seis/coupe_common.rst_ +++ b/doc/rst/source/supplements/seis/coupe_common.rst_ @@ -138,6 +138,14 @@ Optional Arguments **-G**\ *fill* :ref:`(more ...) <-Gfill_attrib>` Sets color or fill pattern for compressional quadrants [Default is black]. +.. _-H: + +**-H**\ [*scale*] + Scale symbol sizes and pen widths on a per-record basis using the *scale* read from the + data set, given as the first column after the (optional) *size* columns [no scaling]. + The symbol size is either provided by **-S** or via the input *size* column. Alternatively, + append a constant *scale* that should be used instead of reading a scale column. + .. _-I: **-I**\ *intens* diff --git a/doc/rst/source/supplements/seis/meca.rst b/doc/rst/source/supplements/seis/meca.rst index 9e5ae42eb6f..648bd28c33e 100644 --- a/doc/rst/source/supplements/seis/meca.rst +++ b/doc/rst/source/supplements/seis/meca.rst @@ -23,6 +23,7 @@ Synopsis [ |-E|\ *fill*] [ |-F|\ *mode*\ [*args*] ] [ |-G|\ *fill*] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] [ |-L|\ [*pen*] ] [ |-M| ] diff --git a/doc/rst/source/supplements/seis/meca_common.rst_ b/doc/rst/source/supplements/seis/meca_common.rst_ index 2b1e221eff1..ca76e863318 100644 --- a/doc/rst/source/supplements/seis/meca_common.rst_ +++ b/doc/rst/source/supplements/seis/meca_common.rst_ @@ -96,6 +96,14 @@ Optional Arguments compressional quadrants of the focal mechanism beach balls are shaded. [Default is black]. +.. _-H: + +**-H**\ [*scale*] + Scale symbol sizes and pen widths on a per-record basis using the *scale* read from the + data set, given as the first column after the (optional) *size* column [no scaling]. + The symbol size is either provided by **-S** or via the input *size* column. Alternatively, + append a constant *scale* that should be used instead of reading a scale column. + .. _-I: **-I**\ *intens* diff --git a/doc/rst/source/supplements/seis/pscoupe.rst b/doc/rst/source/supplements/seis/pscoupe.rst index 0a6bfe9a812..812a934a7af 100644 --- a/doc/rst/source/supplements/seis/pscoupe.rst +++ b/doc/rst/source/supplements/seis/pscoupe.rst @@ -20,8 +20,9 @@ Synopsis [ |-E|\ *fill* ] [ |-F|\ *mode*\ [*args*] ] [ |-G|\ *fill* ] -[ |-K| ] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] +[ |-K| ] [ |-L|\ *[pen]* ] [ |-M| ] [ |-N| ] [ |-O| ] diff --git a/doc/rst/source/supplements/seis/psmeca.rst b/doc/rst/source/supplements/seis/psmeca.rst index 098441f91dd..f7798f6830a 100644 --- a/doc/rst/source/supplements/seis/psmeca.rst +++ b/doc/rst/source/supplements/seis/psmeca.rst @@ -23,6 +23,7 @@ Synopsis [ |-E|\ *fill*] [ |-F|\ *mode*\ [*args*] ] [ |-G|\ *fill*] +[ |-H|\ [*scale*] ] [ |-I|\ [*intens*] ] [ |-K| ] [ |-L|\ [*pen*] ] diff --git a/doc/rst/source/supplements/seis/seis_extra_cols.rst_ b/doc/rst/source/supplements/seis/seis_extra_cols.rst_ index dcf6ca0cd11..9c75b6e7456 100644 --- a/doc/rst/source/supplements/seis/seis_extra_cols.rst_ +++ b/doc/rst/source/supplements/seis/seis_extra_cols.rst_ @@ -1,16 +1,19 @@ Data Column Order ----------------- -The **-S** option determines how many data columns are required to generate -the selected symbol. In addition, your use of options **-I** and **-t** will -require extra columns, as will a **-S** option without the *scale*. The -order of the data record is fixed regardless of option order, even if not all -items may be activated. We expect data columns to come in the following order:: +The **-S** option determines how many size columns are required to generate +the selected symbol, but if *size* is not given then we expect to read *size* +from file. In addition, your use of options **-H**, **-I** and **-t** will +require extra columns. The order of the data record is fixed regardless of +option order, even if not all items may be activated. We expect data columns +to come in the following order:: - lon lat depth symbol-columns [scale] [intens] [transp [transp2]] [trailing-text] + lon lat depth symbol-columns [size] [scale] [intens] [transp [transp2]] [trailing-text] -where *symbol-columns* represent the normally required data columns, and items -given in brackets are optional and under the control of the stated options -(the trailing text is always optional). **Notes**: (1) *depth* is normally required +where items given in brackets are optional and under the control of the stated +options: **-S** without a *size* selects the optional *size-columns*, **-H** +selects the optional *scale* column, **-I** selects +the optional *intens* column, and **-t** selects the optional *transp* column(s). +Trailing text is always optional. **Notes**: (1) *depth* is normally required but will not be expected if **-Fo** is given to **meca**. (2) You can use **-i** to rearrange your data record to match the expected format. diff --git a/src/geodesy/psvelo.c b/src/geodesy/psvelo.c index 9de25ce49db..9832155a99d 100644 --- a/src/geodesy/psvelo.c +++ b/src/geodesy/psvelo.c @@ -38,7 +38,7 @@ #define THIS_MODULE_PURPOSE "Plot velocity vectors, crosses, anisotropy bars and wedges" #define THIS_MODULE_KEYS "X}" #define THIS_MODULE_NEEDS "Jd" -#define THIS_MODULE_OPTIONS "-:>BHJKOPRUVXYdehipqt" GMT_OPT("c") +#define THIS_MODULE_OPTIONS "-:>BJKOPRUVXYdehipqt" GMT_OPT("c") #define CINE 1 #define ANISO 2 @@ -80,7 +80,12 @@ struct PSVELO_CTRL { bool active; struct GMT_FILL fill; } G; - struct SVELO_I { /* -I[] */ + struct PSVELO_H { /* -H read overall scaling factor for symbol size and pen width */ + bool active; + unsigned int mode; + double value; + } H; + struct PSVELO_I { /* -I[] */ bool active; unsigned int mode; /* 0 if constant, 1 if read from file */ double value; @@ -115,6 +120,10 @@ struct PSVELO_CTRL { } Z; }; +enum Psvelo_scaletype { + PSVELO_READ_SCALE = 0, + PSVELO_CONST_SCALE = 1}; + enum psvelo_types { PSVELO_G_FILL = 0, PSVELO_E_FILL = 1, @@ -656,7 +665,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE); if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); GMT_Message (API, GMT_TIME_NONE, "usage: %s [] %s %s [-A] [%s]\n", name, GMT_J_OPT, GMT_Rgeo_OPT, GMT_B_OPT); - GMT_Message (API, GMT_TIME_NONE, "\t[-C] [-D] [-G] [-I[]] %s[-L[][+c[f|l]]] [-N] %s%s[-S[][][+f]]\n", API->K_OPT, API->O_OPT, API->P_OPT); + GMT_Message (API, GMT_TIME_NONE, "\t[-C] [-D] [-G] [-H[]] [-I[]] %s[-L[][+c[f|l]]] [-N] %s%s[-S[][][+f]]\n", API->K_OPT, API->O_OPT, API->P_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-V] [-W[][+c[f|l]]] [%s] [%s]\n", GMT_U_OPT, GMT_X_OPT, GMT_Y_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[-Z[m|e|n|u][+e] %s[%s] [%s] [%s]\n\t[%s] [%s]\n\t[%s] [%s] [%s] [%s]\n\n", API->c_OPT, GMT_di_OPT, GMT_e_OPT, GMT_h_OPT, GMT_i_OPT, GMT_p_OPT, GMT_qi_OPT, GMT_tv_OPT, GMT_colon_OPT, GMT_PAR_OPT); @@ -674,6 +683,8 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Message (API, GMT_TIME_NONE, "\t-E Set color used for uncertainty ellipses and wedges [no fill].\n"); GMT_Message (API, GMT_TIME_NONE, "\t For other coloring options, see -L and -Z.\n"); gmt_fill_syntax (API->GMT, 'G', NULL, "Specify color or pattern for symbol fill [no fill]."); + GMT_Message (API, GMT_TIME_NONE, "\t-H Scale symbol sizes (set via -S or input column) and pen attributes by factors read from scale column.\n"); + GMT_Message (API, GMT_TIME_NONE, "\t The scale column follows the symbol size column. Alternatively, append a fixed .\n"); GMT_Message (API, GMT_TIME_NONE, "\t-I Use the intensity to modulate the symbol fill color (requires -C or -G).\n"); GMT_Message (API, GMT_TIME_NONE, "\t If no intensity is given we expect it to follow the required columns in the data record.\n"); GMT_Option (API, "K"); @@ -778,6 +789,13 @@ static int parse (struct GMT_CTRL *GMT, struct PSVELO_CTRL *Ctrl, struct GMT_OPT n_errors++; } break; + case 'H': /* Overall symbol/pen scale column provided */ + Ctrl->H.active = true; + if (opt->arg[0]) { /* Gave a fixed scale - no reading from file */ + Ctrl->H.value = atof (opt->arg); + Ctrl->H.mode = PSVELO_CONST_SCALE; + } + break; case 'I': /* Adjust symbol color via intensity */ Ctrl->I.active = true; if (opt->arg[0]) @@ -935,19 +953,20 @@ GMT_LOCAL void psvelo_set_colorfill (struct GMT_CTRL *GMT, struct PSVELO_CTRL *C EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { int ix = 0, iy = 1, n_rec = 0, justify; int plot_ellipse = true, plot_vector = true, error = false; - unsigned int tcol_f = 0, tcol_s = 0, scol = 0, icol = 0; + unsigned int xcol = 0, tcol_f = 0, tcol_s = 0, scol = 0, icol = 0; bool set_g_fill, set_e_fill; double plot_x, plot_y, vxy[2], plot_vx, plot_vy, length, s, dim[PSL_MAX_DIMS]; double eps1 = 0.0, eps2 = 0.0, spin = 0.0, spinsig = 0.0, theta = 0.0, *in = NULL; double direction = 0, small_axis = 0, great_axis = 0, sigma_x, sigma_y, corr_xy; double t11 = 1.0, t12 = 0.0, t21 = 0.0, t22 = 1.0, hl, hw, vw, ssize, headpen_width = 0.0; - double z_val, e_val, value, scale, i_value; + double z_val, e_val, value, scale, size, i_value, nominal_size; char *station_name = NULL; struct GMT_RECORD *In = NULL; struct GMT_PALETTE *CPT = NULL; + struct GMT_PEN current_pen; struct PSVELO_CTRL *Ctrl = NULL; struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL; /* General GMT internal parameters */ struct GMT_OPTION *options = NULL; @@ -1007,23 +1026,29 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { ix = (GMT->current.setting.io_lonlat_toggle[0]); iy = 1 - ix; /* Deal with -: */ - /* 1. Add user column for coloring, if requested */ + /* 1. Add user column for coloring, if requested */ if (Ctrl->Z.mode == PSVELO_V_USER) Ctrl->S.n_cols++; /* Need to read one extra column */ - /* 2. Add scale from file, if missing */ + /* 2. Add scale from file, if missing */ if (Ctrl->S.read) { /* Read symbol size from file */ scol = Ctrl->S.n_cols; /* Column ID with scales */ Ctrl->S.n_cols++; /* Must read an extra column */ gmt_set_column_type (GMT, GMT_IN, scol, GMT_IS_DIMENSION); } else /* Fixed symbol scale */ - scale = Ctrl->S.scale; - /* 3. Add intensity from file, if requested */ + nominal_size = scale = Ctrl->S.scale; + /* 3. Add scaling from file, if requested */ + if (Ctrl->H.active && Ctrl->H.mode == PSVELO_READ_SCALE) { + xcol = Ctrl->S.n_cols; + Ctrl->S.n_cols++; /* Read scaling from data file */ + gmt_set_column_type (GMT, GMT_IN, xcol, GMT_IS_FLOAT); + } + /* 4. Add intensity from file, if requested */ if (Ctrl->I.mode) { /* Read intensity from data file */ icol = Ctrl->S.n_cols; /* Column id for intensity */ Ctrl->S.n_cols++; /* One more data column required */ gmt_set_column_type (GMT, GMT_IN, icol, GMT_IS_FLOAT); } - /* Add transparencies from file, if requested */ + /* 5. Add transparencies from file, if requested */ if (GMT->common.t.variable) { /* Need one or two transparencies from file */ if (GMT->common.t.mode & GMT_SET_FILL_TRANSP) { tcol_f = Ctrl->S.n_cols; @@ -1149,7 +1174,7 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { } if (Ctrl->D.active) spinsig = spinsig * Ctrl->D.scale; } - if (Ctrl->S.read) scale = in[scol]; + if (Ctrl->S.read) nominal_size = scale = in[scol]; if (!Ctrl->N.active) { gmt_map_outside (GMT, in[GMT_X], in[GMT_Y]); @@ -1180,19 +1205,31 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { } PSL_settransparencies (PSL, transp); } + size = scale; + if (Ctrl->H.active) { /* Variable scaling of symbol size and pen width */ + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + size *= scl; + } switch (Ctrl->S.symbol) { case CINE: plot_vector = (hypot (vxy[0], vxy[1]) < 1.e-8) ? false : true; - psvelo_trace_arrow (GMT, in[GMT_X], in[GMT_Y], vxy[0], vxy[1], scale, &plot_x, &plot_y, &plot_vx, &plot_vy); + psvelo_trace_arrow (GMT, in[GMT_X], in[GMT_Y], vxy[0], vxy[1], size, &plot_x, &plot_y, &plot_vx, &plot_vy); psvelo_get_trans (GMT, in[GMT_X], in[GMT_Y], &t11, &t12, &t21, &t22); if (plot_ellipse) { - if (Ctrl->L.active) gmt_setpen (GMT, &Ctrl->L.pen); + if (Ctrl->L.active) { + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); + } if (Ctrl->E.active) - psvelo_paint_ellipse (GMT, plot_vx, plot_vy, direction, great_axis, small_axis, scale, + psvelo_paint_ellipse (GMT, plot_vx, plot_vy, direction, great_axis, small_axis, size, t11,t12,t21,t22, Ctrl->E.active, &Ctrl->E.fill, Ctrl->L.active); else - psvelo_paint_ellipse (GMT, plot_vx, plot_vy, direction, great_axis, small_axis, scale, + psvelo_paint_ellipse (GMT, plot_vx, plot_vy, direction, great_axis, small_axis, size, t11,t12,t21,t22, Ctrl->E.active, &Ctrl->G.fill, Ctrl->L.active); } if (plot_vector) { /* verify that vector length is not ridiculously small */ @@ -1204,11 +1241,25 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { hl = s * Ctrl->A.S.v.h_length; vw = s * Ctrl->A.S.v.v_width; if (vw < 2.0/PSL_DOTS_PER_INCH) vw = 2.0/PSL_DOTS_PER_INCH; /* Minimum width set */ - if (Ctrl->A.S.v.status & PSL_VEC_OUTLINE2) gmt_setpen (GMT, &Ctrl->A.S.v.pen); + if (Ctrl->A.S.v.status & PSL_VEC_OUTLINE2) { + current_pen = Ctrl->A.S.v.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); + } dim[0] = plot_vx, dim[1] = plot_vy; dim[2] = vw, dim[3] = hl, dim[4] = hw; dim[5] = Ctrl->A.S.v.v_shape; - if (Ctrl->L.active) gmt_setpen (GMT, &Ctrl->W.pen); + if (Ctrl->L.active) { + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); + } if (Ctrl->A.S.symbol == GMT_SYMBOL_VECTOR_V4) { /* Old GMT4 vector selected */ double *this_rgb = (set_g_fill) ? Ctrl->G.fill.rgb : GMT->session.no_rgb; psl_vector_v4 (PSL, plot_x, plot_y, dim, this_rgb, Ctrl->L.active); @@ -1223,7 +1274,14 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { gmt_setfill (GMT, &Ctrl->G.fill, Ctrl->L.active); PSL_plotsymbol (PSL, plot_x, plot_y, dim, PSL_VECTOR); } - if (Ctrl->A.S.v.status & PSL_VEC_OUTLINE2) gmt_setpen (GMT, &Ctrl->W.pen); + if (Ctrl->A.S.v.status & PSL_VEC_OUTLINE2) { + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); + } justify = ((plot_vx - plot_x) > 0.0) ? PSL_MR : PSL_ML; if (Ctrl->S.font.size > 0.0 && station_name && station_name[0]) /* 1 inch = 2.54 cm */ @@ -1240,20 +1298,30 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) { } break; case ANISO: - psvelo_trace_arrow (GMT, in[GMT_X], in[GMT_Y], vxy[0], vxy[1], scale, &plot_x, &plot_y, &plot_vx, &plot_vy); - gmt_setpen (GMT, &Ctrl->W.pen); + psvelo_trace_arrow (GMT, in[GMT_X], in[GMT_Y], vxy[0], vxy[1], size, &plot_x, &plot_y, &plot_vx, &plot_vy); + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); PSL_plotsegment (PSL, plot_x, plot_y, plot_vx, plot_vy); break; case CROSS: /* triangular arrowheads */ - psvelo_trace_cross (GMT, in[GMT_X],in[GMT_Y],eps1,eps2,theta,scale,Ctrl->A.S.v.v_width,Ctrl->A.S.v.h_length, - Ctrl->A.S.v.h_width,0.1,Ctrl->L.active,&(Ctrl->W.pen)); + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSVELO_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + psvelo_trace_cross (GMT, in[GMT_X],in[GMT_Y],eps1,eps2,theta,size,Ctrl->A.S.v.v_width,Ctrl->A.S.v.h_length, + Ctrl->A.S.v.h_width,0.1,Ctrl->L.active,&(current_pen)); break; case WEDGE: PSL_comment (PSL, "begin wedge number %li", n_rec); gmt_geo_to_xy (GMT, in[GMT_X], in[GMT_Y], &plot_x, &plot_y); psvelo_get_trans (GMT, in[GMT_X], in[GMT_Y], &t11, &t12, &t21, &t22); - psvelo_paint_wedge (PSL, plot_x, plot_y, spin, spinsig, scale, Ctrl->S.wedge_amp, t11, t12, t21, t22, + psvelo_paint_wedge (PSL, plot_x, plot_y, spin, spinsig, size, Ctrl->S.wedge_amp, t11, t12, t21, t22, set_g_fill, Ctrl->G.fill.rgb, set_e_fill, Ctrl->E.fill.rgb, Ctrl->L.active); break; } diff --git a/src/psevents.c b/src/psevents.c index 3de0fe9a619..e0ef6364d58 100644 --- a/src/psevents.c +++ b/src/psevents.c @@ -118,7 +118,6 @@ struct PSEVENTS_CTRL { bool active; unsigned int mode; char *symbol; - double size; } S; struct PSEVENTS_T { /* -T */ bool active; @@ -451,32 +450,18 @@ static int parse (struct GMT_CTRL *GMT, struct PSEVENTS_CTRL *Ctrl, struct GMT_O case 'S': /* Set symbol type and size (append units) */ Ctrl->S.active = true; if (strchr ("kK", opt->arg[0])) { /* Custom symbol may have a slash before size */ - if ((c = strrchr (opt->arg, '/'))) { /* Gave size */ - Ctrl->S.size = gmt_M_to_inch (GMT, &c[1]); - c[0] = '0'; - Ctrl->S.symbol = strdup (opt->arg); - c[0] = '/'; - GMT->current.setting.proj_length_unit = GMT_INCH; /* Since S.size is now in inches */ - } - else { /* Gave no size so get the whole thing and read size from file */ - Ctrl->S.symbol = strdup (opt->arg); + Ctrl->S.symbol = strdup (opt->arg); + if ((c = strrchr (opt->arg, '/')) == NULL) /* Gave no size so get the whole thing and read size from file */ Ctrl->S.mode = 1; - } } else if (opt->arg[0] == 'E' && opt->arg[1] == '-') { - if (opt->arg[2]) /* Gave a fixed size */ - Ctrl->S.size = atof (&opt->arg[2]); - else /* Must read individual event symbol sizes for file using prevailing length-unit setting */ - Ctrl->S.mode = 1; Ctrl->S.symbol = strdup ("E-"); + if (!opt->arg[2]) /* Must read individual event symbol sizes for file using prevailing length-unit setting */ + Ctrl->S.mode = 1; } else if (strchr ("-+aAcCdDgGhHiInNsStTxy", opt->arg[0])) { /* Regular symbols of form [], where is 1-char */ - if (opt->arg[1] && !strchr (GMT_DIM_UNITS, opt->arg[1])) { /* Gave a fixed size */ - Ctrl->S.size = gmt_M_to_inch (GMT, &opt->arg[1]); /* Now in inches */ - GMT->current.setting.proj_length_unit = GMT_INCH; /* Since S.size is now in inches */ - sprintf (txt_a, "%c", opt->arg[0]); /* Just the symbol code */ - Ctrl->S.symbol = strdup (txt_a); - } + if (opt->arg[1] && !strchr (GMT_DIM_UNITS, opt->arg[1])) /* Gave a fixed size */ + Ctrl->S.symbol = strdup (opt->arg); else if (opt->arg[1] && strchr (GMT_DIM_UNITS, opt->arg[1])) { /* Must read symbol sizes in this unit from file */ Ctrl->S.mode = 1; gmt_set_measure_unit (GMT, opt->arg[1]); @@ -514,19 +499,13 @@ static int parse (struct GMT_CTRL *GMT, struct PSEVENTS_CTRL *Ctrl, struct GMT_O c[0] = ' '; /* Restore space */ while (c[0] == ' ' || c[0] == '\t') c++; /* Move to first word after the module (user may have more than one space...) */ strncpy (txt_a, c, GMT_LEN256); /* Copy the remaining text into a temporary buffer */ - c = q = strstr (txt_a, "-S") + 3; /* Determine the start position of the required symbol size in the command */ - while (c[0] && !strchr ("/+ ", c[0])) c++; /* Skip the size until we hit a slash or a modifier or the end of the option or the entire string */ - was = c[0]; /* Remember first char after size */ - c[0] = '\0'; /* Hide it */ - Ctrl->S.size = gmt_M_to_inch (GMT, q); /* Get the fixed symbol size specified */ - c[0] = was; /* Restore char */ - if (c[0] == '/') c++; /* Skip the slash since it will not be needed when size is not given via the new -S */ - while (c[0]) *q++ = *c++; /* Shuffle down the remaining text from the command to fill the void left by size */ - *q = '\0'; /* And truncate since we shuffled characters forward */ - if (strstr (txt_a, "-C") || strstr (txt_a, "-G") || strstr (txt_a, "-I") || strstr (txt_a, "-J") || strstr (txt_a, "-N") || strstr (txt_a, "-R") \ + q = strstr (txt_a, "-S") + 3; /* Determine the start position of the required symbol size in the command */ + if (!(isdigit (q[0]) || (q[0] == '.' && isdigit (q[1])))) /* Got no size, must read from data file */ + Ctrl->S.mode = 1; + if (strstr (txt_a, "-C") || strstr (txt_a, "-G") || strstr (txt_a, "-H") || strstr (txt_a, "-I") || strstr (txt_a, "-J") || strstr (txt_a, "-N") || strstr (txt_a, "-R") \ || strstr (txt_a, "-W") || strstr (txt_a, "-t")) { /* Sanity check */ - GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: Cannot include options -C, -G, -I, -J, -N, -R, -W, or -t in the %s command\n", Ctrl->Z.module); - GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: The -C, -G, -J, -N, -R, -W options may be given to %s instead, while I, -t are not allowed\n", &events[s]); + GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: Cannot include options -C, -G, -H, -I, -J, -N, -R, -W, or -t in the %s command\n", Ctrl->Z.module); + GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: The -C, -G, -J, -N, -R, -W options may be given to %s instead, while -H, -I, -t are not allowed\n", &events[s]); n_errors++; } else /* Keep a copy of the final command that has -S with no symbol-size specified */ @@ -537,11 +516,6 @@ static int parse (struct GMT_CTRL *GMT, struct PSEVENTS_CTRL *Ctrl, struct GMT_O GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: Requires a core [ps]coupe, [ps]meca, or [ps]velo command with valid -S option and fixed size\n"); n_errors++; } - GMT->current.setting.proj_length_unit = GMT_INCH; /* Since S.size is now in inches */ - if (gmt_M_is_zero (Ctrl->S.size)) { /* Sanity check */ - GMT_Report (GMT->parent, GMT_MSG_ERROR, "Option -Z: Requires a valid -S option with specified nonzero symbol size\n"); - n_errors++; - } break; default: /* Report bad options */ @@ -612,7 +586,7 @@ GMT_LOCAL void psevents_set_XY (struct GMT_CTRL *GMT, unsigned int x_type, unsig sprintf (Y, "%.16g", out[GMT_Y]); } -GMT_LOCAL unsigned int psevents_determine_columns (struct GMT_CTRL *GMT, char *module, char *cmd) { +GMT_LOCAL unsigned int psevents_determine_columns (struct GMT_CTRL *GMT, char *module, char *cmd, unsigned int mode) { /* Return how many data columns are needed for the selected seismo/geodetic symbol */ unsigned int n = 0; char *S = strstr (cmd, "-S"); /* Pointer to start of symbol option */ @@ -648,6 +622,7 @@ GMT_LOCAL unsigned int psevents_determine_columns (struct GMT_CTRL *GMT, char *m } if (strstr (cmd, "+Zu")) n++; /* Add in user column for coloring symbols via CPT lookup */ } + if (mode) n++; /* Must also read symbol size from input file (separate from scaling) */ return n; } @@ -667,12 +642,12 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { enum gmt_col_enum time_type, end_type; - unsigned int n_cols_needed, n_copy_to_out, col, s_in = 2, t_in = 2, d_in = 3, s_col = 2, i_col = 3, t_col = 4, x_type, y_type; + unsigned int n_cols_needed, n_copy_to_out, col, s_in = 2, t_in = 2, d_in = 3, x_col = 2, i_col = 3, t_col = 4, x_type, y_type; uint64_t n_total_read = 0, n_symbols_plotted = 0, n_labels_plotted = 0; double out[20], t_end = DBL_MAX, *in = NULL; - double t_event, t_rise, t_plateau, t_decay, t_fade, x, size, t_event_seg, t_end_seg; + double t_event, t_rise, t_plateau, t_decay, t_fade, x, t_event_seg, t_end_seg; FILE *fp_symbols = NULL, *fp_labels = NULL; @@ -826,7 +801,7 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { } } if (bad) { - GMT_Report (API, GMT_MSG_WARNING, "Interpolation of time columne with -F%c failed to give monotonically increasing values in %d places. Please use --GMT_INTERPOLANT=linear instead\n", Fmode, bad); + GMT_Report (API, GMT_MSG_WARNING, "Interpolation of time column with -F%c failed to give monotonically increasing values in %d places. Please use --GMT_INTERPOLANT=linear instead\n", Fmode, bad); } sprintf (TCLOCK, " --FORMAT_CLOCK_OUT=hh:mm:ss"); if (dt < 1.0) { /* Need to make sure we pass a proper FORMAT_CLOCK_IN|OUT with enough precision for Step 3 to adequately reflect precision in input data */ @@ -864,7 +839,7 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { n_cols_needed = 3; /* We always will need lon, lat and time */ if (Ctrl->Z.active) { /* We read points for symbols */ - unsigned int n_cols = psevents_determine_columns (GMT, Ctrl->Z.module, Ctrl->Z.cmd); /* Must allow for number of columns needed by the selected module */ + unsigned int n_cols = psevents_determine_columns (GMT, Ctrl->Z.module, Ctrl->Z.cmd, Ctrl->S.mode); /* Must allow for number of columns needed by the selected module */ if (n_cols == 0) { GMT_Report (API, GMT_MSG_ERROR, "Unable to determine columns. Bad module %s?\n", Ctrl->Z.module); Return (GMT_RUNTIME_ERROR); @@ -873,14 +848,14 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { n_cols_needed += n_cols; /* One more for time so far */ n_copy_to_out = n_cols; /* lon, lat, and all required cols, no time */ t_in = n_cols, d_in = t_in + 1; /* These are the 1-2 extra columns needed by event */ - s_col = n_cols, i_col = n_cols + 1, t_col = n_cols + 2; /* Update output cols for the 3 extras */ + x_col = n_cols, i_col = n_cols + 1, t_col = n_cols + 2; /* Update output cols for the 3 extras */ if (Ctrl->L.mode == PSEVENTS_VAR_DURATION || Ctrl->L.mode == PSEVENTS_VAR_ENDTIME) n_cols_needed++; /* Must allow for length/time column in input */ } else if (Ctrl->S.active || !Ctrl->A.active) { /* We read points for symbols OR we are in fact just doing labels */ if (Ctrl->C.active) n_cols_needed++; /* Must allow for z in input */ if (Ctrl->S.mode) n_cols_needed++; /* Must allow for size in input */ if (Ctrl->L.mode == PSEVENTS_VAR_DURATION || Ctrl->L.mode == PSEVENTS_VAR_ENDTIME) n_cols_needed++; /* Must allow for length/time in input */ - n_copy_to_out = 2 + Ctrl->C.active; + n_copy_to_out = 2 + Ctrl->C.active + Ctrl->S.mode; } else { /* We read lines or polygons */ n_cols_needed = n_copy_to_out = 2; @@ -899,8 +874,8 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { } if (!Ctrl->Z.active) { - if (Ctrl->C.active) s_in++, t_in++, d_in++, s_col++, i_col++, t_col++; /* Must allow for z-value in input before size, time, length */ - if (Ctrl->S.mode) t_in++, d_in++; /* Must allow for size in input before time and length */ + if (Ctrl->C.active) s_in++, t_in++, d_in++, x_col++, i_col++, t_col++; /* Must allow for z-value in input/output before size, time, length */ + if (Ctrl->S.mode) t_in++, d_in++, x_col++, i_col++, t_col++; /* Must allow for size in input/output before time and length */ } /* Determine if there is a coda phase where symbols remain visible after the event ends: */ do_coda = (Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL2] > 0.0 || !gmt_M_is_zero (Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL2]) || Ctrl->M.value[PSEVENTS_TRANSP][PSEVENTS_VAL2] < 100.0); @@ -1028,39 +1003,38 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { t_plateau = t_event + Ctrl->E.dt[PSEVENTS_SYMBOL][PSEVENTS_PLATEAU]; /* End of the plateau phase */ t_decay = t_plateau + Ctrl->E.dt[PSEVENTS_SYMBOL][PSEVENTS_DECAY]; /* End of the decay phase */ - size = (Ctrl->S.mode) ? in[s_in] : Ctrl->S.size; /* Fixed or variable nominal symbol size in inches */ if (Ctrl->T.now < t_event) { /* We are within the rise phase */ x = pow ((Ctrl->T.now - t_rise)/Ctrl->E.dt[PSEVENTS_SYMBOL][PSEVENTS_RISE], 2.0); /* Quadratic function that goes from 0 to 1 */ if (gmt_M_is_dnan (x)) x = 0.0; /* Probably division by zero */ - out[s_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1] * x * size; /* Magnification of amplitude */ + out[x_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1] * x; /* Magnification of amplitude */ out[i_col] = Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL1] * x; /* Magnification of intensity */ out[t_col] = Ctrl->M.value[PSEVENTS_TRANSP][PSEVENTS_VAL1] * (1.0-x); /* Magnification of opacity */ } else if (Ctrl->T.now < t_plateau) { /* We are within the plateau phase, keep everything constant */ - out[s_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1] * size; + out[x_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1]; out[i_col] = Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL1]; out[t_col] = 0.0; /* No transparency during plateau phase */ } else if (Ctrl->T.now < t_decay) { /* We are within the decay phase */ x = pow ((t_decay - Ctrl->T.now)/Ctrl->E.dt[PSEVENTS_SYMBOL][PSEVENTS_DECAY], 2.0); /* Quadratic function that goes from 1 to 0 */ if (gmt_M_is_dnan (x)) x = 0.0; /* Probably division by zero */ - out[s_col] = size * (Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1] * x + (1.0 - x)); /* Reduction of size down to the nominal size */ + out[x_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL1] * x + (1.0 - x); /* Reduction of size down to the nominal size */ out[i_col] = Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL1] * x; /* Reduction of intensity down to 0 */ out[t_col] = 0.0; } else if (finite_duration && Ctrl->T.now < t_end) { /* We are within the normal display phase with nominal symbol size */ - out[s_col] = size; + out[x_col] = 1.0; out[i_col] = out[t_col] = 0.0; /* No intensity or transparency during normal phase */ } else if (finite_duration && Ctrl->T.now <= t_fade) { /* We are within the fade phase */ x = pow ((t_fade - Ctrl->T.now)/Ctrl->E.dt[PSEVENTS_SYMBOL][PSEVENTS_FADE], 2.0); /* Quadratic function that goes from 1 to 0 */ if (gmt_M_is_dnan (x)) x = 0.0; /* Probably division by zero */ - out[s_col] = size * (x + (1.0 - x) * Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL2]); /* Reduction of size down to coda size */ + out[x_col] = x + (1.0 - x) * Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL2]; /* Reduction of size down to coda size */ out[i_col] = Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL2] * (1.0 - x); /* Reduction of intensity down to coda intensity */ out[t_col] = Ctrl->M.value[PSEVENTS_TRANSP][PSEVENTS_VAL2] * (1.0 - x); /* Increase of transparency up to code transparency */ } else if (do_coda) { /* If there is a coda then the symbol remains visible given those terminal attributes */ - out[s_col] = size * Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL2]; + out[x_col] = Ctrl->M.value[PSEVENTS_SIZE][PSEVENTS_VAL2]; out[i_col] = Ctrl->M.value[PSEVENTS_INT][PSEVENTS_VAL2]; out[t_col] = Ctrl->M.value[PSEVENTS_TRANSP][PSEVENTS_VAL2]; } @@ -1080,10 +1054,11 @@ EXTERN_MSC int GMT_psevents (void *V_API, int mode, void *args) { } else if (Ctrl->A.active) /* Just needed the line coordinates */ fprintf (fp_symbols, "\n"); - else if (Ctrl->C.active) /* For -S symbols, need to pass on the z-value for cpt lookup in plot */ - fprintf (fp_symbols, "\t%.16g\t%g\t%g\t%g\n", out[GMT_Z], out[s_col], out[i_col], out[t_col]); - else - fprintf (fp_symbols, "\t%g\t%g\t%g\n", out[s_col], out[i_col], out[t_col]); + else { /* Symbols -S, which may need -C and -S columns before the scale, intens, transp */ + for (col = GMT_Z; col < n_copy_to_out; col++) + fprintf (fp_symbols, "\t%.16g", out[col]); + fprintf (fp_symbols, "\t%g\t%g\t%g\n", out[x_col], out[i_col], out[t_col]); + } n_symbols_plotted++; /* Count output symbols */ } @@ -1167,7 +1142,7 @@ Do_txt: if (Ctrl->E.active[PSEVENTS_TEXT] && In->text) { /* Also plot trailing t if (Ctrl->A.mode == PSEVENTS_LINE_SEG && Ctrl->C.active) {strcat (cmd, " -C"); strcat (cmd, Ctrl->C.file);} } else if (Ctrl->Z.active) { - sprintf (cmd, "%s %s -R -J -O -K -I -t --GMT_HISTORY=readonly --PROJ_LENGTH_UNIT=%s", tmp_file_symbols, Ctrl->Z.cmd, GMT->session.unit_name[GMT->current.setting.proj_length_unit]); + sprintf (cmd, "%s %s -R -J -O -K -H -I -t --GMT_HISTORY=readonly --PROJ_LENGTH_UNIT=%s", tmp_file_symbols, Ctrl->Z.cmd, GMT->session.unit_name[GMT->current.setting.proj_length_unit]); if (Ctrl->C.active) {strcat (cmd, " -C"); strcat (cmd, Ctrl->C.file);} if (Ctrl->G.active) {strcat (cmd, " -G"); strcat (cmd, Ctrl->G.fill);} if (Ctrl->W.pen) {strcat (cmd, " -W"); strcat (cmd, Ctrl->W.pen);} @@ -1175,7 +1150,7 @@ Do_txt: if (Ctrl->E.active[PSEVENTS_TEXT] && In->text) { /* Also plot trailing t module = (GMT->current.setting.run_mode == GMT_MODERN && !strncmp (Ctrl->Z.module, "ps", 2U)) ? &Ctrl->Z.module[2] : Ctrl->Z.module; } else { /* Command to plot symbols */ - sprintf (cmd, "%s -R -J -O -K -I -t -S%s --GMT_HISTORY=readonly --PROJ_LENGTH_UNIT=%s", tmp_file_symbols, Ctrl->S.symbol, GMT->session.unit_name[GMT->current.setting.proj_length_unit]); + sprintf (cmd, "%s -R -J -O -K -H -I -t -S%s --GMT_HISTORY=readonly --PROJ_LENGTH_UNIT=%s", tmp_file_symbols, Ctrl->S.symbol, GMT->session.unit_name[GMT->current.setting.proj_length_unit]); if (Ctrl->C.active) {strcat (cmd, " -C"); strcat (cmd, Ctrl->C.file);} if (Ctrl->G.active) {strcat (cmd, " -G"); strcat (cmd, Ctrl->G.fill);} if (Ctrl->W.pen) {strcat (cmd, " -W"); strcat (cmd, Ctrl->W.pen);} diff --git a/src/psxy.c b/src/psxy.c index 9d5e08850d5..29820362a13 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -983,7 +983,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { double direction, length, dx, dy, d, yy, yt, yb, *in = NULL, *z_for_cpt = NULL; double s, c, plot_x, plot_y, x_1, x_2, y_1, y_2, xx, xb, xt, dummy, headpen_width = 0.25; - double bar_gap, bar_width, bar_step, nominal_size; + double bar_gap, bar_width, bar_step, nominal_size_x, nominal_size_y, factor = 1.0; + double axes[2] = {0.0, 0.0}, Az = 0.0; struct GMT_PEN current_pen, default_pen, save_pen, last_headpen, last_spiderpen, nominal_pen; struct GMT_FILL current_fill, default_fill, black, no_fill, save_fill; @@ -1034,7 +1035,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (!Ctrl->T.active) GMT_Report (API, GMT_MSG_INFORMATION, "Processing input table data\n"); if (Ctrl->E.active && S.symbol == GMT_SYMBOL_LINE) /* Assume user only wants error bars */ S.symbol = GMT_SYMBOL_NONE; - nominal_size = S.size_x; + nominal_size_x = S.size_x; + nominal_size_y = S.size_y; nominal_pen = Ctrl->W.pen; /* Do we plot actual symbols, or lines */ not_line = !(S.symbol == GMT_SYMBOL_FRONT || S.symbol == GMT_SYMBOL_QUOTED_LINE || S.symbol == GMT_SYMBOL_DECORATED_LINE || S.symbol == GMT_SYMBOL_LINE); @@ -1393,7 +1395,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if ((error = gmt_parse_symbol_option (GMT, s_args, &S, 0, false))) { Return (error); } - nominal_size = S.size_x; + nominal_size_x = S.size_x; + nominal_size_y = S.size_y; } else GMT_Report (API, GMT_MSG_ERROR, "Segment header tries to switch to a line symbol like quoted line or fault - ignored\n"); @@ -1423,7 +1426,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if ((error = gmt_parse_symbol_option (GMT, In->text, &S, 0, false))) { Return (error); } - nominal_size = S.size_x; + nominal_size_x = S.size_x; + nominal_size_y = S.size_y; } if (gmt_is_barcolumn (GMT, &S)) { n_z = gmt_get_columbar_bands (GMT, &S); @@ -1608,13 +1612,6 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { gmt_setpen (GMT, ¤t_pen); } - if ((S.symbol == PSL_ELLIPSE || S.symbol == PSL_ROTRECT) && !S.par_set) { /* Ellipses and rectangles */ - if (S.n_required == 0) /* Degenerate ellipse or rectangle, got diameter via S.size_x */ - in[ex2] = in[ex3] = S.size_x, in[ex1] = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ - else if (S.n_required == 1) /* Degenerate ellipse or rectangle, expect single diameter via input */ - in[ex2] = in[ex3] = in[ex1], in[ex1] = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ - } - if (S.base_set & GMT_BASE_READ) { bcol = (S.read_size) ? ex2 : ex1; S.base = in[bcol]; /* Got base from input column */ @@ -1622,10 +1619,21 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (S.read_size) { S.size_x = in[ex1] * S.factor; /* Got size from input column; scale by factor if area unifier is on */ if (delayed_unit_scaling) S.size_x *= GMT->session.u2u[S.u][GMT_INCH]; - nominal_size = S.size_x; + nominal_size_x = S.size_x; + } + if (Ctrl->H.active) { /* Variable (or constant) scaling of symbol size and pen width */ + factor = (Ctrl->H.mode == PSXY_READ_SCALE) ? in[xcol] : Ctrl->H.value; + S.size_x = nominal_size_x * factor; + S.size_y = nominal_size_y * factor; + } + if ((S.symbol == PSL_ELLIPSE || S.symbol == PSL_ROTRECT) && !S.par_set) { /* Ellipses and rectangles */ + if (S.n_required == 0) /* Degenerate ellipse or rectangle, got diameter via S.size_x */ + axes[GMT_X] = axes[GMT_Y] = S.size_x, Az = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ + else if (S.n_required == 1) /* Degenerate ellipse or rectangle, expect single diameter via input */ + axes[GMT_X] = axes[GMT_Y] = in[ex1], Az = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ + else /* Full ellipse */ + Az = in[ex1], axes[GMT_X] = in[ex2], axes[GMT_Y] = in[ex3]; } - if (Ctrl->H.active) /* Variable (or constant) scaling of symbol size and pen width */ - S.size_x = nominal_size * ((Ctrl->H.mode == PSXY_READ_SCALE) ? in[xcol] : Ctrl->H.value); gmt_M_memset (dim, PSL_MAX_DIMS, double); dim[0] = S.size_x; @@ -1760,7 +1768,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { dim[2] = S.factor; /* Intentionally fall through - to pick up the other two parameters */ case PSL_RECT: - if (S.diagonal) { /* Special rectangle give by opposing corners on a diagonal */ + if (S.diagonal) { /* Special rectangle give by opposing corners on a diagonal, not subject to -H scaling */ if (gmt_M_is_dnan (in[pos2x])) { GMT_Report (API, GMT_MSG_WARNING, "Diagonal longitude = NaN near line %d. Skipped\n", n_total_read); continue; @@ -1782,12 +1790,12 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { break; } if (S.n_required >= 2) { /* Got dimensions from input file */ - dim[0] = in[ex1]; + dim[0] = factor * in[ex1]; if (gmt_M_is_dnan (dim[0])) { GMT_Report (API, GMT_MSG_WARNING, "Rounded rectangle width = NaN near line %d. Skipped\n", n_total_read); continue; } - dim[1] = in[ex2]; + dim[1] = factor * in[ex2]; if (gmt_M_is_dnan (dim[1])) { GMT_Report (API, GMT_MSG_WARNING, "Rounded rectangle height = NaN near line %d. Skipped\n", n_total_read); continue; @@ -1806,22 +1814,22 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { dim[2] = S.size_y; } else { /* Get parameters from file */ - if (gmt_M_is_dnan (in[ex1])) { + if (gmt_M_is_dnan (Az)) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle angle = NaN near line %d. Skipped\n", n_total_read); continue; } - if (gmt_M_is_dnan (in[ex2])) { + if (gmt_M_is_dnan (axes[GMT_X])) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle width or major axis = NaN near line %d. Skipped\n", n_total_read); continue; } - if (gmt_M_is_dnan (in[ex3])) { + if (gmt_M_is_dnan (axes[GMT_Y])) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle height or minor axis = NaN near line %d. Skipped\n", n_total_read); continue; } - dim[0] = in[ex1]; + dim[0] = Az; gmt_flip_angle_d (GMT, &dim[0]); - dim[1] = in[ex2]; - dim[2] = in[ex3]; + dim[1] = factor * axes[GMT_X]; + dim[2] = factor * axes[GMT_Y]; } if (!S.convert_angles) /* -Se or -Sr */ PSL_plotsymbol (PSL, xpos[item], plot_y, dim, S.symbol); @@ -1879,9 +1887,9 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { case PSL_VECTOR: gmt_init_vector_param (GMT, &S, false, false, NULL, false, NULL); /* Update vector head parameters */ if (S.v.status & PSL_VEC_COMPONENTS) /* Read dx, dy in user units */ - length = hypot (in[ex1+S.read_size], in[ex2+S.read_size]) * S.v.comp_scale; + length = factor * hypot (in[ex1+S.read_size], in[ex2+S.read_size]) * S.v.comp_scale; else - length = in[ex2+S.read_size]; + length = factor * in[ex2+S.read_size]; if (gmt_M_is_dnan (length)) { GMT_Report (API, GMT_MSG_WARNING, "Vector length = NaN near line %d. Skipped\n", n_total_read); continue; @@ -1985,8 +1993,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { break; case PSL_MARC: gmt_init_vector_param (GMT, &S, false, false, NULL, false, NULL); /* Update vector head parameters */ - S.v.v_width = (float)(current_pen.width * GMT->session.u2u[GMT_PT][GMT_INCH]); - dim[0] = in[ex1+S.read_size]; + S.v.v_width = (float)(factor * current_pen.width * GMT->session.u2u[GMT_PT][GMT_INCH]); + dim[0] = factor * in[ex1+S.read_size]; dim[1] = in[ex2+S.read_size]; dim[2] = in[ex3+S.read_size]; length = fabs (dim[2]-dim[1]); /* Arc length in degrees */ @@ -2010,10 +2018,10 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { GMT_Report (API, GMT_MSG_WARNING, "Wedge outer diameter = NaN near line %d. Skipped\n", n_total_read); continue; } - dim[0] = in[col++]; + dim[0] = factor * in[col++]; } else /* Set during -S parsing */ - dim[0] = S.w_radius; + dim[0] = factor * S.w_radius; if (S.w_get_a) { /* Must read from file */ if (gmt_M_is_dnan (in[col])) { GMT_Report (API, GMT_MSG_WARNING, "Wedge start angle = NaN near line %d. Skipped\n", n_total_read); @@ -2027,15 +2035,15 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { dim[2] = in[col++]; } else { /* Angles were set during -S parsing */ - dim[1] = S.size_x; - dim[2] = S.size_y; + dim[1] = S.size_x / factor; /* Undo damage from scaling size_x|y from -H */ + dim[2] = S.size_y / factor; } if (S.w_get_di) { /* Must read from file else it was set during -S parsing */ if (gmt_M_is_dnan (in[col])) { GMT_Report (API, GMT_MSG_WARNING, "Wedge inner diameter = NaN near line %d. Skipped\n", n_total_read); continue; } - S.w_radius_i = in[col]; + S.w_radius_i = factor * in[col]; } if (S.convert_angles) { if (gmt_M_is_cartesian (GMT, GMT_IN)) { @@ -2080,6 +2088,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { /* Angles (enforce 0-360), dimensions or other quantities */ dim[j+1] = in[ex1+S.read_size+j]; if (S.custom->type[j] == GMT_IS_ANGLE && dim[j+1] < 0.0) dim[j+1] += 360.0; + else if (S.custom->type[j] == GMT_IS_DIMENSION) dim[j+1] *= factor; } if (!S.custom->start) S.custom->start = (get_rgb) ? 3 : 2; if ((error = gmt_draw_custom_symbol (GMT, xpos[item], plot_y, dim, In->text, S.custom, ¤t_pen, ¤t_fill, outline_setting))) diff --git a/src/psxyz.c b/src/psxyz.c index c094dc82a42..83053c81cf8 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -663,6 +663,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { double DX = 0, DY = 0, *xp = NULL, *yp = NULL, *in = NULL, *v4_rgb = NULL, *z_for_cpt = NULL; double lux[3] = {0.0, 0.0, 0.0}, tmp, x_1, x_2, y_1, y_2, dx, dy, s, c, zz, zb, length, base; double bar_gap, bar_width, bar_step, nominal_size_x, nominal_size_y; + double axes[2] = {0.0, 0.0}, Az = 0.0, factor = 1.0; struct GMT_PEN default_pen, current_pen, last_headpen, last_spiderpen, nominal_pen; struct GMT_FILL default_fill, current_fill, black, no_fill; @@ -1194,13 +1195,6 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { } } - if ((S.symbol == PSL_ELLIPSE || S.symbol == PSL_ROTRECT) && !S.par_set) { /* Ellipses or rectangles */ - if (S.n_required == 0) /* Degenerate ellipse or rectangle, Got diameter via S.size_x */ - in2[ex2] = in2[ex3] = S.size_x, in[ex1] = 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ - else if (S.n_required == 1) /* Degenerate ellipse or rectangle, expect single diameter via input */ - in2[ex2] = in2[ex3] = in[ex1], in[ex1] = 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ - } - if (S.read_size) { /* Update sizes from input */ S.size_x = in[ex1] * S.factor; if (delayed_unit_scaling[GMT_X]) S.size_x *= GMT->session.u2u[S.u][GMT_INCH]; @@ -1215,6 +1209,15 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { S.size_y = nominal_size_y * scl; } + if ((S.symbol == PSL_ELLIPSE || S.symbol == PSL_ROTRECT) && !S.par_set) { /* Ellipses or rectangles */ + if (S.n_required == 0) /* Degenerate ellipse or rectangle, got diameter via S.size_x */ + axes[GMT_X] = axes[GMT_Y] = S.size_x, Az = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ + else if (S.n_required == 1) /* Degenerate ellipse or rectangle, expect single diameter via input */ + axes[GMT_X] = axes[GMT_Y] = in[ex1], Az = (gmt_M_is_cartesian (GMT, GMT_IN)) ? 90.0 : 0.0; /* Duplicate diameter as major and minor axes and set azimuth to zero */ + else /* Full ellipse */ + Az = in[ex1], axes[GMT_X] = in[ex2], axes[GMT_Y] = in[ex3]; + } + if (S.base_set & GMT_BASE_ORIGIN) data[n].flag |= 32; /* Flag that base needs to be added to height(s) */ if (Ctrl->W.cpt_effect) { @@ -1311,21 +1314,21 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { data[n].dim[2] = S.size_y; } else { /* Get parameters from file */ - if (gmt_M_is_dnan (p_in[ex1])) { + if (gmt_M_is_dnan (Az)) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle angle = NaN near line %d. Skipped\n", n_total_read); continue; } - if (gmt_M_is_dnan (p_in[ex2])) { + if (gmt_M_is_dnan (axes[GMT_X])) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle width or major axis = NaN near line %d. Skipped\n", n_total_read); continue; } - if (gmt_M_is_dnan (p_in[ex3])) { + if (gmt_M_is_dnan (axes[GMT_Y])) { GMT_Report (API, GMT_MSG_WARNING, "Ellipse/Rectangle height or minor axis = NaN near line %d. Skipped\n", n_total_read); continue; } - data[n].dim[0] = p_in[ex1]; /* direction */ - data[n].dim[1] = p_in[ex2]; - data[n].dim[2] = p_in[ex3]; + data[n].dim[0] = Az; /* direction */ + data[n].dim[1] = factor * axes[GMT_X]; + data[n].dim[2] = factor * axes[GMT_Y]; } gmt_flip_angle_d (GMT, &data[n].dim[0]); if (S.convert_angles) { /* Got axis in km */ diff --git a/src/seis/pscoupe.c b/src/seis/pscoupe.c index 1b4c758afc7..d986127981d 100644 --- a/src/seis/pscoupe.c +++ b/src/seis/pscoupe.c @@ -29,7 +29,7 @@ PostScript code is written to stdout. #define THIS_MODULE_PURPOSE "Plot cross-sections of focal mechanisms" #define THIS_MODULE_KEYS "X}" #define THIS_MODULE_NEEDS "Jd" -#define THIS_MODULE_OPTIONS "-:>BJKOPRUVXYdehipqt" GMT_OPT("Hc") +#define THIS_MODULE_OPTIONS "-:>BJKOPRUVXYdehipqt" GMT_OPT("c") #define DEFAULT_FONTSIZE 9.0 /* In points */ #define DEFAULT_OFFSET 3.0 /* In points */ @@ -74,6 +74,11 @@ struct PSCOUPE_CTRL { bool active; struct GMT_FILL fill; } G; + struct PSCOUPE_H { /* -H read overall scaling factor for symbol size and pen width */ + bool active; + unsigned int mode; + double value; + } H; struct PSCOUPE_I { /* -I[] */ bool active; unsigned int mode; /* 0 if constant, 1 if read from file */ @@ -145,6 +150,10 @@ struct PSCOUPE_CTRL { } T2; }; +enum Pscoupe_scaletype { + PSCOUPE_READ_SCALE = 0, + PSCOUPE_CONST_SCALE = 1}; + static void *New_Ctrl (struct GMT_CTRL *GMT) { /* Allocate and initialize a new control structure */ struct PSCOUPE_CTRL *C; @@ -436,7 +445,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); GMT_Message (API, GMT_TIME_NONE, "usage: %s [
] -A %s %s -S[][+a][+f][+j][+o[/]]\n", name, GMT_J_OPT, GMT_Rgeo_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-C] [-E] [-Fa[][/[]] [-Fe] [-Fg] [-Fr] [-Fp[]] [-Ft[]]\n", GMT_B_OPT); - GMT_Message (API, GMT_TIME_NONE, "\t[-Fs+f+o/+j] [-G] [-I[]] %s[-L] [-M] [-N] %s%s\n", API->K_OPT, API->O_OPT, API->P_OPT); + GMT_Message (API, GMT_TIME_NONE, "\t[-Fs+f+o/+j] [-G] [-H[]] [-I[]] %s[-L] [-M] [-N] %s%s\n", API->K_OPT, API->O_OPT, API->P_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[-Q] [-T[/]] [%s] [%s] [-W] \n", GMT_U_OPT, GMT_V_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s]\n", GMT_X_OPT, GMT_Y_OPT); GMT_Message (API, GMT_TIME_NONE, "\t%s[%s] [%s] [%s]\n\t[%s]\n\t[%s]\n\t[%s] [%s] [%s] [%s]\n\n", API->c_OPT, GMT_di_OPT, GMT_e_OPT, GMT_h_OPT, GMT_i_OPT, GMT_p_OPT, GMT_qi_OPT, GMT_tv_OPT, GMT_colon_OPT, GMT_PAR_OPT); @@ -490,6 +499,8 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Message (API, GMT_TIME_NONE, "\t st(a)r, (c)ircle, (d)iamond, (h)exagon, (i)nvtriangle, (s)quare, (t)riangle.\n"); GMT_Message (API, GMT_TIME_NONE, "\t t Draw T_symbol outline using the current pen (see -W) or sets pen attribute for outline.\n"); gmt_fill_syntax (API->GMT, 'G', NULL, "Set color used for compressive parts [Default is black]."); + GMT_Message (API, GMT_TIME_NONE, "\t-H Scale symbol sizes (set via -S or input column) and pen attributes by factors read from scale column.\n"); + GMT_Message (API, GMT_TIME_NONE, "\t The scale column follows the symbol size column. Alternatively, append a fixed .\n"); GMT_Message (API, GMT_TIME_NONE, "\t-I Use the intensity to modulate the compressive fill color (requires -C or -G).\n"); GMT_Message (API, GMT_TIME_NONE, "\t If no intensity is given we expect it to follow the required columns in the data record.\n"); GMT_Option (API, "K"); @@ -702,6 +713,13 @@ static int parse (struct GMT_CTRL *GMT, struct PSCOUPE_CTRL *Ctrl, struct GMT_OP } Ctrl->A.polygon = true; break; + case 'H': /* Overall symbol/pen scale column provided */ + Ctrl->H.active = true; + if (opt->arg[0]) { /* Gave a fixed scale - no reading from file */ + Ctrl->H.value = atof (opt->arg); + Ctrl->H.mode = PSCOUPE_CONST_SCALE; + } + break; case 'I': /* Adjust symbol color via intensity */ Ctrl->I.active = true; if (opt->arg[0]) @@ -871,11 +889,11 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { int n_rec = 0, n_plane_old = 0, form = 0, error; int i, transparence_old = 0, not_defined = 0; int n_scanned = 0; - unsigned int scol = 0, icol = 0, tcol_f = 0, tcol_s = 0; + unsigned int xcol = 0, scol = 0, icol = 0, tcol_f = 0, tcol_s = 0; FILE *pnew = NULL, *pext = NULL; double size, xy[2], xynew[2] = {0.0}, plot_x, plot_y, n_dep, distance, fault, depth; - double scale, P_x, P_y, T_x, T_y, *in = NULL; + double scale, P_x, P_y, T_x, T_y, nominal_size, *in = NULL; char event_title[GMT_BUFSIZ] = {""}, Xstring[GMT_BUFSIZ] = {""}, Ystring[GMT_BUFSIZ] = {""}; @@ -885,6 +903,7 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { struct AXIS T, N, P, Tr, Nr, Pr; struct GMT_PALETTE *CPT = NULL; struct GMT_RECORD *In = NULL; + struct GMT_PEN current_pen; struct PSCOUPE_CTRL *Ctrl = NULL; struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL; /* General GMT internal parameters */ @@ -911,6 +930,7 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { gmt_M_memset (&meca, 1, meca); gmt_M_memset (&moment, 1, moment); + nominal_size = Ctrl->S.scale; if (Ctrl->C.active) { if ((CPT = GMT_Read_Data (API, GMT_IS_PALETTE, GMT_IS_FILE, GMT_IS_NONE, GMT_READ_NORMAL, NULL, Ctrl->C.file, NULL)) == NULL) { @@ -940,7 +960,6 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { PSL_setfont (PSL, GMT->current.setting.font_annot[GMT_PRIMARY].id); - gmt_setpen (GMT, &Ctrl->W.pen); if (!Ctrl->N.active) gmt_map_clip_on (GMT, GMT->session.no_rgb, 3); if (Ctrl->S.read) { /* Read symbol size from file */ @@ -950,7 +969,11 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { } else /* Fixed scale */ scale = Ctrl->S.scale; - + if (Ctrl->H.active && Ctrl->H.mode == PSCOUPE_READ_SCALE) { + xcol = Ctrl->S.n_cols; + Ctrl->S.n_cols++; /* Read scaling from data file */ + gmt_set_column_type (GMT, GMT_IN, xcol, GMT_IS_FLOAT); + } if (Ctrl->I.mode) { /* Read intensity from data file */ icol = Ctrl->S.n_cols; Ctrl->S.n_cols++; @@ -1005,8 +1028,12 @@ EXTERN_MSC int GMT_pscoupe (void *V_API, int mode, void *args) { in = In->data; n_rec++; - if (Ctrl->S.read) scale = in[scol]; + if (Ctrl->S.read) nominal_size = scale = in[scol]; size = scale; + if (Ctrl->H.active) { /* Variable scaling of symbol size and pen width */ + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + size *= scl; + } /* Must examine the trailing text for optional columns: newX, newY and title */ /* newX and newY are not used in pscoupe, but we promised psmeca and pscoupe can use the same input file */ if (In->text) { @@ -1201,6 +1228,10 @@ Definition of scalar moment. } size = (meca_computed_mw (moment, meca.magms) / 5.0) * scale; + if (Ctrl->H.active) { /* Variable scaling of symbol size and pen width */ + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + size *= scl; + } if (!Ctrl->Q.active) fprintf (pext, "%s\n", In->text); if (Ctrl->S.readmode == READ_AXIS) { @@ -1229,17 +1260,32 @@ Definition of scalar moment. } if (Ctrl->S.plotmode == PLOT_TENSOR) { - gmt_setpen (GMT, &Ctrl->L.pen); + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_tensor (GMT, PSL, plot_x, plot_y, size, T, N, P, &Ctrl->G.fill, &Ctrl->E.fill, Ctrl->L.active, Ctrl->S.zerotrace, n_rec); } if (Ctrl->S.zerotrace) { - gmt_setpen (GMT, &Ctrl->W.pen); + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_tensor (GMT, PSL, plot_x, plot_y, size, T, N, P, NULL, NULL, true, true, n_rec); } if (Ctrl->T.active) { - gmt_setpen (GMT, &Ctrl->T.pen); + current_pen = Ctrl->T.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_plan (GMT, PSL, plot_x, plot_y, meca, size, Ctrl->T.n_plane); if (not_defined) { not_defined = false; @@ -1248,19 +1294,32 @@ Definition of scalar moment. } } else if (Ctrl->S.plotmode == PLOT_DC) { - gmt_setpen (GMT, &Ctrl->L.pen); + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_mechanism (GMT, PSL, plot_x, plot_y, meca, size, &Ctrl->G.fill, &Ctrl->E.fill, Ctrl->L.active); } - if (Ctrl->A2.active) { + if (Ctrl->A2.active) { /* Plot axis symbols */ + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + double asize = (Ctrl->H.active) ? Ctrl->A2.size * scl : Ctrl->A2.size; if (Ctrl->S.readmode != READ_TENSOR && Ctrl->S.readmode != READ_AXIS) meca_dc2axe (meca, &T, &N, &P); meca_axis2xy (plot_x, plot_y, size, P.str, P.dip, T.str, T.dip, &P_x, &P_y, &T_x, &T_y); - gmt_setpen (GMT, &Ctrl->P2.pen); + current_pen = Ctrl->P2.pen; + if (Ctrl->H.active) + gmt_scale_pen (GMT, ¤t_pen, scl); + gmt_setpen (GMT, ¤t_pen); gmt_setfill (GMT, &Ctrl->G2.fill, Ctrl->P2.active); - PSL_plotsymbol (PSL, P_x, P_y, &Ctrl->A2.size, Ctrl->A2.P_symbol); - gmt_setpen (GMT, &Ctrl->T2.pen); + PSL_plotsymbol (PSL, P_x, P_y, &asize, Ctrl->A2.P_symbol); + current_pen = Ctrl->T2.pen; + if (Ctrl->H.active) + gmt_scale_pen (GMT, ¤t_pen, scl); + gmt_setpen (GMT, ¤t_pen); gmt_setfill (GMT, &Ctrl->E2.fill, Ctrl->T2.active); - PSL_plotsymbol (PSL, T_x, T_y, &Ctrl->A2.size, Ctrl->A2.T_symbol); + PSL_plotsymbol (PSL, T_x, T_y, &asize, Ctrl->A2.T_symbol); } } @@ -1285,7 +1344,12 @@ Definition of scalar moment. else /* Top or middle aligned */ label_y += Ctrl->S.offset[1]; - gmt_setpen (GMT, &Ctrl->W.pen); + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSCOUPE_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); PSL_setfill (PSL, Ctrl->R2.fill.rgb, 0); if (Ctrl->R2.active) PSL_plottextbox (PSL, label_x, label_y, Ctrl->S.font.size, event_title, Ctrl->S.angle, label_justify, label_offset, 0); form = gmt_setfont(GMT, &Ctrl->S.font); diff --git a/src/seis/psmeca.c b/src/seis/psmeca.c index 92a0a26dc35..4ed5efad777 100644 --- a/src/seis/psmeca.c +++ b/src/seis/psmeca.c @@ -28,7 +28,7 @@ PostScript code is written to stdout. #define THIS_MODULE_PURPOSE "Plot focal mechanisms" #define THIS_MODULE_KEYS "X}" #define THIS_MODULE_NEEDS "Jd" -#define THIS_MODULE_OPTIONS "-:>BJKOPRUVXYdehipqt" GMT_OPT("Hc") +#define THIS_MODULE_OPTIONS "-:>BJKOPRUVXYdehipqt" GMT_OPT("c") #define DEFAULT_FONTSIZE 9.0 /* In points */ #define DEFAULT_OFFSET 3.0 /* In points */ @@ -70,6 +70,11 @@ struct PSMECA_CTRL { bool active; struct GMT_FILL fill; } G; + struct PSMECA_H { /* -H read overall scaling factor for symbol size and pen width */ + bool active; + unsigned int mode; + double value; + } H; struct PSMECA_I { /* -I[] */ bool active; unsigned int mode; /* 0 if constant, 1 if read from file */ @@ -141,6 +146,10 @@ struct PSMECA_CTRL { } Z2; }; +enum Psmeca_scaletype { + PSMECA_READ_SCALE = 0, + PSMECA_CONST_SCALE = 1}; + static void *New_Ctrl (struct GMT_CTRL *GMT) { /* Allocate and initialize a new control structure */ struct PSMECA_CTRL *C; @@ -179,7 +188,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); GMT_Message (API, GMT_TIME_NONE, "usage: %s [
] %s %s\n", name, GMT_J_OPT, GMT_Rgeo_OPT); GMT_Message (API, GMT_TIME_NONE, "\t-S[][+a][+f][+j][+o[/]] [-A[+p][+s]]\n"); - GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-C] [-D/] [-E] [-G] [-I[]] %s[-L] [-M]\n", GMT_B_OPT, API->K_OPT); + GMT_Message (API, GMT_TIME_NONE, "\t[%s] [-C] [-D/] [-E] [-G] [-H[]] [-I[]] %s[-L] [-M]\n", GMT_B_OPT, API->K_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[-Fa[[/[]]] [-Fe] [-Fg] [-Fo] [-Fr] [-Fp[]] [-Ft[]] [-Fz[]]\n"); GMT_Message (API, GMT_TIME_NONE, "\t[-N] %s%s[-T[/]] [%s] [%s] [-W]\n", API->O_OPT, API->P_OPT, GMT_U_OPT, GMT_V_OPT); GMT_Message (API, GMT_TIME_NONE, "\t[%s] [%s]\n", GMT_X_OPT, GMT_Y_OPT); @@ -232,6 +241,8 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Message (API, GMT_TIME_NONE, "\t r Draw box behind labels.\n"); GMT_Message (API, GMT_TIME_NONE, "\t z Overlay zero trace moment tensor using default pen (see -W) or append outline pen.\n"); gmt_fill_syntax (API->GMT, 'G', NULL, "Set filling of compressive quadrants [Default is black]."); + GMT_Message (API, GMT_TIME_NONE, "\t-H Scale symbol sizes (set via -S or input column) and pen attributes by factors read from scale column.\n"); + GMT_Message (API, GMT_TIME_NONE, "\t The scale column follows the symbol size column. Alternatively, append a fixed .\n"); GMT_Message (API, GMT_TIME_NONE, "\t-I Use the intensity to modulate the compressive fill color (requires -C or -G).\n"); GMT_Message (API, GMT_TIME_NONE, "\t If no intensity is given we expect it to follow the required columns in the data record.\n"); GMT_Option (API, "K"); @@ -439,6 +450,13 @@ static int parse (struct GMT_CTRL *GMT, struct PSMECA_CTRL *Ctrl, struct GMT_OPT n_errors++; } break; + case 'H': /* Overall symbol/pen scale column provided */ + Ctrl->H.active = true; + if (opt->arg[0]) { /* Gave a fixed scale - no reading from file */ + Ctrl->H.value = atof (opt->arg); + Ctrl->H.mode = PSMECA_CONST_SCALE; + } + break; case 'I': /* Adjust symbol color via intensity */ Ctrl->I.active = true; if (opt->arg[0]) @@ -598,12 +616,12 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { int i, n, form = 0, new_fmt; int n_rec = 0, n_plane_old = 0, error; int n_scanned = 0; - unsigned int scol = 0, icol = 0, tcol_f = 0, tcol_s = 0; + unsigned int xcol = 0, scol = 0, icol = 0, tcol_f = 0, tcol_s = 0; bool transparence_old = false, not_defined = false; double plot_x, plot_y, plot_xnew, plot_ynew, delaz, *in = NULL; double t11 = 1.0, t12 = 0.0, t21 = 0.0, t22 = 1.0, xynew[2] = {0.0}; - double scale, fault, depth, size, P_x, P_y, T_x, T_y; + double scale, fault, depth, size, P_x, P_y, T_x, T_y, nominal_size; char string[GMT_BUFSIZ] = {""}, Xstring[GMT_BUFSIZ] = {""}, Ystring[GMT_BUFSIZ] = {""}, event_title[GMT_BUFSIZ] = {""}; @@ -614,6 +632,7 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { struct GMT_PALETTE *CPT = NULL; struct GMT_RECORD *In = NULL; + struct GMT_PEN current_pen; struct PSMECA_CTRL *Ctrl = NULL; struct GMT_CTRL *GMT = NULL, *GMT_cpy = NULL; /* General GMT internal parameters */ struct GMT_OPTION *options = NULL; @@ -642,7 +661,7 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { gmt_M_memset (&T, 1, struct AXIS); gmt_M_memset (&N, 1, struct AXIS); gmt_M_memset (&P, 1, struct AXIS); - + nominal_size = Ctrl->S.scale; if (Ctrl->C.active) { if ((CPT = GMT_Read_Data (API, GMT_IS_PALETTE, GMT_IS_FILE, GMT_IS_NONE, GMT_READ_NORMAL, NULL, Ctrl->C.file, NULL)) == NULL) { Return (API->error); @@ -672,6 +691,11 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { } else /* Fixed scale */ scale = Ctrl->S.scale; + if (Ctrl->H.active && Ctrl->H.mode == PSMECA_READ_SCALE) { + xcol = Ctrl->S.n_cols; + Ctrl->S.n_cols++; /* Read scaling from data file */ + gmt_set_column_type (GMT, GMT_IN, xcol, GMT_IS_FLOAT); + } if (Ctrl->I.mode) { /* Read intensity from data file */ icol = Ctrl->S.n_cols; Ctrl->S.n_cols++; @@ -901,7 +925,12 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { if (Ctrl->A.active) { if (fabs (xynew[GMT_X]) > EPSIL || fabs (xynew[GMT_Y]) > EPSIL) { - gmt_setpen (GMT, &Ctrl->A.pen); + current_pen = Ctrl->A.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); gmt_geo_to_xy (GMT, xynew[GMT_X], xynew[GMT_Y], &plot_xnew, &plot_ynew); gmt_setfill (GMT, &Ctrl->G.fill, 1); if (Ctrl->A.size > 0.0) PSL_plotsymbol (PSL, plot_x, plot_y, &(Ctrl->A.size), PSL_CIRCLE); @@ -916,10 +945,14 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { meca.moment.exponent = 23; } - if (Ctrl->S.read) scale = in[scol]; + if (Ctrl->S.read) nominal_size = scale = in[scol]; moment.mant = meca.moment.mant; moment.exponent = meca.moment.exponent; size = (meca_computed_mw(moment, meca.magms) / 5.0) * scale; + if (Ctrl->H.active) { /* Variable scaling of symbol size and pen width */ + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + size *= scl; + } if (size < 0.0) { /* Addressing Bug #1171 */ GMT_Report (API, GMT_MSG_WARNING, "Skipping negative symbol size %g for record # %d.\n", size, n_rec); @@ -935,7 +968,12 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { N.str = meca_zero_360(N.str + delaz); P.str = meca_zero_360(P.str + delaz); - gmt_setpen (GMT, &Ctrl->L.pen); + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); if (fabs (N.val) < EPSIL && fabs (T.val + P.val) < EPSIL) { meca_axe2dc (T, P, &meca.NP1, &meca.NP2); meca_ps_mechanism (GMT, PSL, plot_x, plot_y, meca, size, &Ctrl->G.fill, &Ctrl->E.fill, Ctrl->L.active); @@ -945,14 +983,24 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { } if (Ctrl->Z2.active) { - gmt_setpen (GMT, &Ctrl->Z2.pen); + current_pen = Ctrl->Z2.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_tensor (GMT, PSL, plot_x, plot_y, size, T, N, P, NULL, NULL, true, true, n_rec); } if (Ctrl->T.active) { meca.NP1.str = meca_zero_360(meca.NP1.str + delaz); meca.NP2.str = meca_zero_360(meca.NP2.str + delaz); - gmt_setpen (GMT, &Ctrl->T.pen); + current_pen = Ctrl->T.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_plan (GMT, PSL, plot_x, plot_y, meca, size, Ctrl->T.n_plane); if (not_defined) { not_defined = false; @@ -963,7 +1011,12 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { else if (Ctrl->S.readmode == READ_AKI || Ctrl->S.readmode == READ_CMT || Ctrl->S.readmode == READ_PLANES || Ctrl->S.plotmode == PLOT_DC) { meca.NP1.str = meca_zero_360(meca.NP1.str + delaz); meca.NP2.str = meca_zero_360(meca.NP2.str + delaz); - gmt_setpen (GMT, &Ctrl->L.pen); + current_pen = Ctrl->L.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); meca_ps_mechanism (GMT, PSL, plot_x, plot_y, meca, size, &Ctrl->G.fill, &Ctrl->E.fill, Ctrl->L.active); } @@ -988,7 +1041,12 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { else /* Top or middle aligned */ label_y += Ctrl->S.offset[1]; - gmt_setpen (GMT, &Ctrl->W.pen); + current_pen = Ctrl->W.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); PSL_setfill (PSL, Ctrl->R2.fill.rgb, 0); if (Ctrl->R2.active) PSL_plottextbox (PSL, label_x, label_y, Ctrl->S.font.size, event_title, Ctrl->S.angle, label_justify, label_offset, 0); form = gmt_setfont(GMT, &Ctrl->S.font); @@ -998,10 +1056,20 @@ EXTERN_MSC int GMT_psmeca (void *V_API, int mode, void *args) { if (Ctrl->A2.active) { if (Ctrl->S.readmode != READ_TENSOR && Ctrl->S.readmode != READ_AXIS) meca_dc2axe (meca, &T, &N, &P); meca_axis2xy (plot_x, plot_y, size, P.str, P.dip, T.str, T.dip, &P_x, &P_y, &T_x, &T_y); - gmt_setpen (GMT, &Ctrl->P2.pen); + current_pen = Ctrl->P2.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); gmt_setfill (GMT, &Ctrl->G2.fill, Ctrl->P2.active ? 1 : 0); PSL_plotsymbol (PSL, P_x, P_y, &Ctrl->A2.size, Ctrl->A2.P_symbol); - gmt_setpen (GMT, &Ctrl->T2.pen); + current_pen = Ctrl->T2.pen; + if (Ctrl->H.active) { + double scl = (Ctrl->H.mode == PSMECA_READ_SCALE) ? in[xcol] : Ctrl->H.value; + gmt_scale_pen (GMT, ¤t_pen, scl); + } + gmt_setpen (GMT, ¤t_pen); gmt_setfill (GMT, &Ctrl->E2.fill, Ctrl->T2.active ? 1 : 0); PSL_plotsymbol (PSL, T_x, T_y, &Ctrl->A2.size, Ctrl->A2.T_symbol); } diff --git a/test/geodesy/geodesy_07.ps b/test/geodesy/geodesy_07.ps index 66d03a35901..e96d7c4f758 100644 Binary files a/test/geodesy/geodesy_07.ps and b/test/geodesy/geodesy_07.ps differ diff --git a/test/geodesy/geodesy_07.sh b/test/geodesy/geodesy_07.sh index ec0d1e0446a..ec44b6690ae 100755 --- a/test/geodesy/geodesy_07.sh +++ b/test/geodesy/geodesy_07.sh @@ -30,15 +30,15 @@ EOF gmt begin -C geodesy_07 ps gmt makecpt -Cturbo -T0/5 gmt set MAP_FRAME_TYPE plain - gmt subplot begin 4x2 -Fs5c -JM5c -R-124.6/-123.3/40/41 -A+jTR+gwhite -SCb -SRl+p -BWSrt -M6p -Ba1 - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0/0 -Gorange -W1.5p -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0/0 -Gorange -W1.5p,orange -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0/0 -C -W1.5p -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0/0 -C -W1.5p+c -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0/0 -C -W1.5p+c -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95/0 -D10 -C -W1.5p+c -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95/0 -D10 -C -W1.5p+c -L0.25p -Elightgray -c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.0/0 -D10 -C -W1.5p+c - gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95/0 -D10 -C -W1.5p+c -L0.25p+c -c -Zn + gmt subplot begin 4x2 -Fs5c -JM5c -R-124.6/-123.3/40/41 -A+jTR+gwhite -SCb -SRl+p -BWSrt -M6p/10p -Ba1 + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0+f0 -Gorange -W1.5p -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0+f0 -Gorange -W1.5p,orange -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0+f0 -C -W1.5p -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5 -Se0.50/0+f0 -C -W1.5p+c -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0+f0 -C -W1.5p+c -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95+f0 -D10 -C -W1.5p+c -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95+f0 -D10 -C -W1.5p+c -L0.25p -Elightgray -c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.0+f0 -D10 -C -W1.5p+c + gmt velo GPS_test.txt -A10p+e+a40+n6k+h0.5+p -Se0.50/0.95+f0 -D10 -C -W1.5p+c -L0.25p+c -c -Zn gmt subplot end gmt end show diff --git a/test/geodesy/geodesy_08.sh b/test/geodesy/geodesy_08.sh index fb1f79275d6..ad31104de74 100755 --- a/test/geodesy/geodesy_08.sh +++ b/test/geodesy/geodesy_08.sh @@ -39,7 +39,7 @@ cat << EOF > main.sh gmt begin gmt basemap -R-124.6/-123.3/40/41 -JM5i -B -BWSne -Y0.5i -X0.75i --MAP_FRAME_TYPE=plain gmt events labels.txt -L1 -Et -T\${MOVIE_COL0} -F+f12p,Helvetica-Bold,red+jBL -Dj0.1c --TIME_UNIT=d - gmt events -Z"velo -A18p+e+a40+n6k+h0.5 -Se0.50/0/0p" -Ct.cpt -W1.5 -N data.txt -T\${MOVIE_COL0} -Es+r1+p1+d1+f1 -Mi1+c-0.5 -Ms2+c0.5 -Mt+c0 -L3 --TIME_UNIT=d + gmt events -Z"velo -A18p+e+a40+n6k+h0.5 -Se0.50/0" -Ct.cpt -W1.5 -N data.txt -T\${MOVIE_COL0} -Es+r1+p1+d1+f1 -Mi1+c-0.5 -Ms2+c0.5 -Mt+c0 -L3 --TIME_UNIT=d gmt end EOF #gmt movie main.sh -C6ix6ix100 -Ngeodesy_08 -Fmp4 -Mm,ps -Lc0+jTR+o1c/1.5c -Lf+o2c/1.5c -Ttime.txt -Z --FORMAT_CLOCK_MAP=hh diff --git a/test/psevents/eventlabelbox.ps b/test/psevents/eventlabelbox.ps index dc3bbc57da0..754620ddf5c 100644 Binary files a/test/psevents/eventlabelbox.ps and b/test/psevents/eventlabelbox.ps differ diff --git a/test/seis/seis_12.ps b/test/seis/seis_12.ps index f9af71165bc..432750e2693 100644 Binary files a/test/seis/seis_12.ps and b/test/seis/seis_12.ps differ