Search code examples
netcdfnconcks

Extracting data with NCO bounded by variable values


Is it possible to pull out all data within a region (or specific cells) that meet criteria set by a variable rather than a dimension?

For example, I'm looking to pull data within a height ('HGT') bounded region.

Hyperslabbing seems to requires dimension rather than variable.


Solution

  • The ncap2 where() function serves this purpose, e.g.,

    ncap2 -s 'where(th < 0.0 || th > 50.0) th=th.get_miss();' in.nc out.nc