USGS-R / mda.lakes

Wisconsin Lake Modeling Aggregation
2 stars 11 forks source link

TOHA Calc interp issue #99

Open lawinslow opened 6 years ago

lawinslow commented 6 years ago

I have a TOHA question that hopefully is easy to answer.

I am trying to make statements in our paper regarding thermal habitat not generally being limiting in Mille Lacs (to date). To that end, I want to say something about days in which thermal habitat was absent because it was too hot.

Using the daily THA values from the calibrated temperature model for ML, it looks like there are 7 days for the entire time series in which THA = 0 and it is not because it is too cold (there are lots of 0 values in the winter). But when I compare that to the daily temperature values from the calibrated model outputs, they don’t completely match up. There are 10 days in that dataset where the water was >25C at every depth. So…what do you think? How could the water temps be >25C but TOHA for that day be >0?

7/27/2012 is one example. See attached files.

daily_toha_estimate.zip

lawinslow commented 6 years ago

There are 10 days in that dataset where the water was >25C at every depth. So…what do you think? How could the water temps be >25C but TOHA for that day be >0?

Ah, ok, dug around a bit, I can now tell you why it does this.

Right here: https://github.com/USGS-R/mda.lakes/blob/master/R/opti_thermal_habitat.R#L46

Because water temperature data supplied are only daily, and we are asking the calc-toha function to calculate at an hourly timestep (to capture the diel light cycle). So then what happens is it takes and interpolates the water temperature data to an hourly timestep. So on 2012-07-27 you are seeing some of, I think, 07-28 bleed into the data. On that day, there were some depths with suitable habitat.

You can see this fairly clearly by comparing the three days in that area. 07-26 (in the non bias-corrected version) has a zero for thermo habitat. You can see that both 07-26 and 07-27 are all >25C, so the interpolation resulted in data all >25C. Hence the one day with zero thermo habitat.

Not optimal, but not a huge bias. It would probably have been better to just repeat the water temp value for each day.

I'm throwing this up as a github issue for future reference.