Project

General

Profile

how to combine showinfo?

Added by Noam Chomsky over 4 years ago

I like to use showinfo but I don't understand how to show only certain info. For example if I want to see names and levels. I am not sure if it's useful to see only levels when I don't see the names of such variables. I tried cdo showname showlevel file.nc but doesn't work.


Replies (4)

RE: how to combine showinfo? - Added by Karin Meier-Fleischer over 4 years ago

Hi Naomi,

there are different ways to get information from a file. You can use one of the showinfo operators showname, etc. or you can use the info/sinfo operators.

Print information for each timestep, print variable names:

cdo infon infile.nc

Print grid, level, time information, print variable names:

cdo sinfon infile.nc

https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-370002.1.1
https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-420002.1.2
https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-580002.1.5

-Karin

RE: how to combine showinfo? - Added by Noam Chomsky over 4 years ago

Hey Karin,

Thank you for the suggestion. I think part of my question was not very well written. The sinfon is what I was looking, but is there a way to only print the first part 3 parts but NOT print the Time coordinate part? That takes a lot of space in the screen and I need to scroll up to find the info I really need.

Also in regards to the showlevel and the other show*something* operators, how are those useful if the name of the variable is not printed? For example in my data if I use showlevel I get this
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13
0
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11

but it's not really that useful because I don't to which variables these levels belong to.

Thanks again.

RE: how to combine showinfo? - Added by Karin Meier-Fleischer over 4 years ago

In my opinion there isn't such operator but you can use your shell with a loop to do it similarly.

To print the variable names followed by their levels to stdout, e.g. for Korn-Shell:

for name in $(cdo showname infile.nc) ; do ; echo "-- ${name}" ; cdo -s showlevel -selname,${name} infile.nc ; done

For my example file it prints

-- rhumidity
 100000 92500 85000 77500 70000 60000 50000 40000 30000 25000 20000 15000 10000 7000 5000 3000 1000
-- var3
 100000 92500 85000 77500 70000 60000 50000 40000 30000 25000 20000 15000 10000 7000 5000 3000 1000
-- t
 100000 92500 85000 77500 70000 60000 50000 40000 30000 25000 20000 15000 10000 7000 5000 3000 1000

-Karin

RE: how to combine showinfo? - Added by Noam Chomsky over 4 years ago

Karin Meier-Fleischer wrote:

In my opinion there isn't such operator but you can use your shell with a loop to do it similarly.

To print the variable names followed by their levels to stdout, e.g. for Korn-Shell:

[...]

For my example file it prints
[...]

-Karin

I thought so that it needed some kind of hack :) . Thanks for the suggestion!

    (1-4/4)