spencerahill / aospy

Python package for automated analysis and management of gridded climate data
Apache License 2.0
83 stars 12 forks source link

Region reductions should support meshed lat-lon #231

Open spencerahill opened 6 years ago

spencerahill commented 6 years ago

Some data is on a meshed grid, meaning that its lat and lon arrays are both 2D. (You can convert 1D arrays into meshed ones via lonmesh, latmesh = np.meshgrid(lon, lat), where lon and lat are 1D arrays.)

The 'lat' and 'lon' dimensions then have to be named something else, e.g. 'x' and 'y', since 'lon' and 'lat' are in that case each 2D coordinates defined in both 'x' and 'y'. Even if lat and lon are not meshed, it can occur that their names are not the same as the aospy-internal 'lat' and 'lon', respectively.

We should add support for these use cases with aospy.Region ts, av, and std reductions. I have what appears to be a partial solution, but I might not have time to clean it up and put up a proper PR for a while. So wanted to plant this flag so we don't lose track of this.

spencerahill commented 5 years ago

Non-standard names for lat, lon, the land mask, and surface area arrays are now all supported, but AFAICT support for meshed lat and lon remains lacking.