In this post I show a way to generate a hypothetic storm event using the Alternating block method.
This python code uses the numpy library. The altblocks functions uses as input the idf parameters as list, and total duration, delta time and return period as floats.
import numpy as np def altblocks(idf,dur,dt,RP): aDur = np.arange(dt,dur+dt,dt) # in minutes aInt = (idf[0]*RP**idf[1])/((aDur+idf[2])**idf[3]) # idf equation - in mm/h aDeltaPmm = np.diff(np.append(0,np.multiply(aInt,aDur/60.0))) aOrd=np.append(np.arange(1,len(aDur)+1,2)[::-1],np.arange(2,len(aDur)+1,2)) prec = np.asarray([aDeltaPmm[x-1] for x in aOrd]) aAltBl = np.vstack((aDur,prec)) return aAltBl