Coder Social home page Coder Social logo

genericmappingtools / gmt Goto Github PK

View Code? Open in Web Editor NEW
803.0 39.0 331.0 887.53 MB

The Generic Mapping Tools

Home Page: https://www.generic-mapping-tools.org

License: Other

CMake 1.08% C 91.02% Shell 6.34% Batchfile 0.04% PostScript 0.30% Julia 0.02% MATLAB 0.02% Makefile 1.11% Gnuplot 0.06% Perl 0.01% Fortran 0.01% LLVM 0.01%
geophysics earth-science mapping geospatial c generic-mapping-tools

gmt's Introduction

GMT logo

Generic Mapping Tools

Tests CodeCov Coverity Documentation (development version) GitHub release Contributor Covenant DOI

What is GMT?

GMT is an open source collection of about 100 command-line tools for manipulating geographic and Cartesian data sets (including filtering, trend fitting, gridding, projecting, etc.) and producing high-quality illustrations ranging from simple x-y plots via contour maps to artificially illuminated surfaces, 3D perspective views and animations. The GMT supplements add another 50 more specialized and discipline-specific tools. GMT supports over 30 map projections and transformations and requires support data such as GSHHG coastlines, rivers, and political boundaries and optionally DCW country polygons.

GMT is developed and maintained by the GMT Team, with help from a global set of contributors and support by the National Science Foundation.

The GMT World Domination

Considering its flexibility at no charge, people worldwide are using GMT in their work and at home. Most users of GMT are Earth, ocean or planetary scientists, but there are apparently no limits to the kind of applications that may benefit from GMT. We know GMT is used in medical research, engineering, physics, mathematics, social and biological sciences, and by geographers, fisheries institutes, oil companies, a wide range of government agencies, and last but not least innumerable hobbyists.

Installation

GMT has been installed successfully under UNIX/Linux/macOS/FreeBSD/OpenBSD on workstations. It also installs under Windows and in UNIX emulators such as Cygwin or on virtual machines. We anticipate few problems if you are installing the package on other platforms.

