Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Jan 7, 2025
2 parents 3fcd2ab + c21e899 commit cc91be5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 43 deletions.
3 changes: 1 addition & 2 deletions ci/install-dependencies-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ sudo apt-get update
sudo apt-get install -y --no-install-recommends --no-install-suggests $packages

# Install packages via conda
conda update -n base -c conda-forge conda --solver libmamba
conda install ${conda_packages} -c conda-forge --solver libmamba
conda install ${conda_packages} -c conda-forge
echo "${CONDA}/bin" >> $GITHUB_PATH

# Remove pcre-config from conda's path so cmake won't find the conda's one
Expand Down
3 changes: 1 addition & 2 deletions ci/install-dependencies-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ fi
brew install ${packages}

# Install packages via conda
conda update -n base -c conda-forge conda --solver libmamba
conda install ${conda_packages} -c conda-forge --solver libmamba
conda install ${conda_packages} -c conda-forge
echo "${CONDA}/bin" >> $GITHUB_PATH

# Remove pcre-config from conda's path so cmake won't find the conda's one
Expand Down
3 changes: 1 addition & 2 deletions ci/install-dependencies-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ if [ "$PACKAGE" = "true" ]; then
fi

# install more packages using conda
$CONDA\\Scripts\\conda.exe update -n base -c conda-forge conda --solver libmamba
$CONDA\\Scripts\\conda.exe install ${conda_packages} -c conda-forge --solver libmamba
$CONDA\\Scripts\\conda.exe install ${conda_packages} -c conda-forge
echo "$CONDA\\Library\\bin" >> $GITHUB_PATH
echo "$CONDA\\Scripts" >> $GITHUB_PATH

Expand Down
36 changes: 13 additions & 23 deletions doc/rst/source/reference/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,48 +519,38 @@ URLs and remote files

Three classes of files are given special treatment in GMT.

#. Some data sets are ubiquitous and used by nearly all GMT users.
At the moment this collection is limited to Earth relief grids. If you specify
a grid input named **@earth_relief_**\ *res* on a command line then
such a grid will automatically be downloaded from the GMT Data Server and placed
in the *server* directory under **$GMT_USERDIR** [~/.gmt]. The resolution *res* allows a choice among
15 common grid spacings: 01d, 30m, 20m, 15m, 10m, 06m, 05m, 04m, 03m, 02m, 01m,
30s, and 15s (with file sizes 111 kb, 376 kb, 782 kb, 1.3 Mb, 2.8 Mb, 7.5 Mb,
11 Mb, 16 Mb, 27 Mb, 58 Mb, 214 Mb, 778 Mb, and 2.6 Gb respectively) as well
as the SRTM tile resolutions 03s and 01s (6.8 Gb and 41 Gb for the whole set, respectively). Once
one of these grids have been downloaded any future reference will simply obtain the
file from **$GMT_USERDIR** (except if explicitly removed by the user).
**Note**: The 15 arc-sec data comes from the original dataset SRTM15+.
Lower resolutions are spherically Gaussian-filtered versions of SRTM15+.
The SRTM (version 3) 1 and 3 arc-sec tiles are only available over land
between 60 degrees south and north latitude and are stored as highly compressed JPEG2000
tiles on the GMT server. These are individually downloaded as requested, converted to netCDF
grids and stored in subdirectories srtm1 and srtm3 under the server directory, and assembled
into a seamless grid using :doc:`/grdblend`. A tile is only downloaded and converted
once (unless the user cleans the data directories).
#. GMT offers several remote global data grids that you can access via our remote file mechanism
(e.g. **@earth_relief**). The first time you access one of these files, GMT will download
the file (or a subset tile) from the selected GMT server and save it to the *server* directory
under your **$GMT_USERDIR** directory [~/.gmt]. Once one of these grids have been downloaded
any future reference will simply obtain the file from **$GMT_USERDIR** (except if explicitly
removed by the user). See the `Remote Datasets <https://docs.generic-mapping-tools.org/dev/datasets/remote-data.html>`_
section for a comprehensive list of available remote datasets and detailed information.


