gmtselect -o :output columns not working

Added by Russ 9 months ago

I'm having problems with specifying input and output columns with gmtselect -i & -o argument.

It works OK when the coord columns are at start (0,1) so you do not have to specify input columns (via -i argument). You can specify output columns (with -o argument), or output the entire line if this option is omitted.

But, as soon as you specify input columns (via -i argument) only the coord columns are output - not the entire line. In this case you can only specify output of column 0 or 1. Specifying any other columns comes up with "NaN"

Am I missing something?


Replies (6)

RE: gmtselect -o :output columns not working - Added by Paul 9 months ago

Don't know. Please give an example that fails for you, e.g.

echo 0 1 2 3 4 5 6 | gmt select -i0-3 -o1,3
1 3

RE: gmtselect -o :output columns not working - Added by Russ 9 months ago

echo 0 1 2 3 4 5 6 | gmt select -i0-3 -o1,4
echo 0 1 2 3 4 5 6 | gmt select -i0,1 -o1,3

OK - I thought that specifying input was simply meant to indicate what columns contained the relevant coords. You then specified output columns to indicate what you wanted output (from the original input line). As in the examples above.

I gather that the output is limited to what is specified for input (via the input argument). You can then further restrict the output via the output argument.

This is not obvious from the manual notes (at least for me!).

RE: gmtselect -o :output columns not working - Added by Paul 9 months ago

I will have a look at the -i and -o short documentation. The relationship is fully described in the CookBook but I think there is no link to that from the man page: https://docs.generic-mapping-tools.org/dev/cookbook/features.html#input-columns-selection-the-i-option

RE: gmtselect -o :output columns not working - Added by Paul 9 months ago

I've improved the -o documentation. Thanks for the issue.

RE: gmtselect -o :output columns not working - Added by Paul 9 months ago

FYI: The reason for the arrangement is that -i excludes some columns so the columns given to -o may not exist if we stuck to the original column references. This would add complications for us.

RE: gmtselect -o :output columns not working - Added by Russ 9 months ago

Understand.

Thanks for the link to the documentation. Good description.
The link from the man page goes to only a brief description.
Thanks again.

(1-6/6)