USDA-ARS-NWRC / smrf

SMRF was designed to increase the flexibility of taking measured weather data, or atmospheric models, and distributing the data across a watershed.
Other
12 stars 4 forks source link

Windninja fix #159

Closed scotthavens closed 4 years ago

scotthavens commented 4 years ago

Wind Ninja fix

The fix for the wind ninja bug is a little more elegant and has moved the smrf.distribute.wind to a package where you can select what wind model to use. A config option wind_model has the following values:

The wind ninja performs more robust linear interpolation along the edges and will raise an error if there are still NaN values in the image. To test this, I've added the Lakes domain with a HRRR simulation that mirrors what we do in real time, something that we were not testing before.

Other updates

Changes in the gold files

The RME gold and gold_hrrr changed.

rme_gold_stations Above are the changes to the RME gold files. Almost no changes expect for some small changes in net_solar which was expected from the slope fix.

rme_gold_hrrr Above are the changes to the RME gold_hrrr files. Most of the changes appear to be float tolerances which was shown to be an issues with how xarray in weather_forecast_retrieval reads grib files. The net_solar shows the largest change from the slope fix but very minimal.

jomey commented 4 years ago

Really like the break up to a several wind classes.

Have you done any performance testing on this? I would be curious to see how it performs on big datasets as I see a lot of numpy operations that could be vectorized and probably get a big boost this way.

scotthavens commented 4 years ago

The breakup of the wind classes was necessary, it would have been to large of a class without it. I'm hoping that this will serve as a template for some of the other classes we have to start compartmentalizing the code a bit more. Plus this makes it a lot easier to unit test without having to run all of SMRF.

There was a point I was testing the WindstralWindModel on a GPU but didn't make a lot of progress. I bet with numba we could see an increase in performance.