Project

General

Profile

Vertical average / selection by values, not index

Added by Mark Payne over 5 years ago

Hi,

I have a set of data from various different data providers of 3D salinity (lat, lon, depth). I would like to calculate the average between 250 and 600m for each of these files. However, given that the choice of layers is different between the files, this would require that I identify the layers of interest and then extract with sellev. Is there anyway to do this by specifying the values of the z-axis, rather than the indices i.e. to specify that I would like to do the extraction for layers between 250 and 600m? Alternatively, can vertmean be used (or modified) to do something similar - all of the necessary mechanisms are probably contained there...

Best wishes,

Mark


Replies (2)

RE: Vertical average / selection by values, not index - Added by Ralf Mueller over 5 years ago

hi Mark!

sellev and select,level=... do not support a range notation like it is the case for indices, but I see two possible solutions

  1. scan all files for their levels, sort them and create a list of from 250m to 600m no matter if these values are present in all files
    • call cdo select,level=<your list of level> on your files. non-existing level should be ignored
  2. use the expr operators with a proper ternary conditional clause using the clev() function to access the vertical coordinate value (pdf docu, page 77)

if you upload a file, I can have a look at it

cheers
ralf

RE: Vertical average / selection by values, not index - Added by Mark Payne over 5 years ago

Thanks Ralf. I have implemented some code that is able to deal with it manually - I was just wondering if there was something I had overlooked. Could be good feature to add in the future!

Best wishes,

Mark

    (1-2/2)