Skip to content

Commit

Permalink
never let minutes since last_obs be negative (#521)
Browse files Browse the repository at this point in the history
Co-authored-by: awlostowski-noaa <[email protected]>
  • Loading branch information
awlostowski-noaa and awlostowski-noaa authored Feb 12, 2022
1 parent d28549d commit 49d0563
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from libc.math cimport exp, isnan, NAN
from libc.math cimport exp, isnan, NAN, fabs
from libc.stdio cimport printf

cpdef float simple_da_with_decay_py(
Expand Down Expand Up @@ -119,7 +119,7 @@ cdef float obs_persist_shift(
"""

cdef float da_weight, da_shift, da_weighted_shift
da_weight = exp(minutes_since_last_valid/-decay_coeff) # TODO: This could be pre-calculated knowing when obs finish relative to simulation time
da_weight = exp(fabs(minutes_since_last_valid)/-decay_coeff) # TODO: This could be pre-calculated knowing when obs finish relative to simulation time
# TODO: we need to be able to export these values to compute the 'Nudge'
# One possibility would be to return only the nudge from this function...
da_shift = last_valid_obs - model_val
Expand Down

0 comments on commit 49d0563

Please sign in to comment.