Example #1
0
#-------------------------------------------------

#plot_start_date = dt.datetime(1950, 10, 1)  # start date shown on the plot (should be complete water years)
#plot_end_date = dt.datetime(1987, 9, 30)  # end date shown on the plot

#time_locator = ('year', 5)  # time locator on the plot; 'year' for year; 'month' for month. e.g., ('month', 3) for plot one tick every 3 months

#-------------------------------------------------

#========================================================
# Load data
#========================================================
# RBM output
rbm_data = np.loadtxt(rbm_output_formatted_path, skiprows=1)  # year; month; day; flow(cfs); T_stream(degC)
rbm_date = my_functions.convert_YYYYMMDD_to_datetime(rbm_data[:,0], rbm_data[:,1], rbm_data[:,2])
df_rbm = my_functions.convert_time_series_to_df(rbm_date, rbm_data[:,4], ['streamT'])  # convert to pd.DataFrame
s_rbm = df_rbm.ix[:,0]  # convert df to Series

# USGS stream T
if ave_flag==0:  # if only one needed data column
	df_usgs = my_functions.read_USGS_data(usgs_data_path, columns=[usgs_streamT_col], names=['streamT'])  # [degC]
	s_usgs= df_usgs.ix[:,0]  # convert df to Series
else:  # if more than one data column needed, take average
	usgs_streamT_col_split = usgs_streamT_col.split('&')
	names=[]
	for i in range(len(usgs_streamT_col_split)):
		usgs_streamT_col_split[i] = int(usgs_streamT_col_split[i])
		names.append('streamT%d' %i)
	df_usgs = my_functions.read_USGS_data(usgs_data_path, columns=usgs_streamT_col_split, names=names)  # read in data
	s_usgs = df_usgs.mean(axis=1, skipna=False) # if either column is missing, return NaN
Example #2
0
#time_locator = ('year', 5)  # time locator on the plot; 'year' for year; 'month' for month. e.g., ('month', 3) for plot one tick every 3 months

#-------------------------------------------------

#========================================================
# Load data
#========================================================
# RBM output
rbm_data = np.loadtxt(
    rbm_output_formatted_path,
    skiprows=1)  # year; month; day; flow(cfs); T_stream(degC)
rbm_date = my_functions.convert_YYYYMMDD_to_datetime(rbm_data[:, 0],
                                                     rbm_data[:, 1],
                                                     rbm_data[:, 2])
df_rbm = my_functions.convert_time_series_to_df(
    rbm_date, rbm_data[:, 4], ['streamT'])  # convert to pd.DataFrame
s_rbm = df_rbm.ix[:, 0]  # convert df to Series

# USGS stream T
if ave_flag == 0:  # if only one needed data column
    df_usgs = my_functions.read_USGS_data(usgs_data_path,
                                          columns=[usgs_streamT_col],
                                          names=['streamT'])  # [degC]
    s_usgs = df_usgs.ix[:, 0]  # convert df to Series
else:  # if more than one data column needed, take average
    usgs_streamT_col_split = usgs_streamT_col.split('&')
    names = []
    for i in range(len(usgs_streamT_col_split)):
        usgs_streamT_col_split[i] = int(usgs_streamT_col_split[i])
        names.append('streamT%d' % i)
    df_usgs = my_functions.read_USGS_data(usgs_data_path,
Example #3
0
#-------------------------------------------------

#plot_start_date = dt.datetime(1950, 10, 1)  # start date shown on the plot (should be complete water years)
#plot_end_date = dt.datetime(1987, 9, 30)  # end date shown on the plot

#time_locator = ('year', 5)  # time locator on the plot; 'year' for year; 'month' for month. e.g., ('month', 3) for plot one tick every 3 months

#-------------------------------------------------

#========================================================
# Load data
#========================================================
# RBM output
rbm_data = np.loadtxt(rbm_output_formatted_path, skiprows=1)  # year; month; day; flow(cfs); T_stream(deg)
rbm_date = my_functions.convert_YYYYMMDD_to_datetime(rbm_data[:,0], rbm_data[:,1], rbm_data[:,2])
df_rbm = my_functions.convert_time_series_to_df(rbm_date, rbm_data[:,3], ['flow'])  # convert to pd.DataFrame
s_rbm = df_rbm.ix[:,0]  # convert df to Series

# USGS flow
if ave_flag==0:  # if only one needed data column
	df_usgs = my_functions.read_USGS_data(usgs_data_path, columns=[usgs_flow_col], names=['flow'])  # [degC]
	s_usgs= df_usgs.ix[:,0]  # convert df to Series
else:  # if more than one data column needed, take average
	usgs_flow_col_split = usgs_flow_col.split('&')
	names=[]
	for i in range(len(usgs_flow_col_split)):
		usgs_flow_col_split[i] = int(usgs_flow_col_split[i])
		names.append('flow%d' %i)
	df_usgs = my_functions.read_USGS_data(usgs_data_path, columns=usgs_flow_col_split, names=names)  # read in data
	s_usgs = df_usgs.mean(axis=1, skipna=False) # if either column is missing, return NaN