#. If a file is given as a full URL, starting with **http://**, **https://**,
or **ftp://**, then the file will be downloaded to the current directory and subsequently
read from there (until removed by the user). If the URL is actually a CGI Get
read from there (until removed by the user). If the URL is actually a CGI Get
command (i.e., ends in ?par=val1&par2=val2...) then we download the file
each time we encounter the URL.
#. Demonstration files used in online documentation, example scripts, or even the
large test suite may be given in the format @\ *filename*. When such a file is
encountered on the command line it is understood to be a short-hand representation
of the full URL to *filename* on the GMT Cache Data site.
Since this address may change over time we use the leading
@ to simplify access to these files. Such files will also be downloaded
@ to simplify access to these files. Such files will also be downloaded
to :term:`DIR_CACHE` and subsequently read from there (until removed by the user).
#. By default, remote files are downloaded from the SOEST data server. However, you
can override that selection by setting the environmental parameter **$GMT_DATA_SERVER** or
the default setting for :term:`GMT_DATA_SERVER`. Alternatively, configure the CMake
the default setting for :term:`GMT_DATA_SERVER`. Alternatively, configure the CMake
parameter GMT_DATA_SERVER at compile time.
#. If your Internet connection is slow or nonexistent (e.g., on a plane) you can also
limit the size of the largest datafile to download via :term:`GMT_DATA_SERVER_LIMIT` or
you can temporarily turn off such downloads by setting :term:`GMT_DATA_UPDATE_INTERVAL` to "off".

The user cache (:term:`DIR_CACHE`) and all its contents can be cleared any time
via the command **gmt clear cache**, while the server directory with downloaded data
can be cleared via the command **gmt clear data**. Finally, when a remote file is requested
can be cleared via the command **gmt clear data**. Finally, when a remote file is requested
we also check if that file has changed at the server and re-download the updated file;
this check is only performed no more often than once a day.

Expand Down
28 changes: 16 additions & 12 deletions doc/rst/source/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ Optional Arguments
[0/0]. If *dy* is not specified then it is set equal to *dx*. Prepend
an optional directive:

- **-j** - Offset the text away from the point instead (i.e., the
- **j** - Offset the text away from the point instead (i.e., the
text justification will determine the direction of the shift).
- **-J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`.
- **J** - Shorten diagonal offsets at corners by :math:`\sqrt{2}`.

Optionally, append the modifier:

Expand All @@ -196,25 +196,29 @@ Optional Arguments
at the Upper Left corner of the map.
- **+f** - Set the font ([*size*][,\ *fontname*][,\ *color*]); if no font info
is given then the input file must have this information in one of its columns.
- **+h** - Use the most recent segment header as the text to be plotted.
comes from the data record. Instead, use **+h** or **+l** to select the
- **+j** - Set the text justification; if no justification is given then the input
file must have this item as a column.

Normally, the text is read from the data records. Alternative ways to provide text:

- **+h** - Use the most recent segment header as the text to be plotted.
- **+l** - Use the most recent segment label as the text to be plotted.
- **+r** - Use the record number (counting up from *first* [0]) as the text to be plotted.
- **+t** - Use the appended *text* to set a fixed text string (if *text* contains plus
characters then the **+t** modifier must be the last modifier in |-F|).
- **+z** - Format incoming *z* values to a string using the supplied *format*
[if not appended we use :term:`FORMAT_FLOAT_MAP`].

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.
**Notes**: |-F|\ **+h**\|\ **l**\|\ **r**\|\ **t**\| **z** can't be used with |-M|.

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.

.. _-G:

Expand Down
2 changes: 1 addition & 1 deletion src/gmtbinstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static int parse (struct GMT_CTRL *GMT, struct GMTBINSTATS_CTRL *Ctrl, struct GM
n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -2, "Option -S: Unable to decode radius\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -3, "Option -S: Radius is negative\n");
}
n_errors += gmt_check_binary_io (GMT, (Ctrl->W.active) ? 4 : 3);
n_errors += gmt_check_binary_io(GMT, (Ctrl->C.mode == GMTBINSTATS_COUNT) ? 2 : (Ctrl->W.active) ? 4 : 3);
if (Ctrl->W.active) { /* Update the mode if median or mode */
if (Ctrl->C.mode == GMTBINSTATS_MEDIAN) Ctrl->C.mode = GMTBINSTATS_MEDIANW;
if (Ctrl->C.mode == GMTBINSTATS_MODE) Ctrl->C.mode = GMTBINSTATS_MODEW;
Expand Down
2 changes: 1 addition & 1 deletion src/pstext.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSTEXT_CTRL *Ctrl, struct GMT_OPT
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->M.active, "Option -Gc: Cannot be used with -M.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->W.active, "Option -Gc: Cannot be used with -W.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->D.line, "Option -Gc: Cannot be used with -D...v<pen>.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h|r|t|z.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->S.active && !(Ctrl->G.active && Ctrl->G.mode == 0), "Option -S: Requires -G as well.\n");
n_errors += gmt_M_check_condition (GMT, strchr ("cC", Ctrl->C.mode) && !Ctrl->M.active, "Option -C: Box shape mode +tc|C is only available when -M is selected.\n");

Expand Down

0 comments on commit cc91be5

Please sign in to comment.