spencerahill / aospy

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

Infer surface area from lat + lon if none provided. #327

Open spencerahill opened 5 years ago

spencerahill commented 5 years ago

I want to use Region's functionality on some non-aospy-generated data, but it doesn't have a separate surface area array, which we currently assume.

So we should add support for inferring surface area from the lat+lon arrays (preferably the lat+lon bound arrays, but this data also lacks those).

I'll need to code up this functionality to do these calculations anyways, which I'll do initially outside of aospy, but hopefully it won't be too much trouble to then translate that into a PR.

spencerahill commented 5 years ago

I knew I had done this before somewhere...model.py already implements this as _grid_sfc_area. So that's a good starting place.