Repository navigation
Conversation
min, max, & mean operators for `UxDataArraymin, max, & mean Operators for `UxDataArray
|
@ahijevyc @hongyuchen1030 @paullric @rljacob I am working on implementing spatial min, max, & mean methods that compute their respective operation based on what values lie within some radius (in degrees) from a given (lon, lat) point. Below is a very (rough) sketch of how we select the spatial points for these operators. This aims to implement what was requested in #46 (comment) , however internally we perform all of our distance computations using degrees, however we would ideally want to use a distance in meters. Do you have any suggestions how we can convert between degrees and meters in the context of our internal representation (i.e. our grid resides on a unit sphere) |
min, max, & mean Operators for `UxDataArraymin, max, & mean Operators for UxDataArray
If you mean having a copy of the cartesian coordinates representation of the input point, just call my If you mean given any point in degree, convert it to the cartesian coordinates, we have I am more curious about how you can present the distance(radius) in degrees here? |
In our Specifically, if we indicate a radius of "90", searches for all points within a circle with radius 90 degrees |
I wrote a function called |
That will deffinitly be useful eventually, however what I'm interest is whether there's any convention or conversion that needs to be done to be able to support a "meter" or "kilometer" radius as opposed to using "degrees" For example, instead of doing "Find the minimum of all values within 25deg of some (lon, lat)", we would want "Find the minimum of all the values within 10km of some (lon, lat)". Since we currently represent all of our data on the unit sphere, is there any additional conversion that we need to do to go from "degrees" to "meters" |
Since the data is more likely to be on the Earth, you can use 6.37122e6 * to convert from radians to meters. The conversion from degrees to radians is trivial. You may want an optional argument which allows folks to override the default sphere radius. Note that distances should never use the Euclidian distance in latlon space (e.g., sqrt((lon1-lon0)^2+(lat1-lat0)^2)). |
Got it! This would still only be an approximation right? Since the earth isn't truly a "sphere?
This is a good idea, and something MPAS already handles, would using a radius other than 1 change some of our internal computation (i.e. face areas or Cartesian conversion?)
We are using the Haversine distance for our BallTree distance metric, which should be adequate. |
|
Yes, but nobody uses the ellipsoid. The error is at most ~0.3%, and only relevant for very long arcs.
… On Oct 5, 2023, at 10:58 AM, Philip Chmielowiec ***@***.***> wrote:
Since the data is more likely to be on the Earth, you can use 6.37122e6 * to convert from radians to meters.
Got it! This would still only be an approximation right? Since the earth isn't truly a "sphere?
—
Reply to this email directly, view it on GitHub <#500 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABIVPZAITPSNDP32QN5EVYTX53YMZAVCNFSM6AAAAAA5TSKH5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZGM4TIOJZGI>.
You are receiving this because you were mentioned.
|
Makes sense! Thank you! |
|
@philipc2 Would a standard deviation operation be useful as an analysis tool as well? |
It would! |
|
This work is great. In addition to min sea level pressure and maximum wind speed, for hi-res hurricane simulations, we want the maximum radius of 34-knot winds in each quadrant of the hurricane. Would this utility help with that? This is less straight forward than a max function because we don't want the maximum of a variable, but the max distance at which the variable (wind speed) exceeds a threshold. |
Would you be able to provide a visual on the hurricane quadrants? These functions wouldn't be able to compute the max distance, but we could manipulate the way we query our tree data structure to return a max distance, I can look into it. |
|
Equivalent functionality in #616 |




Closes #XXX
Overview
Expected Usage
PR Checklist
General
Testing
Documentation
_) and have been added todocs/internal_api/index.rstdocs/user_api/index.rstExamples
docs/examples/folderdocs/examples.rsttoctreedocs/gallery.ymlwith appropriate thumbnail photo indocs/_static/thumbnails/