Skip to content

How to use the ds.vertical() method? #64

Answered by robertjwilson
JairoVS asked this question in Q&A
Discussion options

You must be logged in to vote

I see the problem. nctoolkit uses CDO to subset this, but the CDO call only takes integer values, so it won't work very well for your data as it goes from 0-1. I'll see if I can fix that or just ask the CDO developers to adjust their method.

In the meantime you can use the following by calling CDO internally. Note: the level order displayed by ds.levels is the reverse of what's in the file raw data. This is automatically ordered by nctoolkit, because in general that's easier for users. But this is a rare case where it might be confusing. I might need a warning to flag it's been re-ordered.

ds.cdo_command(f"sellevidx,{47-29}/47")
ds.run()
# check you've got 30 levels
ds.vertical_sum()

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@JairoVS
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JairoVS
Comment options

Comment options

You must be logged in to vote
3 replies
@JairoVS
Comment options

@robertjwilson
Comment options

@JairoVS
Comment options

Answer selected by JairoVS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants