dtround#
- class dtround(arr, dt, ceil=True)[source]#
Rounds the values in the array to the nearest timestep
- Parameters:
arr (array) – any array
dt (float) – float, usually representing a timestep in years
Example:
dtround = hpv.dtround(np.array([0.23,0.61,20.53])) # Returns array([0.2, 0.6, 20.6]) dtround = hpv.dtround(np.array([0.23,0.61,20.53]),ceil=True) # Returns array([0.4, 0.8, 20.6])