Bug #591

gmtselect -Z -Iz quirk

Added by John almost 6 years ago. Updated almost 6 years ago.

Status:ClosedStart date:2014-07-25
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:


I suspect that the quirk I'm about to describe may actually be by design, but let me give it a go...

Say I have a three column data set x,y,z called t.xyz. Let z be integers, for the sake of this example, which can have values NaN, 1 and 2.

When the command is issued to select everything that is NOT equal to 1, i.e.,

gmt gmtselect t.xyz -Z1+2 -Iz > t1.xyz

the result will be that only records with z = 2 are output. The NaN records are skipped.

As a programmer, while selecting data, when I request records be passed that have a value in a column NOT equal to something, I expect ALL records that are equal to anything but "something" to get written out, including records that have NaN values in that column.

The work-around, to get NaNs and all other values than "something," is easy. But it takes an extra line and you'll lose a sense of order in the records:

gmt gmtselect t.xyz -s2r > t1.xyz
gmt gmtselect t.xyz -Z1+2 -Iz >> t1.xyz

The "quirk" is essentially a question of programming sensibility. When requesting all records where a value in a certain column is NOT something, then shouldn't ALL remaining records be passed, including NaNs?

Thanks - John


#1 Updated by John almost 6 years ago

Forgot to fill out platform, version, etc...

Version 5.1.1 (r12968)

#2 Updated by Paul almost 6 years ago

  • Tracker changed from Feature to Bug
  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100
  • Affected version set to 5.x-svn

We have decided to reclassify this issue as a bug. The -Z as you used it should pass NaN records. These can always be prevented via -s. Fixed in r13386. Let us know if any side-effects occur.

#3 Updated by Paul almost 6 years ago

John, could you please confirm that this works for you so I can close the issue.

#4 Updated by John almost 6 years ago

With regrets, Paul. I am no longer keeping up with svn versions. I upgrade via macports.

My installation says GMT version r12968 is the current version. I don't have an easy way to confirm your updates, until a new version is made available on macports. - John

#5 Updated by Paul almost 6 years ago

  • Status changed from Resolved to Closed

OK, since my tests shows this now work I will close the issue. When 5.1.2 is released you can reopen the case again should there still be any issues I have overseen.

Also available in: Atom PDF