diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6e3ba4b811..ec2530a4e7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: EXCLUDE_OPTIONAL: ${{ matrix.EXCLUDE_OPTIONAL }} - name: Cache GSHHG and DCW data - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-coastline with: path: ${{ env.COASTLINEDIR }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d48cd975a88..405260bdceb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -82,7 +82,7 @@ jobs: fi - name: Cache GSHHG and DCW data - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-coastline with: path: ${{ env.COASTLINEDIR }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b457328c347..0a9ccc3966a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -74,7 +74,7 @@ jobs: bash ci/install-dependencies-${os}.sh - name: Cache GSHHG and DCW data - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-coastline with: path: ${{ env.COASTLINEDIR }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab018e0afc3..63d2dd2800c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: runner.os == 'Windows' - name: Cache GSHHG and DCW data - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-coastline with: path: ${{ env.COASTLINEDIR }} diff --git a/README.md b/README.md index 74cd785b829..4e9c3227c71 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Documentation (development version)](https://img.shields.io/badge/docs-development-green.svg)](http://docs.generic-mapping-tools.org/dev/) [![GitHub release](https://img.shields.io/github/release/GenericMappingTools/gmt)](https://github.com/GenericMappingTools/gmt/releases) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5708769.svg)](https://doi.org/10.5281/zenodo.5708769) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3407865.svg)](https://zenodo.org/doi/10.5281/zenodo.3407865) ## What is GMT? diff --git a/doc/rst/source/explain_-bo_full.rst_ b/doc/rst/source/explain_-bo_full.rst_ index 629b45f3d0b..bc189f24a58 100644 --- a/doc/rst/source/explain_-bo_full.rst_ +++ b/doc/rst/source/explain_-bo_full.rst_ @@ -13,7 +13,7 @@ Select native binary format for table output. The *record* must be one or more g of given *type* and *type* must be one of **c**, **u**, **h**, **H**, **i**, **I**, **l**, **L**, **f**, or **d** [Default] (see :ref:`-bi types ` for descriptions). Force byte-swapping of a group by appending **w** at the end of the group. -For a mixed-type output record, append additional comma-separated groups (no space between groups) +For a mixed-type output record, append additional comma-separated groups (no space between groups). The following modifiers are supported: - **+b**\|\ **l** to indicate that the entire data file should be written as big- or little-endian, respectively. diff --git a/doc/rst/source/grdmix.rst b/doc/rst/source/grdmix.rst index 2b892f6c5c4..1556aaf01d9 100644 --- a/doc/rst/source/grdmix.rst +++ b/doc/rst/source/grdmix.rst @@ -63,7 +63,8 @@ Required Arguments If only one is given and |-C| is not set then *raster1* must be an image. If two are given then *raster1* and *raster2* must both be either images or grids. If three are given then they must all be grids and - |-C| must be set. + |-C| must be set, unless the three grids reflect red, green, and blue in + 0-255 range, in which case |-C| is not needed. .. _-G: diff --git a/doc/rst/source/index.rst b/doc/rst/source/index.rst index 95194dbe8e7..b61c6fc2ee2 100644 --- a/doc/rst/source/index.rst +++ b/doc/rst/source/index.rst @@ -16,12 +16,12 @@ it can do. - :doc:`std-opts` - :ref:`Projections Specifications ` - :doc:`Default Settings (gmt.conf) ` - - :doc:`Colors ` - - :doc:`Color Picker ` + - :doc:`Color Codes and Lists ` + - :doc:`Interactive Color Picker ` - :doc:`35 Postscript Fonts ` - - :doc:`Using LaTeX in text ` + - :doc:`Using LaTeX in Text ` - :doc:`Built-in CPTs ` - - :doc:`Built-in patterns ` + - :doc:`Built-in Patterns ` - :doc:`Octal Codes of Characters ` - :ref:`Character Escape Sequences ` - :ref:`Pen Syntax <-Wpen_attrib>` diff --git a/doc/rst/source/plot.rst b/doc/rst/source/plot.rst index 5a76192a201..e06ecdab04f 100644 --- a/doc/rst/source/plot.rst +++ b/doc/rst/source/plot.rst @@ -192,7 +192,7 @@ Optional Arguments Use the |-F| option to create various networks between input point. Dashed lines indicate input ordering for the two tables, while solid lines are the resulting network connections. Top left is original input, while the next five reflect the results - of directives **ra**, **rt**, **rs**, **r**\ 10/35 and **na**. + of directives **pa**, **pt**, **ps**, **p**\ 10/35 and **na**. .. _-G: diff --git a/doc/rst/source/reference/options.rst b/doc/rst/source/reference/options.rst index f38ded93444..2bd2733bef5 100644 --- a/doc/rst/source/reference/options.rst +++ b/doc/rst/source/reference/options.rst @@ -917,7 +917,7 @@ of the higher data frequencies, as shown in Figure :ref:`Registration resampling Intermediate wavelengths will experience attenuated amplitudes as well. b) Transfer function for resampling data from a pixel-registered to a gridline-registered grid format illustrates the loss of amplitude that will occur. There is also a linear change in phase from 0 to 90 degrees as a - function of wavenumber :math:`k_j` [Marks and Smith, 2007 [14]_. + function of wavenumber :math:`k_j` [Marks and Smith, 2007] [14]_. .. toggle:: diff --git a/doc/rst/source/std-opts.rst b/doc/rst/source/std-opts.rst index d95bb49de78..d7124b28870 100644 --- a/doc/rst/source/std-opts.rst +++ b/doc/rst/source/std-opts.rst @@ -17,7 +17,7 @@ Common Options * - **-R**\ *west/east/south/north*\ [*/zmin/zmax*][**+r**][**+u**\ *unit*] - :ref:`Specify region of interest <-R_full>` * - **-U**\ [*label*][**+c**][**+j**\ *just*][**+o**\ *dx*/*dy*][**+t**\ *text*] - - :ref:`Plot time-stamp on plot <-U_full>` + - :ref:`Display time-stamp on plot <-U_full>` * - **-V**\ [*verbosity*] - :ref:`Run in verbose mode <-V_full>` * - **-X**\ [**a**\|\ **c**\|\ **f**\|\ **r**]\ *xshift* @@ -25,7 +25,7 @@ Common Options * - **-Y**\ [**a**\|\ **c**\|\ **f**\|\ **r**]\ *yshift* - :ref:`Shift plot origin in y-direction <-XY_full>` * - **-a**\ [*col*\ =]\ *name*\ [,\ *...*] - - :ref:`Associates aspatial data with columns <-aspatial_full>` + - :ref:`Associate aspatial data with columns <-aspatial_full>` * - **-bi**\ *record*\ [**+b**\|\ **l**] - :ref:`Select binary input <-bi_full>` * - **-bo**\ *record*\ [**+b**\|\ **l**] @@ -33,7 +33,7 @@ Common Options * - **-c**\ [*row*\ ,\ *col*\|\ *index*] - :ref:`Advance plot focus to selected (or next) subplot panel <-c_full>` * - **-d**\ [**i**\|\ **o**]\ *nodata*\ [**+c**\ *col*] - - :ref:`Replace columns with nodata with NaN <-d_full>` + - :ref:`Replace nodata in columns with NaN <-d_full>` * - **-e**\ [**~**]\ *"pattern"* \| **-e**\ [**~**]/\ *regexp*/[**i**] - :ref:`Filter data records that match the given pattern <-e_full>` * - **-f**\ [**i**\|\ **o**]\ *colinfo* @@ -67,7 +67,7 @@ Common Options * - **-x**\ [[-]\ *n*] - :ref:`Set number of cores in multi-threaded modules ` * - **-:**\ [**i**\|\ **o**] - - :ref:`Expect y/x input rather than x/y ` + - :ref:`Expect y/x input (or output) rather than x/y ` .. rubric:: Standardized Command Line Options available in GMT Classic Mode Only @@ -81,7 +81,7 @@ but the following common options are: * - Option - Description * - **-K** - - :ref:`Append more PS later <-K_full>` + - :ref:`Append more PostScript later <-K_full>` * - **-O** - :ref:`This is an overlay plot <-O_full>` * - **-P** diff --git a/doc/rst/source/supplements/windbarbs/barb.rst b/doc/rst/source/supplements/windbarbs/barb.rst index 408657313f1..07668d1b33f 100644 --- a/doc/rst/source/supplements/windbarbs/barb.rst +++ b/doc/rst/source/supplements/windbarbs/barb.rst @@ -23,7 +23,7 @@ Synopsis [ |-G|\ *fill* ] [ |-I|\ *intens* ] [ |-N| ] -[ |-Q|\ *parameters* ] +[ |-Q|\ *length*\ [**+a**\ *angle*][**+g**\ -\|\ *fill*][**+jb**\|\ **c**\|\ **e**][**+p**\ -\|\ *pen*][**+s**\ *scale*][**+w**\ *width*][**+z**] ] [ |SYN_OPT-U| ] [ |SYN_OPT-V| ] [ |-W|\ [*pen*][*attr*] ] @@ -56,7 +56,6 @@ interpret the third and fourth columns of the input data as barb length and width, respectively. Select a fill with |-G|. If |-G| is set, |-W| will control whether the outline is drawn or not. -The PostScript code is written to standard output. Required Arguments ------------------ @@ -132,9 +131,24 @@ Optional Arguments .. _-Q: -**-Q**\ *parameters* +**-Q**\ *length*\ [**+a**\ *angle*][**+g**\ -\|\ *fill*][**+jb**\|\ **c**\|\ **e**][**+p**\ -\|\ *pen*][**+s**\ *scale*][**+w**\ *width*][**+z**] Modify wind barb parameters. Append wind barb *length* [Default is 0.5c]. - See `Wind Barb Attributes`_ for specifying additional attributes. + Several modifiers may be appended to specify the placement of barbs, their shapes, and the + justification of the wind barb. Below, left and right refers to the + side of the wind barb line when viewed from the start point to the + end point of the segment. Chose among these modifiers: + + - **+a** - Set the angle of the wind barb [120]. + - **+g** - Turn off *fill* (if -) or set the wind + barb fill [Default fill is used, which may be no fill]. + - **+p** - Sets the wind barb pen attributes. If *pen* has a + leading - then the outline is not drawn [Default pen is used, and + outline is drawn]. + - **+j** - Determines how the input *x*,\ *y* point relates to the + wind barb. Choose from **b**\ eginning [default], **e**\ nd, or **c**\ enter. + - **+s** - Set the wind speed which corresponds to a long barb [default 5]. + - **+w** - Set the *width* of wind barbs. + - **+z** - Input (u,v) wind components instead of (azimuth,speed). .. |Add_-U| replace:: |Add_-U_links| .. include:: ../../explain_-U.rst_ @@ -188,9 +202,6 @@ Optional Arguments .. include:: ../../explain_help.rst_ -.. include:: explain_windbarbs.rst_ -**+z** to input (u,v) wind components instead of (azimuth,speed) - .. module_common_ends Examples diff --git a/doc/rst/source/supplements/windbarbs/explain_windbarbs.rst_ b/doc/rst/source/supplements/windbarbs/explain_windbarbs.rst_ deleted file mode 100644 index 58fe1f1187b..00000000000 --- a/doc/rst/source/supplements/windbarbs/explain_windbarbs.rst_ +++ /dev/null @@ -1,24 +0,0 @@ -Wind Barb Attributes --------------------- - -Several modifiers may be appended to the windbarb-producing options to -specify the placement of barbs, their shapes, and the -justification of the wind barb. Below, left and right refers to the -side of the wind barb line when viewed from the start point to the -end point of the segment: - -**+a**\ *angle* sets the angle of the wind barb [120]. - -**+g**-\ \|\ *fill* turns off wind barb fill (if -) or sets the wind -barb fill [Default fill is used, which may be no fill]. - -**+p**\ [-][*pen*] sets the wind barb pen attributes. If *pen* has a -leading - then the outline is not drawn. [Default pen is used, and -outline is drawn] - -**+j**\ *just* determines how the input *x*,\ *y* point relates to the -wind barb. Choose from **b**\ eginning [default], **e**\ nd, or **c**\ enter. - -**+s** to set the wind speed which corresponds to a long barb [default 5] - -**+w** to set the *width* of wind barbs diff --git a/doc/rst/source/supplements/windbarbs/grdbarb.rst b/doc/rst/source/supplements/windbarbs/grdbarb.rst index 6419de78d1f..a69da5b738e 100644 --- a/doc/rst/source/supplements/windbarbs/grdbarb.rst +++ b/doc/rst/source/supplements/windbarbs/grdbarb.rst @@ -23,7 +23,7 @@ Synopsis [ |-G|\ *fill* ] [ |-I|\ [**x**]\ *dx*\ [/*dy*] ] [ |-N| ] -[ |-Q|\ *parameters* ] +[ |-Q|\ *length*\ [**+a**\ *angle*][**+g**\ -\|\ *fill*][**+jb**\|\ **c**\|\ **e**][**+p**\ -\|\ *pen*][**+s**\ *scale*][**+w**\ *width*] ] [ |SYN_OPT-R| ] [ |-T| ] [ |SYN_OPT-U| ] @@ -112,10 +112,24 @@ Optional Arguments .. _-Q: -**-Q**\ *parameters* +**-Q**\ *length*\ [**+a**\ *angle*][**+g**\ -\|\ *fill*][**+jb**\|\ **c**\|\ **e**][**+p**\ -\|\ *pen*][**+s**\ *scale*][**+w**\ *width*] Modify wind barb parameters. Append wind barb *length* [Default is 0.5c]. - See `Wind Barb Attributes`_ for specifying additional attributes. - + Several modifiers may be appended to specify the placement of barbs, their shapes, and the + justification of the wind barb. Below, left and right refers to the + side of the wind barb line when viewed from the start point to the + end point of the segment. Chose among these modifiers: + + - **+a** - Set the angle of the wind barb [120]. + - **+g** - Turn off *fill* (if -) or set the wind + barb fill [Default fill is used, which may be no fill]. + - **+p** - Sets the wind barb pen attributes. If *pen* has a + leading - then the outline is not drawn [Default pen is used, and + outline is drawn]. + - **+j** - Determines how the input *x*,\ *y* point relates to the + wind barb. Choose from **b**\ eginning [default], **e**\ nd, or **c**\ enter. + - **+s** - Set the wind speed which corresponds to a long barb [default 5]. + - **+w** - Set the *width* of wind barbs. + .. _-R: .. |Add_-Rgeo| replace:: |Add_-R_auto_table| @@ -167,8 +181,6 @@ Optional Arguments .. include:: ../../explain_grd_inout.rst_ -.. include:: explain_windbarbs.rst_ - Examples -------- @@ -191,4 +203,4 @@ See Also -------- :doc:`gmt `, :doc:`gmtcolors `, -:doc:`grdvector `, :doc:`psbarb` +:doc:`grdvector `, :doc:`barb` diff --git a/doc/scripts/GMT_cap.sh b/doc/scripts/GMT_cap.sh index f165be3ff9a..891eda19d86 100755 --- a/doc/scripts/GMT_cap.sh +++ b/doc/scripts/GMT_cap.sh @@ -21,11 +21,11 @@ gmt begin GMT_cap gmt plot -Wfaint butt.txt gmt plot -Sc3p -Gwhite -Wfaint butt.txt # miter - gmt plot --PS_LINE_CAP=round -W10p,lightblue,,20_20:0 round.txt + gmt plot --PS_LINE_CAP=round -W10p,lightblue,20_20:0 round.txt gmt plot -Wfaint round.txt gmt plot -Sc3p -Gwhite -Wfaint round.txt # bevel - gmt plot --PS_LINE_CAP=square -W10p,lightorange,,20_20:0 square.txt + gmt plot --PS_LINE_CAP=square -W10p,lightorange,20_20:0 square.txt gmt plot -Wfaint square.txt gmt plot -Sc3p -Gwhite -Wfaint square.txt gmt text -F+f8p,Helvetica-Bold+j -Dj5p <<- EOF diff --git a/src/gmt_dcw.c b/src/gmt_dcw.c index a23b25bbac7..9faaa41af88 100644 --- a/src/gmt_dcw.c +++ b/src/gmt_dcw.c @@ -900,6 +900,9 @@ struct GMT_DATASET * gmt_DCW_operation (struct GMT_CTRL *GMT, struct GMT_DCW_SEL wesn[XLO] = 0.0; wesn[XHI] = 360.0; } + /* US DCW can return dumb things like this: -R172.436/-66.9489 */ + if (wesn[XLO] > 0.0 && wesn[XHI] < 0.0) /* Crazy US, RU, and Fiji crossing dateline and get backwards limit signs... */ + wesn[XHI] += 360.0; GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Region implied by DCW polygons is %g/%g/%g/%g\n", wesn[XLO], wesn[XHI], wesn[YLO], wesn[YHI]); } gmt_M_free (GMT, order); diff --git a/src/gmt_init.c b/src/gmt_init.c index 62e7f43bcc8..9dbc1c61943 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -7684,7 +7684,7 @@ GMT_LOCAL void gmtinit_explain_R_geo (struct GMT_CTRL *GMT) { void gmtlib_explain_options (struct GMT_CTRL *GMT, char *options) { char u, *GMT_choice[2] = {"OFF", "ON"}, *V_code = GMT_VERBOSE_CODES; -#ifdef GMT_MP_ENABLED +#if defined(GMT_MP_ENABLED) int cores = 0; #endif double s; @@ -8135,7 +8135,7 @@ void gmtlib_explain_options (struct GMT_CTRL *GMT, char *options) { GMT->session.unit_name[GMT->current.setting.proj_length_unit]); break; -#ifdef GMT_MP_ENABLED +#if defined(GMT_MP_ENABLED) case 'y': /* Number of threads (reassigned from -x in GMT_Option) */ if (strlen (GMT_x_OPT) > 1) { /* Only print this if it is in fact available */ cores = gmtlib_get_num_processors(); @@ -9164,7 +9164,7 @@ int gmt_default_error (struct GMT_CTRL *GMT, char option) { case 's': error += GMT->common.s.active == false; break; case 't': error += GMT->common.t.active == false; break; case 'w': error += GMT->common.w.active == false; break; -#ifdef GMT_MP_ENABLED +#if !defined(GMT_MP_ENABLED) case 'x': error += GMT->common.x.active == false; break; #endif case ':': error += GMT->common.colon.active == false; break; diff --git a/src/gmt_plot.c b/src/gmt_plot.c index c82a0011fb8..d84a4180b31 100644 --- a/src/gmt_plot.c +++ b/src/gmt_plot.c @@ -9257,14 +9257,20 @@ struct PSL_CTRL *gmt_plotinit (struct GMT_CTRL *GMT, struct GMT_OPTION *options) if (strcmp (P->tag, "-")) { /* Place the panel tag */ int form, refpoint, justify; + refpoint = gmt_just_decode (GMT, P->refpoint, PSL_NO_DEF); /* Convert XX refpoint code to PSL number */ + gmtlib_refpoint_to_panel_xy (GMT, refpoint, P, &plot_x, &plot_y); /* Convert just code to panel location */ if (gmt_text_is_latex (GMT, P->tag)) { /* LaTeX commands, i.e., "....@[LaTeX...@[ ..." or "....LaTeX... ..." not supported in tags */ - /* See branch latex-in-subplot-tags. We get gs error when I tried to implement the standard solution inside the PSL_completion function. - * More work is needed to learn what goes wrong, probably by asking on the ghostscript help/support line. */ - GMT_Report (GMT->parent, GMT_MSG_WARNING, "Latex expressions are not (yet) supported as subplot panel tags - use text instead\n"); + FILE *fp = NULL; + if ((fp = fopen ("/tmp/Crummy_Latex_equation_tmp.txt", "a"))) { + GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Unable to create temporary Latex file to bypass equations in panels\n"); + /* See branch latex-in-subplot-tags. We get gs error when I tried to implement the standard solution inside the PSL_completion function. + * More work is needed to learn what goes wrong, probably by asking on the ghostscript help/support line. */ + GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Latex expressions are not (yet) supported as subplot panel tags - use text instead after subplot end\n"); + fprintf (fp, "%lg\t%lg\t%s\n", P->col * P->w - P->off[GMT_X], (P->nrows - P->row) * P->h - P->off[GMT_Y], P->tag); + fclose (fp); + } goto no_latex_tags; } - refpoint = gmt_just_decode (GMT, P->refpoint, PSL_NO_DEF); /* Convert XX refpoint code to PSL number */ - gmtlib_refpoint_to_panel_xy (GMT, refpoint, P, &plot_x, &plot_y); /* Convert just code to panel location */ /* Undo any offsets above that was required to center the plot on the subplot panel */ plot_x -= (P->dx); plot_y -= (P->dy); diff --git a/src/gmtconvert.c b/src/gmtconvert.c index 7ce91d33e75..6b3779d26fc 100644 --- a/src/gmtconvert.c +++ b/src/gmtconvert.c @@ -142,7 +142,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_Usage (API, 0, "usage: %s [] [-A] [-C[+l][+u][+i]] [-D[