Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/GenericMappingTools/gmt: (24 commits)
  Bump actions/cache from 3 to 4 (#8323)
  Add longoptions support for psbarb. (#8283)
  Add longoptions support for nearneighbor. (#8281)
  Add longoptions support for makecpt. (#8280)
  Add longoptions support for kml2gmt. (#8279)
  Add longoptions support for inset. (#8278)
  Add longoptions support for grdvolume. (#8276)
  Add longoptions support for grdview. (#8275)
  Batch #8 of longoptions translation tests. (#8272)
  Enable longoptions support for grdconvert. (#8197)
  Enable longoptions support for grd2xyz. (#8178)
  Update gmt_init.c
  Allow -A even if movie is not generated
  typos
  Update std-opts.rst
  Same case, clearer titles
  Dateline crossing dcw polygons and tiles (#8318)
  Missed a space before -T synopsis
  Improve windbarb docs, synopsis and usage for -Q and parsing of -Q (#8314)
  Let grdmix create RGB imagea for red, green, blue grids in 0-255 range (#8316)
  ...
  • Loading branch information
remkos committed Jan 23, 2024
2 parents 19e86ca + 7c59602 commit b8acdff
Show file tree
Hide file tree
Showing 53 changed files with 794 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion doc/rst/source/explain_-bo_full.rst_
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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.
Expand Down
3 changes: 2 additions & 1 deletion doc/rst/source/grdmix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 4 additions & 4 deletions doc/rst/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ it can do.
- :doc:`std-opts`
- :ref:`Projections Specifications <proj-codes>`
- :doc:`Default Settings (gmt.conf) <gmt.conf>`
- :doc:`Colors <gmtcolors>`
- :doc:`Color Picker <color-picker>`
- :doc:`Color Codes and Lists <gmtcolors>`
- :doc:`Interactive Color Picker <color-picker>`
- :doc:`35 Postscript Fonts </reference/postscript-fonts>`
- :doc:`Using LaTeX in text </reference/gmt-latex>`
- :doc:`Using LaTeX in Text </reference/gmt-latex>`
- :doc:`Built-in CPTs </reference/cpts>`
- :doc:`Built-in patterns </reference/predefined-patterns>`
- :doc:`Built-in Patterns </reference/predefined-patterns>`
- :doc:`Octal Codes of Characters </reference/octal-codes>`
- :ref:`Character Escape Sequences <Char-esc-seq>`
- :ref:`Pen Syntax <-Wpen_attrib>`
Expand Down
2 changes: 1 addition & 1 deletion doc/rst/source/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion doc/rst/source/reference/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
10 changes: 5 additions & 5 deletions doc/rst/source/std-opts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ 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*
- :ref:`Shift plot origin in x-direction <-XY_full>`
* - **-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**]
- :ref:`Select binary output <-bo_full>`
* - **-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*
Expand Down Expand Up @@ -67,7 +67,7 @@ Common Options
* - **-x**\ [[-]\ *n*]
- :ref:`Set number of cores in multi-threaded modules <core_full>`
* - **-:**\ [**i**\|\ **o**]
- :ref:`Expect y/x input rather than x/y <colon_full>`
- :ref:`Expect y/x input (or output) rather than x/y <colon_full>`

.. rubric:: Standardized Command Line Options available in GMT Classic Mode Only

Expand All @@ -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**
Expand Down
25 changes: 18 additions & 7 deletions doc/rst/source/supplements/windbarbs/barb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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*] ]
Expand Down Expand Up @@ -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
------------------
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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
Expand Down
24 changes: 0 additions & 24 deletions doc/rst/source/supplements/windbarbs/explain_windbarbs.rst_

This file was deleted.

26 changes: 19 additions & 7 deletions doc/rst/source/supplements/windbarbs/grdbarb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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| ]
Expand Down Expand Up @@ -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|
Expand Down Expand Up @@ -167,8 +181,6 @@ Optional Arguments

.. include:: ../../explain_grd_inout.rst_

.. include:: explain_windbarbs.rst_


Examples
--------
Expand All @@ -191,4 +203,4 @@ See Also
--------

:doc:`gmt </gmt>`, :doc:`gmtcolors </gmtcolors>`,
:doc:`grdvector </grdvector>`, :doc:`psbarb`
:doc:`grdvector </grdvector>`, :doc:`barb`
4 changes: 2 additions & 2 deletions doc/scripts/GMT_cap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/gmt_dcw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 11 additions & 5 deletions src/gmt_plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "....<math>LaTeX...</math> ..." 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);
Expand Down
2 changes: 1 addition & 1 deletion src/gmtconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 [<table>] [-A] [-C[+l<min>][+u<max>][+i]] [-D[<template>[+o<orig>]]] "
"[-E[f|l|m|M<stride>]] [-F%s] [-I[tsr]] [-L] [-N<col>[+a|d]] [-Q[~]<selection>] [-S[~]\"search string\"|+f<file>[+e] | -S[~]/<regexp>/[i][+e]]"
"[-E[f|l|m|M<stride>]] [-F%s] [-I[tsr]] [-L] [-N<col>[+a|d]] [-Q[~]<selection>] [-S[~]\"search string\"|+f<file>[+e] | -S[~]/<regexp>/[i][+e]] "
"[-T[h][d[[~]<selection>]]] [%s] [-W[+n]] [-Z] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n",
name, GMT_SEGMENTIZE4, GMT_V_OPT, GMT_a_OPT, GMT_b_OPT, GMT_d_OPT, GMT_e_OPT, GMT_f_OPT, GMT_g_OPT,
GMT_h_OPT, GMT_i_OPT, GMT_o_OPT, GMT_q_OPT, GMT_s_OPT, GMT_w_OPT, GMT_colon_OPT, GMT_PAR_OPT);
Expand Down
Loading

0 comments on commit b8acdff

Please sign in to comment.