Project

General

Profile

Easily getting number of rows and columns (nx and ny)

Added by Brendan DeTracey over 1 year ago

Hi Everyone. I hope you are all well.
I am using selindexbox to remove the first and last columns and rows from a dataset (or an arbitrary window frame). Using bash I can parse the output of a cdo info command to get the total number of rows and columns (and do any math if I want more than one row/column removed), but is there an easier way to do this? I find myself wishing the selindexbox command (and any index based selection commands) could do this using negative indices, similar to python.
Thanks!


Replies (2)

RE: Easily getting number of rows and columns (nx and ny) - Added by Uwe Schulzweida over 1 year ago

Hi Brendan,

That's a good idea! Negative indexing will be available for selindexbox and maskindexbox in the next CDO version. A new release will be available in the next days. Other operators still need to be identified and will follow later.

Cheers,
Uwe

RE: Easily getting number of rows and columns (nx and ny) - Added by Brendan DeTracey over 1 year ago

That would be great Uwe. Will you start counting backwards from 0 or -1? :) Joking...

    (1-2/2)