Skip to content

gmtselect issue (gmt6) #5368

@mvanneste

Description

@mvanneste

All,
I have the following observation with gmtselect, using either an area (-R) or polygon (-F) on a file which has x y and a third column which can be mixed as a text string or number. The outcome is that sometimes the text strings are printed as NaN, and this seems to depend on the value in the first line.

The example underneath illustrates this issue. The only difference between the two tests is that I exchanged the first 2 lines, so the results should be identical. The result of test 1 gives me NaN instead of A and C, the result of test 2 is correct.

echo “Test 1”
echo “.5 .5 1” > temp
echo “.25 .25 A” >> temp
echo “1.7 .7 B” >> temp
echo “.7 .7 C” >> temp
gmtselect -R0/1/0/1 temp
Result:
0.5 0.5 1
0.25 0.25 NaN
0.7 0.7 NaN

echo “Test 2”
echo “.25 .25 A” > temp
echo “.5 .5 1” >> temp
echo “1.7 .7 B” >> temp
echo “.7 .7 C” >> temp
gmtselect -R0/1/0/1 temp
Result:
0.25 0.25 A
0.5 0.5 1
0.7 0.7 C

The bug here may be that the t in -i0-1,2t is being ignored.

  • Operating system: linux
  • GMT version: 6.0 and 6.2

(note: I am wondering if a similar behaviour may appear with grdtrack where one column of the input file may also have a mix)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions