Skip to content

Finding first instance given a threshold (density threshold-based calculation) #5926

Answered by dcherian
pecos27 asked this question in Q&A
Discussion options

You must be logged in to vote

I use something like this but idxmax or idxmin should do the same

    thresh = xr.where((np.abs(drho) > 0.03) & (N2 > 1e-5), drho.depth, np.nan)
    mld = thresh.max("depth")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pecos27
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