Open thgeorgiou opened 1 month ago
Hey @thgeorgiou,
thanks for the issue! We were already planning on splitting those two functionalities as part of refactor #173 so that's a great idea :)
As to what is supposed to be in the public API, we tried to keep it as simple as possible for now but tbh, I think we should reconsider adding some more stuff exactly for these kinds of usecases. I also had the problem a couple of weeks ago that I wanted to use some of the diagnostics calculations independently of .xwrf.postprocess()
and that wasn't really possible.
What I would find interesting is to have all self-contained routines which are run as part of .xwrf.postprocess()
be public-facing functions which you could also import and run on your own.
But maybe @jthielen or @mgrover1 also have some opinions on this?
What is your issue?
Hello all!
In a recent project, I started by doing some preliminary post-processing of all my wrfout files (running them through xwrf, destaggering, removing some variables and computing some others, concatenating) and storing the intermediate files before continuing with my analysis. The WRF projection is helpfully added in the
wrf_projection
variable but that can't be stored in a netCDF file, so you have to drop it before writing your output.At this point, if you open your file again, there is no point in running
.xwrf.postprocess()
because everything is ready. But you also don't have theproj
object and you can't make it withxwrf._wrf_grid_from_dataset()
since it tries to find thewest_east
/south_north
dimensions for making the grid.The proposal here is to split
_wrf_grid_from_dataset()
into two functions, one for creating the proj object (e.g.get_wrf_proj()
) and one for creating the (x, y) grid_get_wrf_grid()
. The first could be useful outside.xwrf.postprocess()
so it would be nice for it to be part of the public API.I would be happy to write a pull request about this but I didn't want to jump the gun since it adds stuff to the public API.
Thank you for your great work :)