# pygmt.which¶

pygmt.which(fname, **kwargs)[source]

Find the full path to specified files.

Reports the full paths to the files given through fname. We look for the file in (1) the current directory, (2) in $GMT_USERDIR (if defined), (3) in$GMT_DATADIR (if defined), or (4) in \$GMT_CACHEDIR (if defined).

fname can also be a downloadable file (either a full URL, a @file special file for downloading from the GMT Site Cache, or @earth_relief_* topography grids). In these cases, use option download to set the desired behavior. If download is not used (or False), the file will not be found.

Full option list at https://docs.generic-mapping-tools.org/latest/gmtwhich.html

Aliases:

• V = verbose

Parameters
• fname (str) – The file name that you want to check.

• verbose (str) –

Select verbosity level [Default is w], which modulates the messages written to stderr. Choose among 7 levels of verbosity:

• q - Quiet, not even fatal error messages are produced

• e - Error messages only

• w - Warnings [Default]

• t - Timings (report runtimes for time-intensive algorthms);

• i - Informational messages (same as “verbose=True”)

• c - Compatibility warnings

• d - Debugging messages

Returns

path (str) – The path of the file, depending on the options used.

Raises