Feature #513

Add option for letting a specified value represent NaN

Added by Paul over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:2014-02-12
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next minor release


Some programs reading data to be gridded (e.g., xyz2grd) have options to turn a specified value (e.g., 99999.9) into NaN, which others like grd2xyz can do the inverse. However, this does not exist for general table processing or plotting. So if your data file comes with many columns of data and for some columns/rows missing data is flagged as 9999.9 etc, then you have to use awk to convert that to NaN so it is recognized as missing data. Likewise, if processing data with GMT and needing to export to another tool where 99999.9 is used instead then the reverse awk is needed.

Proposal: Add +n<nanvalue> to the -i and -o options. For -i, any input value that matches <nanvalue> will be set to NaN instead, while for -o any output value that is NaN will be written as <nanvalue> instead.


#1 Updated by Paul over 7 years ago

  • Subject changed from Add modifier to -i and -o for letting specified value represent NaN to Add option for letting a specified value represent NaN
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

After much consideration this particular feature request was implemented via a new GMT common option: -d[i|o]<nodata>. Depending on settings (i.e., if i or o or neither is given) we will replace columns that equal nodata on input with NaN, and replace NaN with nodata on output. Added to GMT 5.2.x branch as r13023.

#2 Updated by Paul over 7 years ago

  • Status changed from Resolved to Closed

Done for now.

Also available in: Atom PDF