Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c94628

Browse files
committed
working on basemap
1 parent 0dc9b86 commit 1c94628

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nwis.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ def baseflow_summary(self, q90_window=20, output_proj4=None):
414414
mdt = fm.measurement_dt[i]
415415
Dt = dt.datetime(mdt.year, mdt.month, mdt.day)
416416
for site_no, data in self.dvs.items():
417-
try:
417+
418+
# check if index station covers measurement date
419+
if Dt < data.index[0] or Dt > data.index[-1]:
420+
continue
421+
else:
418422
dv = data.ix[Dt]
419423
site_no = dv.site_no
420424
DDcd = [k for k in data.keys() if '00060' in k and not 'cd' in k][0]
@@ -442,9 +446,6 @@ def baseflow_summary(self, q90_window=20, output_proj4=None):
442446
indexQ90.append(q90)
443447
X.append(site_info['geometry'].xy[0][0])
444448
Y.append(site_info['geometry'].xy[1][0])
445-
except KeyError, e:
446-
print e
447-
continue
448449

449450
df = pd.DataFrame({'site_no': fm_site_no,
450451
'station_nm': station_nm,

0 commit comments

Comments
 (0)