Skip to content

Instantly share code, notes, and snippets.

@SiccarPoint
Created December 2, 2014 22:08
Show Gist options
  • Save SiccarPoint/e7223bc34a9fd4713700 to your computer and use it in GitHub Desktop.
Save SiccarPoint/e7223bc34a9fd4713700 to your computer and use it in GitHub Desktop.
storm generator
for (interval_duration, rainfall_rate) in precip.yield_storm_interstorm_duration_intensity():
if rainfall_rate != 0.:
mg = fr.route_flow(grid=mg, runoff_rate=rainfall_rate)
#print 'Area: ', numpy.max(mg.at_node['drainage_area'])
mg,_,_ = sp.erode(mg, interval_duration, Q_if_used='water_discharges', K_if_used='K_values')
#add uplift
mg.at_node['topographic_elevation'][mg.core_nodes] += uplift*interval_duration
this_trunc = precip.elapsed_time//out_interval
if this_trunc != last_trunc: #a new loop round
print 'made it to loop ', out_interval*this_trunc
last_trunc=this_trunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment