I am trying to create composites of different meteorological variables during hurricanes. To that end, I have identified hurricane features in my dataset, and want to stack the identified features on top of each other, then average across all features to get an average sense of the variables I am considering. What I have done so far: for each hurricane, I have identified the centroid of the feature. I want to retain the actual scale of the storms, so I transformed the latitude/longitude values into meters relative to an origin at the storm centroid. This way, my features will be aligned at the centroids and the sizes are accurate even at different latitudes. I am currently assigning my transformed coordinates, in meters, as coordinates to the data array that contains each storm individually. My data arrays therefore have coordinates that look like this: Now the problem - I have individual data arrays like this for each storm. I need to somehow combine them into a single dataset/data array so that I can average across them, in reference to this new transformed coordinate system. Does anyone know of a good way to do this? Essentially I want to use xr.concat or similar to concatenate across a new dimension, 'storm' or 'feature'. But I want to align the arrays based on their transformed coordinates. These transformed coordinates are also obviously different slightly for each storm, depending on its latitude. In addition, the transformed_lats and transformed_lons are 2D fields because of the nature of converting regular lat/lon spacing to meters. So I can't replace the actual dimension values of the arrays with them. Thank you in advance! Continue reading...