Closed mpu-creare closed 1 year ago
This code might be useful: https://github.com/creare-com/pydem/blob/master/pydem/utils.py#L145
This might also be useful: https://pyproj4.github.io/pyproj/stable/api/crs/crs.html
Left to-do
For coords.horizontal_resolution(units='m', type='nominal')
, let's talk about the different types
types =
This is a proposal, feel free to propose something better.
Implemented 3 of the 4 types:
9851b1cb5ce4b32bc00e96e500ffc8c78efd7376
e05a662688b5d600aeb29784d43b5acb8c466cbe
Wrote some code to address the problem of lat/lon evaluating to different distances based upon the other dimension's value. However, I realized once passing in non-square unstacked coordinates that I failed to account for the difference resolution changing for each differing value of the other dimension.
Let our unstacked coordinate system be a $M$ by $N$ matrix, where $M$ is the number of rows (in grid squares), and $N$ is the number of columns. See Blender visualization:
Previously, we were returning two arrays of size $M$ and size $N$. This meant we were returning either a single row/column or a selection of each column. For example: Another example:
Instead, we want to return this for latitude:
So, for latitude we want to return a $N$ by $M$ matrix.
For longitude: So, for longitude we want to return a $M$ by $N$ matrix.
For the "summary" type resolution, we can simply average/compute std.dev of all of these values.
The $M+1$ or $N+1$ implementation is not possible due to the fact we don't store the values in the +1 dimension in our coords.
closed by #505
Description When working with lat/lon or other projected coordinates, it's hard to know the real nominal resolution of your coordinate system.
Describe the solution you'd like I want a helper function on coordinates that give me the resolution.
Sample Code