I have a data set with the dimensions year, lat, lon, with the variable x, which I am doing a function on to determine some other statistics.
For one lat/lon cell I chose, I was able to rank the single x value for each of the 1,000 years from greatest to least and removed the nans, leaving me with a sorted 1D array. From there, I did a function to determine a given rank value, then pulled the x value at that given rank from the 1D array.
Example:
array of x values = [6, 10, 5, nan, 4, nan, 3]
sorted array = [10, 6, 5, 4, 3]
pull x value at calculated rank, say rank=2
final ranked value at that lat/lon = 6
This process works great for a single point, but I am trying to do this process for every grid cell lat/lon within the entire array, which I feel should be simple, but I am having trouble applying these functions to a full array
Thank you!