#made some changes to accomodate the new structure of the MESH_v2. Catchment 25-31 were merged into one single catchment (25). The rain and ET data is untouched but are cropped down to 25 catchments in the preprocessing code.

Development
tinoheimhuber 6 years ago
parent 399318dcf3
commit 83f89c254d

@ -147,7 +147,7 @@ if S['include_boundary_flows'].lower() == 'yes':
df = df.drop(['Q[ML/d]', key], axis = 1) df = df.drop(['Q[ML/d]', key], axis = 1)
#increase river temperature by Delta #increase river temperature by Delta
if S['Increase_riv_temp'] == 'yes': if S['Increase_riv_temp'] == 'yes':
df['Temperature'] = df['Temperature'] + S['Riv_temp_increase'] df['Temperature'] = df['Temperature'] + float(S['Riv_temp_increase'])
wq_timeseries[key] = df wq_timeseries[key] = df
@ -174,7 +174,7 @@ if S['include_CC_wq'].lower() == 'yes':
df.index = df.index + (start_date - pres_start_date) df.index = df.index + (start_date - pres_start_date)
#increase temperature by Delta #increase temperature by Delta
if S['Increase_SST_temp'] == 'yes': if S['Increase_SST_temp'] == 'yes':
df['Temperature'] = df['Temperature'] + S['SST_increase'] df['Temperature'] = df['Temperature'] + float(S['SST_increase'])
CC_timeseries[key] = df.copy() CC_timeseries[key] = df.copy()
# Read WWTP data from setup file # Read WWTP data from setup file
@ -209,9 +209,13 @@ if S['include_wwtp_flows'].lower() == 'yes':
# Convert from ML/day to m3/s # Convert from ML/day to m3/s
df[key] = df[['Q[ML/d]']] * 1000 / 24 / 3600 df[key] = df[['Q[ML/d]']] * 1000 / 24 / 3600
#Shift the water quality time series data frame by
df.index = df.index + (start_date - pres_start_date)
# Add to inflow time series dataframes # Add to inflow time series dataframes
inflow_timeseries = inflow_timeseries.join(df[[key]]) inflow_timeseries = inflow_timeseries.join(df[[key]])
# Add to water quality timeseries # Add to water quality timeseries
wq_timeseries[key] = df.drop(['Q[ML/d]', key], axis = 1) wq_timeseries[key] = df.drop(['Q[ML/d]', key], axis = 1)
@ -224,7 +228,10 @@ rain_master = pd.read_csv(
# Trim climate data to current date range # Trim climate data to current date range
eto_master = eto_master[start_date:end_date] eto_master = eto_master[start_date:end_date]
eto_master = eto_master.iloc[:,0:25]
rain_master = rain_master[start_date:end_date] rain_master = rain_master[start_date:end_date]
rain_master = rain_master.iloc[:,0:25]
#inflow_timeseries.index.difference(rain_master.index) #inflow_timeseries.index.difference(rain_master.index)
@ -593,7 +600,7 @@ if S['include_WQ'].lower() == 'yes':
wq.index = np.tile(i, wq.shape[0]) wq.index = np.tile(i, wq.shape[0])
wq_df = wq_df.append(wq) wq_df = wq_df.append(wq)
#Shift the water quality time series data frame by #Shift the water quality time series data frame by
wq_df.index = wq_df.index + (start_date - pres_start_date) #wq_df.index = wq_df.index + (start_date - pres_start_date)
# Write element inflows for RMA # Write element inflows for RMA
# Consolidate inflow elements in RMA mesh (only include those with inflows) # Consolidate inflow elements in RMA mesh (only include those with inflows)
@ -644,9 +651,8 @@ for current_year in range(start_date.year, end_date.year + 1):
if S['include_WQ'].lower() == 'yes': if S['include_WQ'].lower() == 'yes':
# Get water quality values for current day # Get water quality values for current day
#wq = wq_df.loc[index, :].set_index('constituent') wq = wq_df.loc[index, :].set_index('constituent')
index + 100 #wq = wq_df[wq_df.index == index].set_index('constituent') #TH I changed this since the constituent part did not work here.
wq = wq_df[wq_df.index == index].set_index('constituent') #TH I changed this since the constituent part did not work here.
# Get names of WWTP, catchment, and boundaries at current element # Get names of WWTP, catchment, and boundaries at current element
try: try:
w_names = [x for x in q_names if x in wwtp_data.keys()] w_names = [x for x in q_names if x in wwtp_data.keys()]

Loading…
Cancel
Save