gmtselect -Z -Iz quirk
|Target version:||Candidate for next bugfix release|
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
#2 Updated by Paul almost 4 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.