@@ -31,7 +31,7 @@ def quantize(data,least_significant_digit):
3131 return np .around (scale * data )/ scale
3232
3333def interpolate_long_segments (coords , resolution ):
34- lookup_thresh = {'c' : 0.5 , 'l' :0.1 , 'i' :0.05 , 'h' :0.01 , 'f' :0.005 }
34+ lookup_thresh = {'c' : 0.5 , 'l' :0.3 , 'i' :0.2 , 'h' :0.1 , 'f' :0.05 }
3535 thresh = lookup_thresh [resolution ]
3636 spacing = thresh / 5.0
3737
@@ -119,7 +119,9 @@ def get_wdb_boundaries(resolution,level,rivers=False):
119119 b [:,0 ] = lons ; b [:,1 ] = lats
120120 if lsd is not None :
121121 b = quantize (b ,lsd )
122- b = interpolate_long_segments (b , resolution )
122+
123+ if not rivers :
124+ b = interpolate_long_segments (b , resolution )
123125
124126 polymeta .append ([- 1 ,- 1 ,south ,north ,len (b ),poly_id ])
125127 polybounds .append (b )
@@ -178,7 +180,10 @@ def get_wdb_boundaries(resolution,level,rivers=False):
178180for resolution in ['c' ,'l' ,'i' ,'h' ,'f' ]:
179181 f = open (os .path .join (OUTPUT_DIR , 'rivers_' + resolution + '.dat' ), 'wb' )
180182 f2 = open (os .path .join (OUTPUT_DIR , 'riversmeta_' + resolution + '.dat' ), 'w' )
181- for level in range (1 ,12 ):
183+ # Levels above 5 are intermittent rivers and irrigation canals.
184+ # They haven't been included in the past, as far as I can tell, so I'm
185+ # not including them here...
186+ for level in range (1 , 6 ):
182187 poly , polymeta = get_wdb_boundaries (resolution ,level ,rivers = True )
183188 offset = 0
184189 for p ,pm in zip (poly ,polymeta ):
0 commit comments