-
Notifications
You must be signed in to change notification settings - Fork 447
Closed
Labels
Area: DocsAffects documentationAffects documentationType: EnhancementEnhancement to existing functionalityEnhancement to existing functionality
Milestone
Description
What can be better?
This is related to #537.
My use case is computing the magnitude of the water vapor mass flux. Of course I can just write the square root of the sum of the squares myself, but I first thought, maybe I could use wind_speed for this. However, that failed since the units are wrong. Then I looked into what the documentation says is the MetPy equivalent of GEMPAK's MAG function, and it says to use numpy.linalg.norm for this. In my case, I have 3D arrays (x,y,theta) of the i- and j-components of the mass flux, and my attempts to somehow use norm for this have failed.
My request is either:
- Determine that
np.linalg.normactually isn't equivalent to GEMPAK's MAG function, or - Provide an example of how to use
normto compute the magnitude of a vector when the scalar components are 3D arrays in that box on the Conversion Guide. I suspect that, if this is possible, it involves constructing an array with such care that just doing the square root of the sum of the squares is much easier, in which case, - Implement an actual mpcalc
magnitudefunction (of which thewind_speedfunction becomes a special case that adds the requisite unit check)
Metadata
Metadata
Assignees
Labels
Area: DocsAffects documentationAffects documentationType: EnhancementEnhancement to existing functionalityEnhancement to existing functionality