Skip to content

working with dimensionless parameters in the MetPy realm #3396

Closed Answered by dopplershift
ocoudert asked this question in Q&A
Discussion options

You must be logged in to vote

The key here is to encode proper unit information on the empirical constants in the relationship that's calculating the dimensionless constant--these constants by nature rely on the data being used in the equation being in certain units. So you have:

ds2['N'][i] = (77.6/ds2['t'][i])*(press_hPa+(4810*ds2['e'][i]/ds2['t'][i]))

We can write that as

k1 = 77.6 * units('K / hPa')
k2 = 4810  * units('K')
ds2['N'][i] = (k1 / ds2['t'][i]) * (press_hPa + k2 * ds2['e'][i] / ds2['t'][i])

With that dimensionality assigned to those constants, the net dimensionality of the entire expression is dimensionless. The huge benefit of this is that regardless of what dimensionality is actually used above for t …

Replies: 1 comment 1 reply

Comment options

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

Answer selected by ocoudert
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