MazamaScience / AirFireWRF

Utilities for working with WRF atmospheric model data
https://mazamascience.github.io/AirFireWRF/
0 stars 1 forks source link

Saving data subsets #11

Closed tabrasel closed 4 years ago

tabrasel commented 4 years ago

Raw WRF model run output is usually upwards of several hundred Megabytes. Not all of the information contained is relevant though, and it would make sense to save only the important bits by cropping out unneeded regions or stripping away irrelevant variables. These subsets could then be stored in a user-specified data directory (different from WRFDataDir?)

jonathancallahan commented 4 years ago

To flesh out desirable functionality, this task should be approached as having two parts:

  1. "Saving Data Subsets" vignette example showing how to create and save a surface layer subset of a full WRF model tilmestep that includes Susan's recommended variables: XLAT, XLONG, LU_INDEX, ZNU, ZNW, W, T, Q2, T2, TH2, U10, V10, HGT, RAINNC, CFRACT, PBLH, XLAT_U, XLONG_U, XLAT_V, XLONG_V, U, V
  2. Any functions that make sense while creating this vignette.

If any of the above variables don't make sense at the surface (e.g. vertical motion) just leave them off the list.

tabrasel commented 4 years ago

Right now, I don't think any additional functions are necessary for subsetting, since wrf_load() already provides a lot of helpful features like specifying variables and cropping the spatial domain (the whole rasterization process also helps compress the final result). All that's left is to save the raster object as an "xz" compressed .rda file, which could maybe warrant a tiny wrf_save() wrapper function.

I also updated wrf_load() so that, if you pass in no vars argument, it will load all of the variables you listed there except "W", which is the vertical wind velocity.