Closed davidfee5 closed 4 years ago
The first commit had a mistake and I had trouble removing it.
Also, I think we should make a copy of the input
st
at the beginning of this function and do further processing on the copy, not the original. It wasn't necessary before, but now that we're overwriting some of the metadata we need to ensure that the inputst
isn't modified by this function (i.e. we don't want this function to have "side effects"). I always forget about that!
Wouldn't we want the new station elevations to be clamped to the DEM? I could see this being useful for additional processing. In general I agree about not overwriting metadata and potential side-effects, but in this case I think it might make sense. Thoughts?
What sort of additional processing were you envisioning? I can imagine plotting profiles with stations like this one from Kim et al. (2015) being one such application:
Sure, that's one example. I was trying to think of a situation where we wouldn't want it clamped and am not really sure (other than an aerostat sensor). Also, in general I would trust the DEM surface more than the station elevations, as they may come from poor estimates from a handheld GPS/etc.
All looks good to me. Tested a couple different scenarios.
Address #33. Finds nearest grid point on DEM surface and uses that elevation. If no grid point found (i.e. station not on DEM) then the original station elevation is kept.