Note there are three GMT tar archives available (#3 is optional):

  1. gmt-6.x.x.tar.gz: The GMT 6 distribution
  2. gshhg-gmt-2.x.x.tar.gz: All five resolutions of GSHHG coastline data
  3. dcw-gmt-2.x.x.tar.gz: Digital Chart of the World polygon data

For macOS and Windows users there are separate installers available. You can obtain GMT and support data from the GMT main site.

Refer to the install instructions to install GMT, and build instructions to build GMT from the sources.

Citation

If you think it is appropriate, you may consider paying us back by including our latest article in the reference list of your future publications that will benefit from the availability of GMT:

Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools version 6. Geochemistry, Geophysics, Geosystems, 20, 5556-5564. https://doi.org/10.1029/2019GC008515

Software support

You haven't bought anything so you cannot expect full service. However, if you find a bug in any of the programs, please report it to us by opening an issue rather than trying to fix it yourself so that we, and through us, other users may benefit from your find. Make sure you provide us with enough information so that we can recreate the problem.

For general questions, please post on the GMT Community Forum.

Contributing

Contributions are welcome and appreciated. Please refer to the contributing guidelines for more details.

License

Copyright (c) 1991-2024 by the GMT Team.

GMT is released under the GNU Lesser General Public License version 3 or any later version. See LICENSE.TXT for full details.

Acknowledgment

GMT relies on several other Open Source software libraries, programs and data for its operation. We gratefully acknowledge the importance to GMT of these products. GMT may be linked with these libraries (* means optional):

Network Common Data Form (netCDF), Geospatial Data Abstraction Library (GDAL), Perl Compatible Regular Expressions (PCRE*), Fastest Fourier Transform in the West (FFTW*), Linear Algebra Package (LAPACK*), Basic Linear Algebra Subprograms (BLAS*), GLIB*, and ZLIB*. GMT may call these executables: GDAL (ogr2ogr, gdal_translate), Ghostscript, FFmpeg, xdg-open, and GraphicsMagick.

GMT uses (or can access) raster data derived from these sources:

GMT provides several color maps from these sources:

gmt's People

Contributors

adamjstewart avatar anbj avatar core-man avatar dependabot[bot] avatar esteban82 avatar holishing avatar jidanni avatar joa-quim avatar kristofkoch avatar ldldr avatar leouieda avatar marcelobanik avatar maxrjones avatar michaelgrund avatar mrajner avatar paulwessel avatar rbdavis avatar remkos avatar rfcstein avatar rikardfalkeborn avatar sarzeaud avatar sebastic avatar seisman avatar sjhorst avatar walterhfsmith avatar wangliang1989 avatar weiji14 avatar willschlitzer avatar yvonnefroehlich avatar zmalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmt's Issues

shake map

What would be the interest of having a new module(s) to compute shake maps like those displayed by USGS?
I have it done (ported from my old MEX for GMT4) and makes it a breeze to compute the Vs30 grids as compared to the cumbersome (original) way.

The point is that I'm not a seismologist and if people start to ask questions the burden of it would probably had to go to @seisman

Under modern mode, mapproject must acquire -R -J from gmt.history in certain situations

Currently, the NEEDS setting for mapproject.c says

#define THIS_MODULE_NEEDS ""

meaning -R -J are not required for mapproject to run.

However, there are many situations when -R is needed, and if not supplied on the command line we must obtain the most recent -R form the history. That aspect is not implemented yet and hence some commands (e.g., doc_modern/scripts/GMT_mapscale.sh) fails since we do not explicitly pass -R and -J even though those two are required for mapproject to do this work.

I will look at this once more urgent matters like homework grading and department self-study report have been completed...

Add grdcontour option for grd2kml

Description of the desired feature

Add an option (e.g. -W) for overlaying contours in grd2kml using either:

  1. a constant sample spacing and pen attributes (e.g. spacing=500 pen=1p,black)

gmt grd2kml input.grd -I+a340 -Ctable.cpt -W500+w1p,black -Nkml_output

or

  1. an input text file that contains the contour levels and corresponding pen attributes

gmt grd2kml input.grd -I+a340 -Ctable.cpt -Wcontours.txt -Nkml_output

contours.txt =
-4000 1p,grey
-3000 1p,grey
-2000 3p,black
-1000 1p,grey

"Under the hood" - Call grdcontour after grdimage and before psconvert

Are you willing to help implement and maintain this feature? Yes/No

4464c7b

Create a GMT QGIS plugin

Hi all,
when discussing with one GMT heavy users, the idea popped up to write a simple plugin to wrap GMT functions in QGIS. A GUI would help newbies, and putting this in QGIS Processing framework would allow to build complex models combining other powerful tools.
If anybody is interested please let us know.
@ghtmtt

Under modern mode, gmt plot with no arguments issues usage message

I thought I had fixed that earlier but need to check: In some modern mode scripts, gmt plot is used to just draw the default line, usually like this:

gmt plot << EOF
...coordinates...
EOF

where -R -J have been set earlier in the script. Yet, at least some of these respond by plotting the usage message, such as in doc_modern/script/GMT_pstext_clearance.sh.
Will have to check later.

Units are ignored in -W+o<size><unit>

From the endarrows.sh test

gmt psxy -R -J -W1p+o0.5i/0.25i+v0.25i+gred -O t.txt -K >> $ps 

is different from

gmt psxy -R -J -W1p+o1.25/0.25i+v0.25i+gred -O t.txt -K >> $ps 

Use Docker containers on TravisCI

In #5, we're installing our dependencies on Travis using apt-get, which isn't recommended by them. It would be best to have a Docker container that has all of the dependencies installed and we run the tests inside of it. That way we can reproduce the build environment locally if needed.

Some help setting this up would be greatly appreciated because we don't have experience with Docker.

cc @bakerunavco

Update scripts to modern mode

Description of the desired feature

Scripts in doc_modern/scripts and GMT_Docs.rst should be updated to modern mode.

Are you willing to help implement and maintain this feature? Yes

gmt plot without options not working in modern mode

Description of the problem
This bug was first reported in issue http://gmt.soest.hawaii.edu/issues/1206, and was fixed in r19961. However, the bug appear again now.

Full script that generated the error

gmt begin test pdf
gmt plot -JX10c/10c -R0/10/0/10 -Bafg -W2p,blue << EOF
0 0 
3 3
EOF
gmt plot << EOF
4 4
6 6
EOF
gmt end

Full error message

The second plot just prints usage to terminal.

System information

  • Operating system: macOS
  • Version of GMT: 6.0.0_6a11ef0

grdimage crash when called from external interfaces

This Julia example

imshow("http://larryfire.files.wordpress.com/2009/07/untooned_jessicarabbit.jpg",
             frame="g", region="d", proj="I15c", image_in="r", show=true, Vd=1)

that translates to

grdimage  -Rd -JI15c -Bg -Dr -P http://larryfire.files.wordpress.com/2009/07/untooned_jessicarabbit.jpg -K > C:\tmp\GMTjl_tmp.ps

crashes at grdimage line 1346

	if (API->external && Ix && Iy) {	/* Restore old arrays since read-only image */
		gmt_M_free (GMT, I->x);	gmt_M_free (GMT, I->y);      // HERE
		I->x = Ix;	I->y = Iy;
	}

because the I object is NULL

-Jz on 'flat' modules

I think I (partially) brought this before thought not in public. It always puzzles me when I see flat modules listing -Jz in the options list. This strikes as a contradiction. If they are flat why should we might want to use the -Jz option? OK, by flat I mean those modules that create flat images (or no images at all). I found these in that category

gmtlogo
psclip
psmask
pshistogram
psmask
pstext
pswiggle
grdimage
psimage

than looked in our test suite and only these two, sphere_volume (uses -Jz in a pstext call) and 3dbars (-JZ in grdimage) use it. Removing -Jz from the former makes no difference and the test still passes (meaning that its use is useless). Regarding the 3dbars, it fails if we remove it but that happens because the -JZ and -BWSNEZ+b are used to plot and annotate the 3D cube. However, we can pass those instructions to the following psxyz module, where they make more sense.

Right, so the -Jz is useful if we want to draw and annotate a z axis but we will never(?) need it if we are not plotting any data that uses the 3rd dim, and in that case we can always control the z axis from that module. So, am I missing anything that prevents us to just remove -Jz from all flat modules?

makecpt -E still fails from external interfaces

julia> makecpt(rand(10,1), E="", C=:rainbow, Vd=1)
        makecpt  -Crainbow -E
makecpt [ERROR]: Syntax error -E option: Cannot decode value

The problem is that the #define THIS_MODULE_KEYS ">C},ED(,SD(,TD(" so the input file lands on the -E option and then the test

				Ctrl->E.active = true;
				if (opt->arg[0] && sscanf (opt->arg, "%d", &Ctrl->E.levels) != 1) {
					GMT_Report (GMT->parent, GMT_MSG_NORMAL, "Syntax error -E option: Cannot decode value\n");
					n_errors++;
				}

triggers the error (opt->arg holds the filename pointer). However, the (simple) solution is not to change the MODULE_KEYS and replace for example ED( by >D( because then it hangs, apparently waiting for the input file to come in.

Bug in Azimuthal Equidistant projection (-JE)

Description of the problem
When I run the code below:
(1)pscoast -JE-120/30/4.5i -Rg -Glightgray -B30/30 -Dc -A10000 -Wthinnest -P >test.ps
test
It seems all right, but if I change the Longitude and latitude of the projection center or use "-S", it will output a image with some area overlapped like below.
(2)pscoast -JE120/30/4.5i -Rg -Glightgray -B30/30 -Dc -A10000 -Wthinnest -P >test.ps
test
(3)pscoast -JE-120/30/4.5i -Rg -Glightgray -Slightblue -B30/30 -Dc -A10000 -Wthinnest -P >test.ps
test

I test this bug on macos 10.14 (homebrew version gmt 5.4.4) and ubuntu 16.04 (github master branch), it can be reproduced on both of them.
If I set the horizon to 179.9999, the output seems to be right.
(4)pscoast -JE-120/30/179.9999/4.5i -Rg -Glightgray -Slightblue -B30/30 -Dc -A10000 -Wthinnest -P >test.ps
test

System information

  • Operating system: ubuntu 16.04/macos mojave
  • Version of GMT: 6.0.0_93597c0/5.4.4

grdfft -Ns doesn't end quietly

Docs say that -Ns prints and exit, but it screams a bit before exiting.

grdfft lixo.grd -Ns
        "Good" numbers for FFT dimensions [Singleton, 1967]:
        64      72      75      80      81      90      96      100     108     120
        125     128     135     144     150     160     162     180     192     200
        216     225     240     243     250     256     270     288     300     320
        324     360     375     384     400     405     432     450     480     486
        500     512     540     576     600     625     640     648     675     720
        729     750     768     800     810     864     900     960     972     1000
        1024    1080    1125    1152    1200    1215    1250    1280    1296    1350
        1440    1458    1500    1536    1600    1620    1728    1800    1875    1920
        1944    2000    2025    2048    2160    2187    2250    2304    2400    2430
        2500    2560    2592    2700    2880    2916    3000    3072    3125    3200
        3240    3375    3456    3600    3645    3750    3840    3888    4000    4096
        4320    4374    4500    4608    4800    4860    5000
grdfft [ERROR]: Syntax error: Must specify at least one operation
grdfft [ERROR]: Syntax error -G option: Must specify output grid file

version5.4.3 PSXY could not plot vector arrows and pens in the desired colours

temp.txt
Description of the problem

In using the psxy from version 5.4.3 to plot a 2-D vector arrow map, the arrow and its pen (or tail) can not be set the desired colour at the same time using a CPT (colour) file. In my case, the arrows can be set the desired colours according to the CPT file, if using the plot command without additional colour specification in the flag -W

gmt psxy temp.txt -R-1.1/1.1/-1.5/1.5 -JX5c/7c -Sv0.15c+ea+p-+h0.4 -W0.85p -Ccolourbar.cpt -Baf -Bx+l"X / km" -By+l"Y / km" -BWSne -i0,1,2,3,4 -Vd -P > ${PS_FILE}

but the pens remain black, which is not what I want. If, however, the -W0.85p is modified as -W0.85p+cl, then the pens can be set the desired colours from the CPT file, but the arrows are missing in this case:

gmt psxy temp.txt -R-1.1/1.1/-1.5/1.5 -JX5c/7c -Sv0.15c+ea+p-+h0.4 -W0.85p+cl -Ccolourbar.cpt -Baf -Bx+l"X / km" -By+l"Y / km" -BWSne -i0,1,2,3,4 -Vd -P > ${PS_FILE}

This is not what I expect, according to the descriptions about -W for the programme psxy in the document http://gmt.soest.hawaii.edu/doc/5.4.4/psxy.html

Now I am not sure if there're some bugs in the psxy, or I misunderstood something. Any help would be useful !

Full script that generated the error

gmt makecpt -Crainbow -T-4.5/-1.4/0.2 -Z > colourbar.cpt

gmt psxy temp.txt -R-1.1/1.1/-1.5/1.5 -JX5c/7c  -Sv0.15c+ea+p-+h0.4 -W0.85p+cl -Ccolourbar.cpt  -Baf -Bx+l"X / km" -By+l"Y / km" -BWSne -i0,1,2,3,4 -Vd -P  > ${PS_FILE}

Full error message

psxy: History: Process -R-1.1/1.1/-1.5/1.5.
psxy: History: Process -JX5c/7c.
psxy: History: Process -Xa2.0c.
psxy: History: Process -Ya14.0c.
psxy: History: Process -Baf.
psxy: History: Process -Bx+lX / km.
psxy: History: Process -By+lY / km.
psxy: History: Process -BWSne.
psxy: Pen modifier found: cl
psxy: Processing input table data
psxy: GMT: 1. gmt_getsharepath trying current dir
psxy: Object ID 0 : Registered CPT File colourbar.cpt as an Input resource with geometry Non-Geographical [n_objects = 1]
psxy: api_begin_io: Input resource access is now enabled [container]
psxy: api_import_palette: Passed ID = 0 and mode = 0
psxy: Reading CPT from File colourbar.cpt
psxy: Reading CPT from colourbar.cpt
psxy: GMT_End_IO: Input resource access is now disabled
psxy: Operation will require 5 input columns [n_cols_start = 3]
psxy: Projected values in meters: -1.1 1.1 -1.5 1.5
psxy: Auto-frame interval for axis 0 item 0: d = 0.5  f = 0.1
psxy: Auto-frame interval for axis 1 item 0: d = 1  f = 0.2
psxy: Map scale is 0.00044 km per cm or 1:44.
psxy: GMT_Get_Family: Could not determine family
psxy: api_init_import: Passed family = Data Table and geometry = Point
psxy: Object ID 1 : Registered Data Table File temp.txt as an Input resource with geometry Point [n_objects = 2]
psxy (api_init_import): tried to free unallocated memory
psxy: api_init_import: Added 1 new sources
psxy: GMT_Init_IO: Returned first Input object ID = 1
psxy: GMT_Begin_IO: Initialize record-by-record access for Input
psxy: api_next_io_source: Selected object 1
psxy: Reading Data Table from file temp.txt
psxy: GMT_Begin_IO: Input resource access is now enabled [record-by-record]
psxy: GMT_End_IO: Input resource access is now disabled
psxy: Entering plot_map_gridlines
psxy: Exiting plot_map_gridlines
psxy (gmt_freepen): tried to free unallocated memory
psxy (gmt_freepen): tried to free unallocated memory
psxy: gmtapi_garbage_collection: Destroying object: C=0 A=0 ID=0 W=Input F=CPT M=File S=Used P=0 D=753da0 N=colourbar.cpt
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (support_free_range): tried to free unallocated memory
psxy (gmtlib_free_cpt_ptr): tried to free unallocated memory
psxy: GMTAPI_Garbage_Collection freed 1 memory objects
psxy: gmtapi_unregister_io: Unregistering object no 0 [n_objects = 1]
psxy: gmtapi_unregister_io: Unregistering object no 1 [n_objects = 0]
psxy (gmtlib_free_tmp_arrays): tried to free unallocated memory
gmt: Entering GMT_Destroy_Session

System information

  • Operating system: Ubuntu LTS 16.04
  • Version of GMT: 5.4.3

Modifier +s not working when the symbol code is given in the last column of the input

Description of the problem
According to the documentation, one can simply give x and y coordinates of start and end point when plotting vectors with +s modifier.

**+s** means the input *angle*, *length* are instead the *x*, *y*
coordinates of the vector end point.

Full script that generated the error

The following script plots two arrows, one with symbol code in the command line and the other one in the last column of the input.

gmt begin GMT_arrows png
echo 0.5 1.5 4.5 1.5 | gmt plot -R0/5/0/5 -Baf -JX1.75i -Sv0.2i+s+b+e -W1.5p -Gred
echo 0.5 3.5 4.5 3.5 v0.2i+s+b+e | gmt plot -R0/5/0/5 -Baf -JX1.75i -S -W1.5p -Gred
gmt end

Output figure:
gmt_arrows

System information

  • Operating system: macOS
  • Version of GMT: 6.0.0 c1a5c7c

pscoast ignores -R?

$ pscoast -M -W -R-25/34/57/81 | gmtinfo -I1
-R-30/40/50/84

pscoast does not seem to respect the given -R. Should not the reported -R from gmtinfo be exactly the same as was input to pscoast?

6.0.0_8c30e1e

x_min and y_min being a small float number instead of 0

Description of the problem

Some grid generated with GMT API (GMT_Create_Grid) with specifying wesn and xinc/yinc have very small numbers like ?.???e-16 instead of 0.

Also, some GMT commands will show reading beyond domain, e.g. grdblend, grdsample, grdimage, etc. I am not sure whether this is from the same issue. p.s. The grdimage error (reading beyond domain) will sometimes go away if a smaller region is give. The grdsample/grdblend error shows up when I am sampling the grid with it's own -R/-I option.

Full script that generated the error

PASTE CODE HERE

Out = GMT_Create_Data(API, GMT_IS_GRID, GMT_IS_SURFACE, GMT_GRID_ALL, NULL, wesn, inc, GMT_GRID_PIXEL_REG, 0, NULL)

gmt grdblend p1.grd p2.grd p3.grd p4.grd -R118.829166667/121.99375001/-3.56770833333/0.145486111111 -I0.0006944444445/0.0006944444445 -Gtmp.grd -Vd

Full error message

[cryosat:cases/palu4/blend] xix016% gmt grdblend p1.grd p2.grd p3.grd p4.grd -R118.829166667/121.99375001/-3.56770833333/0.145486111111 -I0.0006944444445/0.0006944444445 -Gtmp.grd -Vd
gmt: GMT->session.HOMEDIR = /Users/xix016
gmt: GMT->session.USERDIR = /Users/xix016/.gmt [created]
gmt: GMT->session.CACHEDIR = /Users/xix016/.gmt/cache [created]
gmt: GMT: 1. gmt_getsharepath trying current dir
gmt: GMT: 2. gmt_getsharepath trying USERDIR /Users/xix016/.gmt
gmt: GMT: 3. gmt_getsharepath trying USERDIR subdir /Users/xix016/.gmt/postscriptlight
gmt: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /opt/local/share/gmt/postscriptlight
gmt: Map distance calculation will be Cartesian
gmt: The PROJ_GEODESIC set to Vincenty
gmt: GMT_Create_Session initialized GMT structure
gmt: Shared Library # 0 (core). Path = libgmt.dylib
gmt: Loading core GMT shared library: libgmt.dylib
gmt: Loading GMT plugins from: /opt/local/lib/gmt/plugins
gmt: Shared Library # 1 (supplements). Path = /opt/local/lib/gmt/plugins/supplements.so
grdblend: History: Process -R118.829166667/121.99375001/-3.56770833333/0.145486111111.
grdblend: Grid is Cartesian
grdblend: Given domain implies x_inc = 0.000694444
grdblend: Given domain implies y_inc = 0.000694444
grdblend: Chosen boundary condition for all edges: natural
grdblend: Grid is Cartesian
grdblend: Object ID 0 : Registered GMT Grid Memory Reference 7f99d4c09d40 as an Input resource with geometry Surface [n_objects = 1]
grdblend: Successfully created a new GMT Grid container
grdblend: Processing input grids
grdblend: Object ID 1 : Registered GMT Grid File p1.grd as an Input resource with geometry Surface [n_objects = 2]
grdblend: api_begin_io: Input resource access is now enabled [container]
grdblend: api_import_grid: Passed ID = 1 and mode = 33
grdblend: Geographic grid, longitudes span less than 360
grdblend: GMT_End_IO: Input resource access is now disabled
grdblend: File p1.grd coordinates are phase-shifted w.r.t. the output grid - must resample
grdblend: Resample p1.grd via grdsample p1.grd -R120.611111117/121.99375001/-3.56770833333/-0.228819444444 -G/var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc -Vd -fg --GMT_HISTORY=false
grdblend (gmtlib_free_tmp_arrays): tried to free unallocated memory
grdsample: History: Process -R120.611111117/121.99375001/-3.56770833333/-0.228819444444.
grdsample: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdsample: Processing input grid
grdsample: Object ID 2 : Registered GMT Grid File p1.grd as an Input resource with geometry Surface [n_objects = 3]
grdsample: api_begin_io: Input resource access is now enabled [container]
grdsample: api_import_grid: Passed ID = 2 and mode = 1
grdsample: Geographic grid, longitudes span less than 360
grdsample: GMT_End_IO: Input resource access is now disabled
grdsample: Grid/Image dimensions imply w/e/s/n = 120.611/121.994/-3.56771/-0.228819, inc = 0.000694444/0.000694444, pixel registration, n_layers = 1
grdsample: Geographic grid, longitudes span less than 360
grdsample: Given domain implies x_inc = 0.000694444
grdsample: Given domain implies y_inc = 0.000694444
grdsample: Chosen boundary condition for all edges: geographic
grdsample: Geographic grid, longitudes span less than 360
grdsample: Object ID 3 : Registered GMT Grid Memory Reference 7f99d4f00d30 as an Input resource with geometry Surface [n_objects = 4]
grdsample: Successfully created a new GMT Grid container
grdsample: Input grid (120.611111121/122.00000001/-3.56944444444/-0.229166666666) n_columns = 2000 n_rows = 4810 dx = 0.0006944444445 dy = 0.000694444444443 registration = 1
grdsample: Output grid (120.611111117/121.99375001/-3.56770833333/-0.228819444444) n_columns = 1991 n_rows = 4808 dx = 0.000694444446509 dy = 0.000694444444444 registration = 1
grdsample: api_begin_io: Input resource access is now enabled [container]
grdsample: api_import_grid: Passed ID = 2 and mode = 2
grdsample: Warning: Region exceeds grid domain. Region reduced to grid domain.
grdsample: Warning: (s - y_min) must equal (NY + eps) * y_inc), where NY is an integer and |eps| <= 0.0001.
grdsample: Warning: s reset from -3.56770833333 to -3.56805555555
grdsample: Reading grid from file p1.grd
grdsample: processing at most 32 (32x1) chunks at a time (31.1 MiB)...
grdsample: packed z-range: [-3.1411,3.14119]
grdsample: Geographic grid, longitudes span less than 360
grdsample: Chosen boundary condition for left edge: geographic
grdsample: Chosen boundary condition for right edge: extended data
grdsample: Chosen boundary condition for bottom edge: extended data
grdsample: Chosen boundary condition for top edge: geographic
grdsample: Set boundary condition for left edge: natural
grdsample: Set boundary condition for top edge: natural
grdsample: GMT_End_IO: Input resource access is now disabled
grdsample: Warning: Output sampling interval in y exceeds input interval and may lead to aliasing.
grdsample: Output grid extrema [-3.9113/3.91023] exceeds extrema of input grid [-3.1411/3.14119]; to clip output use -n...+c
grdsample: Object ID 4 : Registered GMT Grid File /var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc as an Output resource with geometry Surface [n_objects = 5]
grdsample: api_begin_io: Output resource access is now enabled [container]
grdsample: api_export_grid: Passed ID = 4 and mode = 0
grdsample: Writing grid to file /var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc
grdsample: region: 0 0, grid: 120.611 121.994
grdsample: -> region: 120.611 121.994, grid: 120.611 121.994
grdsample: row: 0 4807, col: 0 1990
grdsample: netCDF Library version: 4
grdsample: processing at most 480 (32x15) chunks at a time (31.6 MiB)...
grdsample: packed z-range: [-3.9113,3.91023]
grdsample: GMT_End_IO: Output resource access is now disabled
grdsample: gmtapi_garbage_collection: Destroying object: C=0 A=0 ID=2 W=Input F=GMT Grid M=File S=Used P=7f99d4f00cf0 D=7f99d4f00cf0 N=p1.grd
grdsample: gmtapi_garbage_collection: Destroying object: C=0 A=0 ID=3 W=Input F=GMT Grid M=Memory Reference S=Unused P=7f99d4f00d30 D=7f99d4f00d30 N=(null)
grdsample: GMTAPI_Garbage_Collection freed 2 memory objects
grdsample: gmtapi_unregister_io: Unregistering object no 2 [n_objects = 4]
grdsample: gmtapi_unregister_io: Unregistering object no 3 [n_objects = 3]
grdsample: gmtapi_unregister_io: Unregistering object no 4 [n_objects = 2]
grdsample (gmtlib_free_tmp_arrays): tried to free unallocated memory
grdblend (gmtapi_close_grd): tried to free unallocated memory
grdblend: GMT_Destroy_Data: freed memory for a GMT Grid for object 1
grdblend: gmtapi_unregister_io: Unregistering object no 1 [n_objects = 1]
grdblend: gmtapi_unregister_io: Object no 1 has non-NULL data pointer
grdblend: Object ID 5 : Registered GMT Grid File /var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc as an Input resource with geometry Surface [n_objects = 2]
grdblend: api_begin_io: Input resource access is now enabled [container]
grdblend: api_import_grid: Passed ID = 5 and mode = 33
grdblend (gmtlib_nc_get_att_text): tried to free unallocated memory
grdblend (gmtlib_nc_get_att_text): tried to free unallocated memory
grdblend: Round-off patrol changed grid limit for ymin from -3.567708333330247 to -3.567708333330247
grdblend: Round-off patrol changed grid limit for ymax from -0.2288194444442465 to -0.2288194444442465
grdblend: Geographic grid, longitudes span less than 360
grdblend: GMT_End_IO: Input resource access is now disabled
grdblend: Grid /var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc: out: 2566/4556/5346/539 in: 2565/4567/5350/538 skip: 0 offset: 0
grdblend: Blend file /var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_0.nc in 120.611/122/-3.56944/-0.229167 with normal weight 1 [539-5346]
grdblend (gmtapi_close_grd): tried to free unallocated memory
grdblend: GMT_Destroy_Data: freed memory for a GMT Grid for object 5
grdblend: gmtapi_unregister_io: Unregistering object no 5 [n_objects = 1]
grdblend: gmtapi_unregister_io: Object no 5 has non-NULL data pointer
grdblend: Object ID 6 : Registered GMT Grid File p2.grd as an Input resource with geometry Surface [n_objects = 2]
grdblend: api_begin_io: Input resource access is now enabled [container]
grdblend: api_import_grid: Passed ID = 6 and mode = 33
grdblend: Geographic grid, longitudes span less than 360
grdblend: GMT_End_IO: Input resource access is now disabled
grdblend: File p2.grd coordinates are phase-shifted w.r.t. the output grid - must resample
grdblend: Resample p2.grd via grdsample p2.grd -R120.041666671/121.319444452/-3.43090277777/-0.111458333333 -G/var/folders/47/bjcllxpd16g8jhrqwl6121xw00019g/T//grdblend_resampled_6157_1.nc -Vd -fg --GMT_HISTORY=false
grdblend (gmtlib_free_tmp_arrays): tried to free unallocated memory
grdsample: History: Process -R120.041666671/121.319444452/-3.43090277777/-0.111458333333.
grdsample: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdsample: Processing input grid
grdsample: Object ID 7 : Registered GMT Grid File p2.grd as an Input resource with geometry Surface [n_objects = 3]
grdsample: api_begin_io: Input resource access is now enabled [container]
grdsample: api_import_grid: Passed ID = 7 and mode = 1
grdsample: Geographic grid, longitudes span less than 360
grdsample: GMT_End_IO: Input resource access is now disabled
grdsample: Grid/Image dimensions imply w/e/s/n = 120.042/121.319/-3.4309/-0.111458, inc = 0.000694444/0.000694444, pixel registration, n_layers = 1
grdsample: Geographic grid, longitudes span less than 360
grdsample: Given domain implies x_inc = 0.000694444
grdsample: Given domain implies y_inc = 0.000694444
grdsample: Chosen boundary condition for all edges: geographic
grdsample: Geographic grid, longitudes span less than 360
grdsample: Object ID 8 : Registered GMT Grid Memory Reference 7f99d4e00030 as an Input resource with geometry Surface [n_objects = 4]
grdsample: Successfully created a new GMT Grid container
grdsample: Input grid (120.041666667/121.319444444/-3.43055555556/-0.111111111111) n_columns = 1840 n_rows = 4780 dx = 0.000694444444022 dy = 0.000694444444445 registration = 1
grdsample: Output grid (120.041666671/121.319444452/-3.43090277777/-0.111458333333) n_columns = 1840 n_rows = 4780 dx = 0.000694444446196 dy = 0.000694444444443 registration = 1
grdsample: api_begin_io: Input resource access is now enabled [container]
grdsample: api_import_grid: Passed ID = 7 and mode = 2
grdsample: Warning: Region exceeds grid domain. Region reduced to grid domain.
grdsample: Warning: (n - y_min) must equal (NY + eps) * y_inc), where NY is an integer and |eps| <= 0.0001.
grdsample: Warning: n reset from -0.111458333333 to -0.111111111111
grdsample: Reading grid from file p2.grd
grdsample (gmt_nc_read_grd): Tried to read beyond grid domain [p2.grd]

PASTE ERROR MESSAGE HERE

System information

  • Operating system:
  • Version of GMT:

5.4.4

Man descriptions too cryptic or incomplete

spectrum1d -T
   Disable the writing of a single composite results file to stdout. 
grdimage -G[f|b]color
    This option only applies when the resulting image otherwise would consist of only two colors:
grd2kml -N
    ...Also note that (sentence stops here)
gmt2kml -E[altitude]
    Extrude feature down to ground level [no extrusion]. 

   e.g. no reference to what altitude is

grdraster problem in 5.4.4, where is grdraster in GMT 6?

The MB-System program mbgrid has a longstanding capability to underlay a bathymetry or topography grid with a global or regional topography model extracted using grdraster. With GMT 5.4.4 this capability is broken.

The problem is that grdraster is requiring the -Iincrement option when it used to use the increment defined in the source global model by default. For instance, the command

% grdraster 28 -R-13.775815/-13.702018/53.549101/53.588000 -Gtmpgrdraster11839.grd

just yields the error message:

grdraster: No increment given and no -I in effect.  Cannot initialize new grid

I tried to see if this is still an issue in the current code. However, when I cloned gmt-master, I no longer find grdraster defined anywhere in the codebase. Am I missing something, or is grdraster disappearing?

I'm working on MacOs 10.13.06.

Streamline the module usage for classic and modern mode

When running in modern mode, all modules require an option to report the module's usage. This is typically one of -?, -^, -+, -, or +. Otherwise they will attempt to run even if not given any options (this may lead to errors depending on the situation). In classic mode most modules will report their usage if given no options, but a few will instead expect to run and wait for input.

To enforce the modern mode behavior across all module while retaining the existing classic behavior under classic mode I have introduced a new library function gmt_report_usage. I have implemented it i the few functions that are a git different. In the remaining modules all that needs to be done is to replace the two lines

if (!options || options->option == GMT_OPT_USAGE) bailout (usage (API, GMT_USAGE));	/* Return the usage message */
if (options->option == GMT_OPT_SYNOPSIS) bailout (usage (API, GMT_SYNOPSIS));	/* Return the synopsis */

with the new line

if ((error = gmt_report_usage (API, options, 0, usage)) != GMT_NOERROR) bailout (error);	/* Give usage if requested */

It would be great to get some help on doing this to the ~130+ modules remaining. PS. If the two lines in a module differ in any way from the above then best to let me have a look.

Remove SVN completely

Following files still contain SVN or svn, which should be removed completely. The file list is updated on Jan 29, 2019.

  • cmake/dist/CMakeLists.txt
  • cmake/dist/Info.plist.in
  • cmake/modules/ConfigCMake.cmake
  • doc/examples/gmtest.in
  • doc/rst/conf.py.in
  • doc/scripts/gmtest.in
  • share/VERSION.in
  • src/config.h.in
  • src/gmt-config.in
  • src/gmt.c
  • src/gmt_init.c
  • src/gmt_version.h.in
  • test/gmtest.in

pi gets crazzy

psbasemap -JX12c/8c -Bpa1pi2 -Ba -BWS -R0/14/-1/1 -P > lixo.ps
lixo

Allow gmtget DIR_GSHHG work with limited resolution coastlines

Description of the problem

With the Fedora GMT packages, we package the higher resolution coastline data separately so users who don't want install the higher resolutions can.

But this isn't working, see https://bugzilla.redhat.com/show_bug.cgi?id=1545256

# gmt gmtget DIR_GSHHG
gmtget: Found /usr/share/gshhg-gmt-nc4/binned_GSHHS_f.cdf but cannot read it due to wrong permissions
gmtget: GSHHG version 2.2.0 or newer is needed to use coastlines with GMT.
        Get and install GSHHG from ftp://ftp.soest.hawaii.edu/gshhg/.
gmtget: Found /usr/share/gshhg-gmt-nc4/binned_river_f.cdf but cannot read it due to wrong permissions
gmtget: Found /usr/share/gshhg-gmt-nc4/binned_border_f.cdf but cannot read it due to wrong permissions

Also, I have to manually install a /usr/share/gmt/coast/coastline.conf file. I think this is because during the GMT build, we are using the separately installed coastlines so it isn't installing them.

System information

  • Operating system: Fedora
  • Version of GMT: 5.4.4

Pspolar not showing polarity symbols.

Description of the problem
I am currently trying to plot polarity symbols with pspolar. I have checked that my input file is the correct format. Here is an example:

FLYN 73.08 104.71 u
HSNT 86.96 97.41 u
MTCH 81.97 96.36 u
PLMP 88.97 98.98 u

When running psplot, if I use the -T flag, the stations show up just fine, so I am not sure what could be preventing the symbols (in my case circles; -Sc 0.4) from showing up. I have tried different symbol sizes as well as different fill colours for the symbols.

-Jesse

Full error message
Unfortunately, there was no error message.
System information

  • Operating system: OSX High Sierra
  • Version of GMT: 5.4.4 (Homebrew install)

Printing hash number in version is nearly useless

The 58c1d0d in

C:\progs_cygw\GMTdev\gmt5\master>gmt --version
6.0.0_58c1d0d

is nearly useless. Much more interesting would be to have the date of last commit used when building GMT. Googling around I found that this would it

C:\progs_cygw\GMTdev\gmt5\master>git describe --always | git show -s --format=%cd --date=short
2018-09-08

but unfortunately when I add it to ...\cmake\modules\ConfigCMake.cmake

	# Get the location, inside the staging area location, to copy the application bundle to.
	execute_process (
		COMMAND git describe --abbrev=7 --always | git show -s --format=%cd --date=short

it wont work.

sh: 1: movie_preflight.sh: not found when trying to make movie

I copied the script from http://gmt.soest.hawaii.edu/doc/latest/gallery/anim01.html and executed it. This is the output:

$ ./animation1.sh 
sh: 1: movie_preflight.sh: not found
movie [ERROR]: Running preflight script movie_preflight.sh returned error 32512 - exiting.

Full script that generated the error
The code bellow is the one copied from the gallery. It produces other files which are attached to this report. animation1.zip

#!/bin/bash
#               GMT ANIMATION 01
#
# Purpose:      Make web page with simple animated GIF of sine function
# GMT modules:  gmtmath, psbasemap, pstext, psxy, movie
# Unix progs:   echo, convert, cat
# Note:         Run with any argument to build movie; otherwise 1st frame is plotted only.

if [ $# -eq 0 ]; then	# Just make master PostScript frame 0
	opt="-Mps -Fnone"
	ps=anim_01.ps
else	# Make animated GIF
	opt="-A+l"
fi	
# 1. Create files needed in the loop
cat << EOF > pre.sh
gmt math -T0/360/20 T SIND = sin_point.txt
gmt math -T0/360/2 T SIND = sin_curve.txt
gmt begin
	gmt psbasemap -R0/360/-1.2/1.6 -JX3.5i/1.65i -X0.35i -Y0.25i \
	-BWSne+glightgreen -Bxa90g90f30+u'\232' -Bya0.5f0.1g1 --FONT_ANNOT_PRIMARY=9p
gmt end
EOF
# 2. Set up the main frame script
cat << EOF > main.sh
gmt begin
#	Plot smooth blue curve and dark red dots at all angle steps so far
	last=\`gmt math -Q \${MOVIE_FRAME} 10 MUL =\`
	gmt convert sin_curve.txt -Z0:\${last} | gmt psxy -W1p,blue -R0/360/-1.2/1.6 -JX3.5i/1.65i -X0.35i -Y0.25i
	gmt convert sin_point.txt -Z0:\${MOVIE_FRAME} | gmt psxy -Sc0.1i -Gdarkred
#	Plot bright red dot at current angle and annotate
	gmt psxy -Sc0.1i -Gred <<< "\${MOVIE_COL1} \${MOVIE_COL2}"
	printf "0 1.6 a = %3.3d" \${MOVIE_COL1} | gmt pstext -F+f14p,Helvetica-Bold+jTL -N -Dj0.1i/0.05i
gmt end
EOF
# 3. Run the movie
gmt movie main.sh -Sbpre.sh -C4ix2ix125 -Tsin_point.txt -Z -Nanim_01 -D5 $opt

Directory tree of the script and generated files.

/animation1$ du -a
4	./main.sh
4	./pre.sh
4	./animation1.sh
4	./anim_01/movie_init.sh
4	./anim_01/movie_preflight.sh
12	./anim_01
28	.

Full error message

$ gmt movie main.sh -Sbpre.sh -C4ix2ix125 -Tsin_point.txt -Z -Nanim_01 -D5 -A+l -Vd
gmt [DEBUG]: Obtained the ppid from parent: 19240
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /usr/local/share
gmt [DEBUG]: GMT->session.HOMEDIR = /home/ricardo
gmt [DEBUG]: GMT->session.USERDIR = /home/ricardo/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /home/ricardo/.gmt/cache [created]
gmt [DEBUG]: GMT: 0. Will try to fine subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt
gmt [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
gmt [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR /home/ricardo/.gmt
gmt [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir /home/ricardo/.gmt/postscriptlight
gmt [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /usr/local/share/postscriptlight
gmt [DEBUG]: GMT: 5. gmt_getsharepath failed
gmt [DEBUG]: Map distance calculation will be Cartesian
gmt [DEBUG]: Exit:  gmtinit_new_GMT_ctrl
gmt [DEBUG]: Enter: New_PSL_Ctrl
gmt [DEBUG]: Exit:  New_PSL_Ctrl
gmt [DEBUG]: Enter: gmt_manage_workflow
gmt [DEBUG]: Exit : gmt_manage_workflow
gmt [DEBUG]: Enter: PSL_beginsession
gmt [DEBUG]: Exit : PSL_beginsession
gmt [DEBUG]: Enter: PSL_setdefaults
gmt [DEBUG]: Exit : PSL_setdefaults
gmt [DEBUG]: Enter: gmtlib_io_init
gmt [DEBUG]: Exit : gmtlib_io_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: Enter: gmt_getdefaults
gmt [DEBUG]: Exit:  gmt_getdefaults
gmt [DEBUG]: Enter: gmtlib_plot_C_format
gmt [DEBUG]: Exit:  gmtlib_plot_C_format
gmt [DEBUG]: Enter: gmtinit_get_history
gmt [DEBUG]: Initialize FFTW with 4 threads.
gmt [DEBUG]: GMT_Create_Session initialized GMT structure
gmt [DEBUG]: Shared Library # 0 (core). Path = libgmt.so
gmt [DEBUG]: Loading core GMT shared library: libgmt.so
gmt [DEBUG]: Loading GMT plugins from: /usr/local/lib/gmt/plugins
gmt [DEBUG]: Shared Library # 1 (supplements). Path = /usr/local/lib/gmt/plugins/supplements.so
movie [INFORMATION]: Paper dimensions: Width = 4i Height = 2i
movie [INFORMATION]: Pixel dimensions: 500 x 250
sh: 1: movie_preflight.sh: not found
movie [ERROR]: Running preflight script movie_preflight.sh returned error 32512 - exiting.
movie (gmtlib_free_tmp_arrays): tried to free unallocated memory
gmt [DEBUG]: Entering GMT_Destroy_Session

System information

  • Operating system: Ubuntu 16.04.3
  • Version of GMT: 6.0.0_6751863

gmt movie - ERROR: No module named movie was found.

I'm trying to run the examples for animations at http://gmt.soest.hawaii.edu/doc/latest/Gallery.html however, I receive this error message:

ERROR: No module named movie was found. This could mean one of three cases:

  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
    Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

I'm running gmt 5.4.4 on Ubuntu 16.04.3. I've just downloaded it today and built it along dcw and gshhg. I can see many other modules, but not the movie module.

$ gmt --show-modules
blockmean
blockmedian
blockmode
filter1d
fitcircle
gmt2kml
gmtconnect
gmtconvert
gmtdefaults
gmtget
gmtinfo
gmtlogo
gmtmath
gmtregress
gmtselect
gmtset
gmtsimplify
gmtspatial
gmtvector
gmtwhich
grd2cpt
grd2rgb
grd2xyz
grdblend
grdclip
grdcontour
grdconvert
grdcut
grdedit
grdfft
grdfill
grdfilter
grdgradient
grdhisteq
grdimage
grdinfo
grdlandmask
grdmask
grdmath
grdpaste
grdproject
grdraster
grdsample
grdtrack
grdtrend
grdvector
grdview
grdvolume
greenspline
kml2gmt
makecpt
mapproject
nearneighbor
project
psbasemap
psclip
pscoast
pscontour
psconvert
pshistogram
psimage
pslegend
psmask
psrose
psscale
pssolar
psternary
pstext
pswiggle
psxyz
psxy
sample1d
spectrum1d
sph2grd
sphdistance
sphinterpolate
sphtriangulate
splitxyz
surface
trend1d
trend2d
triangulate
xyz2grd
gshhg
img2grd
pscoupe
psmeca
pspolar
pssac
psvelo
mgd77convert
mgd77header
mgd77info
mgd77list
mgd77magref
mgd77manage
mgd77path
mgd77sniffer
mgd77track
dimfilter
gmtflexure
gmtgravmag3d
gpsgridder
gravfft
grdflexure
grdgravmag3d
grdredpol
grdseamount
talwani2d
talwani3d
pssegyz
pssegy
segy2grd
backtracker
gmtpmodeler
grdpmodeler
grdrotater
grdspotter
hotspotter
originator
rotconverter
rotsmoother
x2sys_binlist
x2sys_cross
x2sys_datalist
x2sys_get
x2sys_init
x2sys_list
x2sys_merge
x2sys_put
x2sys_report
x2sys_solve

Make it work: pscontour -Ccolor1,color2 -I

echo 1 2 3 | pscontour -JX12c/0 -Ba -R-3/3/-3/3 -Cred,green,blue -A2 -I -P -K > lixo.ps
pscontour [ERROR]: Syntax error -I option: Must specify a color palette table via -C

Regardless the non-sense of the above command, the refusing attitude is real. A command like this works only when the color info was passed via a file -Ccolor.cpt but not when we pass colors like the example. Did not check the code but there should be no reason why all forms of passing the color info will not work.

psmeca dump option

When you are using psmeca with -Sa flag (Aki and Richards convention where you specify only one fault plane), write out results of the auxiliary plane and P and T axes. These are already plotted but there is no option for outputing them.

pscoast -E gets confused by -R

Works

pscoast -JX12c/0 -Ba -EAR+p0.25p+gblue -P -K > lixo.ps

but not if we set -R manually

pscoast  -R-80/-50/-55/-20 -JX12c/0 -Ba -EAR+p0.25p+gblue -P -K > lixo.ps
pscoast [ERROR]: You must use a map projection or -Jx|X...d[/...d] for geographic data

Create a gitter chatroom

Before we find a better replacement of the forum, maybe we should create a gitter chatroom where people can ask questions.

IMHO, github issue should be used to track issues only, not for asking questions.

A few compiler warnings to get rid of

gmt/trunk/src/gmt_init.c: In function 'gmt_auto_offsets_for_colorbar':
gmt/trunk/src/gmt_init.c:15170:8: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
  fgets (file, PATH_MAX, fp); fclose (fp); /* Recycle file to hold the -B arguments */
        ^
In file included from /usr/include/string.h:640:0,
                 from gmt/trunk/src/gmt_dev.h:108,
                 from gmt/trunk/src/movie.c:35:
In function 'strncat',
    inlined from 'GMT_movie' at gmt/trunk/src/movie.c:1375:12:
/usr/include/x86_64-linux-gnu/bits/string3.h:150:3: warning: call to __builtin___strncat_chk might overflow destination buffer [enabled by default]
   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
   ^
gmt/trunk/src/psconvert.c: In function 'pipe_HR_BB':
gmt/trunk/src/psconvert.c:1034:9: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
   write (H->fd[1], PS->data, PS->n_bytes);
         ^
gmt/trunk/src/psconvert.c: In function 'pipe_ghost':
gmt/trunk/src/psconvert.c:1227:10: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
    write (H->fd[1], PS->data, PS->n_bytes);
          ^

Add a contributing guide

If we have a file called CONTRIBUTING.md in the repository root, Github will know what it is and will mention it when people open issues or pull requests. It should contain basic information about cloning the repository, building the code, writing a test, writing an example for the docs, etc. We can start with something derived from the GMT/Python guide and expand it over time.

Sort and separate the tests scripts

GMT has a lot of test scripts that create and compare plots. What we don't have is a measure of how many modules these tests call and how much of the code is covered. The tests also take a long time to run so they're not good for running on TravisCI (we don't want to wait 40min for a build to finish).

Quoting @PaulWessel s email:

See plot of test durations (log-scale in seconds). So most are around a few seconds (1-10) with a few slow ones (70 s); this is on my laptop. I also attach the sorted list (time, test). Before I do anything else we can talk about what might be useful? Make a plot of “coverage” somehow, meaning how many times any gmt module is called within the 812 tests? I think we wanted a very basic set that at least ran all modules once on a minimal data set.

test-time-distribution
Distribution of test times.

Here is a file with the timing information for each test script: test_sorted.txt

Raise a warning instead a error when requesting a PS file in modern mode

Full script that generated the error

gmt begin map ps
gmt basemap -R0/10/0/10 -JX5c -Bafg
gmt end

Full error message

psbasemap [ERROR]: Must specify a paper size when requesting a PostScript file
psbasemap [ERROR]: Changing paper size to A4, but we cannot know if this is adequate for your plot.

The script can generate the desired plot correctly. So I think it would be better to raise warnings instead of errors and tell users to change PS_MEDIA if A4 paper size isn't adequate for their plot.

Rename README.Cmake

Currently, there are two README files in the repo: README.md and README.Cmake. GitHub display the content of README.Cmake at the homepage of the repo. However, README.Cmake is too technical, and README.md is more useful for potential new users.

IMHO we should rename README.Cmake to make GitHub display README.md instead.

Shrinking vector heads need to go with shrinking vector stem

In GMT 4 the vector was a single polygon so when we shrunk it down (via +n) then everything shrunk automatically. In GMT 5 the head is a separate polygon and the stem is a line. Now, +n shrinks the head but we forgot to shrink the pen width of the stem. Probably something that @PaulWessel should fix...

grdcontour -N is still not fixed

If one set the cpt via -N

grdcontour lixo.grd -Nlixo.cpt -P -JX10 > lixo.ps
grdview [ERROR]: Syntax error: Must specify color palette table
unknown [ERROR]: Failed to call grdview

and from external interfaces neither -C or -N work

julia> grdcontour(G, color=cpt, show=1, N=true,  Vd=1)
        grdcontour  -JX12c/0 -C -N -P -K > C:\tmp\GMTjl_tmp.ps
GMT [ERROR]: CPT api_colors2cpt_16176.cpt has no z-slices!

apparently because in this case at the call

if ((P = GMT_Read_Data (API, GMT_IS_PALETTE, GMT_IS_FILE, GMT_IS_NONE, GMT_READ_NORMAL, NULL, cptfile, NULL)) == NULL) {

cptfile is an empty string.

Combine documentations of classic and modern modes into one documentation

Currently, GMT has two separated documentations for classic mode and modern mode. The modern mode docs are almost the same as the classic ones. The only exceptions are some options (e.g. -K -O -P), some new modules (e.g. begin, end, subplot), and some scripts. Currently, we need to maintain these two documentations simultaneously (e.g. #170), which is very inconvenient.

I'm wondering if we can combine these two docs into one single document, and use only directive to include mode-specific descriptions and scripts. The rst source file may look like this:

Description and scripts applied to both classic mode and modern mode.

.. only:: modern
    Description and scripts applied to modern mode only.

.. only:: classic 
    Description and scripts applied to classis mode only.

Then we can use sphinx-build -b html -t modern ... and sphinx-build -b html -t classic ... to generate docs for modern mode and classic mode, respectively.

Adapt the README to Github style

Currently, the README isn't designed to be a landing page for the repository. We would need to convert it to markdown, rename it to README.md and possibly include some more information.

Modern mode: specify paper size and not cropping the figure

In modern mode, figures are by default cropped to the minimum required by the image contents, using psconvert -A.

Sometimes, we may want to plot a figure on A4 paper for printing. In this case, we need to specify paper size and set psconvert to not crop the figure.

This is what I try:

gmt begin map png
gmt set PS_MEDIA=A4 PS_CONVERT=""
gmt basemap -R0/10/0/10 -JX10c -Bafg 
gmt end

map
However, you'll see that the right part of the figure is missing. It seems that the origins for the plot are somehow in the middle of the paper, different from the behavior in classic mode. Is it desired or a bug?

-Bwesn alone does nothing

Not sure this should not classify as a bug. Let's say I want to plot the four axes but no annotations, not ticks, than this should do it

psbasemap -JX12c/0 -Bwesn -R1/10/1/10 -P > lixo.ps

but not. It plots nothing. To plot the axes only and no fiddling with the tick lengths I have to cheat it a bit, asking for annotations that are outside the -R range.

psbasemap -JX12c/0 -Ba100 -Bwesn -R1/10/1/10 -P > lixo.ps

nearneighbor search radius unit ignored

If not given, the default nearneighbor search radius unit is in meter (http://gmt.soest.hawaii.edu/doc/latest/nearneighbor.html). Specifying the unit (e) makes nearneighbor think its dealing with geographic data. Both cases should be in cartesian data.

nearneighbor -I.2 dat -S20e -R0/100/0/100 -Vd -Gwith_e_debug.nc

outputs

...
nearneighbor [INFORMATION]: Your distance unit (e) implies geographic data; -fg has been set.
...

The diff between the two commands nearneighbor -I.2 dat -S20e -R0/100/0/100 -Vd -Gwith_e_debug.nc and nearneighbor -I.2 dat -S20e -R0/100/0/100 -Vd -Gwith_e_debug.nc (one with the UNIT specified and the other not) gives

$ bash nearneighbor_unit.sh
45,51c45,49
< nearneighbor [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
< nearneighbor [INFORMATION]: Your distance unit (e) implies geographic data; -fg has been set.
< nearneighbor [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
< nearneighbor [DEBUG]: Geographic input grid, longitudes span less than 360
< nearneighbor [DEBUG]: Chosen boundary condition for all edges: geographic
< nearneighbor [DEBUG]: Geographic input grid, longitudes span less than 360
< nearneighbor [DEBUG]: Object ID 0 : Registered Grid Memory Reference 194c3f0 as an Input resource with geometry Surface [n_objects = 1]
---
> nearneighbor [DEBUG]: Map distance calculation will be Cartesian
> nearneighbor [INFORMATION]: Cartesian input grid
> nearneighbor [DEBUG]: Chosen boundary condition for all edges: natural
> nearneighbor [INFORMATION]: Cartesian input grid
> nearneighbor [DEBUG]: Object ID 0 : Registered Grid Memory Reference 12fd3f0 as an Input resource with geometry Surface [n_objects = 1]
60c58
< nearneighbor [INFORMATION]: Max node-search half-widths are: half_x = 1, half_y = 251
---
> nearneighbor [INFORMATION]: Max node-search half-widths are: half_x = 100, half_y = 100
70c68
< nearneighbor [INFORMATION]: Processed record       1599
---
> nearneighbor [INFORMATION]: Processed record       1786
73c71
< nearneighbor [DEBUG]: Object ID 2 : Registered Grid File with_e_debug.nc as an Output resource with geometry Surface [n_objects = 3]
---
> nearneighbor [DEBUG]: Object ID 2 : Registered Grid File without_e_debug.nc as an Output resource with geometry Surface [n_objects = 3]
76c74
< nearneighbor [INFORMATION]: Writing grid to file with_e_debug.nc
---
> nearneighbor [INFORMATION]: Writing grid to file without_e_debug.nc
81c79
< nearneighbor [INFORMATION]: No valid values in grid [with_e_debug.nc]
---
> nearneighbor [DEBUG]: packed z-range: [0,9.78769]
83,85c81,83
< nearneighbor [INFORMATION]: 0 nodes were assigned an average value
< nearneighbor [INFORMATION]: 2452 nodes failed sector criteria and 248549 nodes had no neighbor points (all set to NaN)
< nearneighbor [DEBUG]: gmtapi_garbage_collection: Destroying object: C=0 A=0 ID=0 W=Input F=Grid M=Memory Reference S=Unused P=194c3f0 N=(null)
---
> nearneighbor [INFORMATION]: 247350 nodes were assigned an average value
> nearneighbor [INFORMATION]: 3651 nodes failed sector criteria and 0 nodes had no neighbor points (all set to NaN)
> nearneighbor [DEBUG]: gmtapi_garbage_collection: Destroying object: C=0 A=0 ID=0 W=Input F=Grid M=Memory Reference S=Unused P=12fd3f0 N=(null)

Script to produce the diff with included dummy_data.txt:

nearneighbor -I.2 dummy_data.txt -S20e -R0/100/0/100 -Vd -Gwith_e_debug.nc 2> with_e_debug.log
nearneighbor -I.2 dummy_data.txt -S20 -R0/100/0/100 -Vd -Gwithout_e_debug.nc 2> without_e_debug.log
diff with_e_debug.log without_e_debug.log

rm with_e_debug.log without_e_debug.log with_e_debug.nc without_e_debug.nc

gmt clear history 
  • Version of GMT: 6.0.0_821bce2

grd2kml gets problem with -R when used with certain country codes

$ grdcut @earth_relief_10m.grd -RNO,SE,DK,GE,RU -Gtopo.grd
$ grd2kml -Ntest3 topo.grd
grdimage [ERROR]: Syntax error -R option. Correct syntax:
        -R<xmin>/<xmax>/<ymin>/<ymax>[/<zmin>/<zmax>]
          Append r if giving lower left and upper right coordinates
        -Rg or -Rd for global domain
        -R<grdfile> to take the domain from a grid file
grdimage [ERROR]: Offending option -R-9:20/-28:00/40:40/90:00
psconvert [ERROR]: Error for input file: No such file (grd2kml_tile_tmp_197385.ps)
grd2kml [ERROR]: Unable to rasterize current PNG tile!

and another example

$ grdcut @earth_relief_10m.grd -RNO,SE,DK,GE,US -Gtopo.grd
$ grd2kml -Ntest3 topo.grd
grdimage [ERROR]: Syntax error -R option. Correct syntax:
        -R<xmin>/<xmax>/<ymin>/<ymax>[/<zmin>/<zmax>]
          Append r if giving lower left and upper right coordinates
        -Rg or -Rd for global domain
        -R<grdfile> to take the domain from a grid file
grdimage [ERROR]: Offending option -R172:00/153:20/18:40/90:00
psconvert [ERROR]: Error for input file: No such file (grd2kml_tile_tmp_197416.ps)
grd2kml [ERROR]: Unable to rasterize current PNG tile!

Using 6.0.0_e7aff1f.

Use country code instead of coordinate pairs

What about adding a switch that enables e.g. psxy or psxtext to be able to translate country codes (DCW) to centroid coordinates?

Assume we have a textfile that we want to plot with pstext. In the case for Georgia we would put

GE Georgia

which would be translated to

43.5479837681   42.1557072697 Georgia

(coordinates obtained with $ pscoast -EGE -M | gmt spatial -Q)

I do see issues in this; e.g. I had to pick Georgia to get a single polygon from DCW - and a single centroid. Alot of countries have > 1 country polygon.

3D bars out of place?

We have example 8 that looks correct, but I don't see what (if) I'm doing wrong here:

grdmath -R-2/2/-2/2 -I0.1 X Y R2 NEG EXP X MUL = lixo.grd
grd2xyz lixo.grd | psxyz -So0.03u+b-0.45028042 -R-2.05/2.05/-2.05/2.05/-0.4288/0.4288 -JX12c -JZ6c -Baf0.1 -Bza -BWSZ -G0/115/190 -p200/30 -Wthinnest -P > lixo.ps

As we see, the bars are clearly out of place. Note that grid is grid registered but psxyz's -R is pixel reg so the bars should be centered on the tick marks.
Another non shown issue is that if one omits -G we get black bars and not the non-filled that is mentioned in psxyz -G doc.

capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.