Add option for letting a specified value represent NaN
|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 almost 4 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.