__author__ = 'kiruba' import numpy as np import matplotlib.pyplot as plt import pandas as pd # import itertools import checkdam.checkdam as cd """ Capacitance sensor Calibration """ # 2972 y_cal = np.array([100, 500, 800, 1200, 1800, 2400, 3000, 3600, 3700]) x_cal = np.array([1901, 2176, 2393, 2668, 3095, 3496, 3914, 4330, 4403]) a_stage = cd.polyfit(x_cal, y_cal, 1) coeff_cal = a_stage['polynomial'] slope = coeff_cal[0] intercept = coeff_cal[1] print coeff_cal """ read tank data """ block_1 = '/media/kiruba/New Volume/ACCUWA_Data/lake_water_level/2972/2972_015_001.CSV' water_level_1 = cd.read_correct_ch_dam_data(block_1, slope, intercept) block_2 = '/media/kiruba/New Volume/ACCUWA_Data/lake_water_level/2972/2972_015_002_22_08_2015.CSV' water_level_2 = cd.read_correct_ch_dam_data(block_2, slope, intercept) block_3 = '/media/kiruba/New Volume/ACCUWA_Data/lake_water_level/2972/2972_010_001.CSV' water_level_3 = cd.read_correct_ch_dam_data(block_3, slope, intercept) block_4 = '/media/kiruba/New Volume/ACCUWA_Data/lake_water_level/2972/2972_010_002.CSV' water_level_4 = cd.read_correct_ch_dam_data(block_4, slope, intercept) block_5 = '/media/kiruba/New Volume/ACCUWA_Data/lake_water_level/2972/2972_007_001_24_12_2015.CSV' water_level_5 = cd.read_correct_ch_dam_data(block_5, slope, intercept)
# Rain data frame rain_df = pd.read_csv(rain_file, sep=',', header=0) # set index rain_df['Date_Time'] = pd.to_datetime(rain_df['Date_Time'], format=date_format) rain_df.set_index(rain_df['Date_Time'], inplace=True) # sort based on index rain_df.sort_index(inplace=True) # drop date time column rain_df = rain_df.drop('Date_Time', 1) """ Check dam calibration """ y_cal_1 = np.array([100, 1000, 2000, 3000, 4000, 5000]) x_cal_1 = np.array([1894, 2563, 3298, 4049, 4794, 5548]) a_stage_1 = cd.polyfit(x_cal_1, y_cal_1, 1) coeff_cal_1 = a_stage_1['polynomial'] slope_1 = coeff_cal_1[0] intercept_1 = coeff_cal_1[1] y_cal = np.array([100, 1000, 2000, 3000, 4000, 5000]) x_cal = np.array([1864, 2540, 3313, 4078, 4835, 5582]) a_stage = cd.polyfit(x_cal, y_cal, 1) coeff_cal = a_stage['polynomial'] slope = coeff_cal[0] intercept = coeff_cal[1] """ Read Check dam data """ block_1 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/3075/3075_012_001.CSV' water_level_1 = cd.read_correct_ch_dam_data(block_1, slope_1, intercept_1) block_2 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/3075/3075_012_00325_8_14.CSV'
# raise SystemExit(0) # Rain data frame rain_df = pd.read_csv(rain_file, sep=',', header=0) # set index rain_df['Date_Time'] = pd.to_datetime(rain_df['Date_Time'], format=date_format) rain_df.set_index(rain_df['Date_Time'], inplace=True) # sort based on index rain_df.sort_index(inplace=True) # drop date time column rain_df = rain_df.drop('Date_Time', 1) """ Check dam calibration """ y_cal = np.array([100, 400, 1000, 1600, 2250, 2750]) x_cal = np.array([1987, 2454, 3344, 4192, 5104, 5804]) a_stage = cd.polyfit(x_cal, y_cal, 1) coeff_cal = a_stage['polynomial'] slope = coeff_cal[0] intercept = coeff_cal[1] """ Read Check dam data """ block_1 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/2526/2526_007_001.CSV' water_level_1 = cd.read_correct_ch_dam_data(block_1, slope, intercept) block_2 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/2526/2526_007_002_25_8_14.CSV' water_level_2 = cd.read_correct_ch_dam_data(block_2, slope, intercept) block_3 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/2526/2526_007_003.CSV' water_level_3 = cd.read_correct_ch_dam_data(block_3, slope, intercept) block_4 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/2526/2526_007_004.CSV' water_level_4 = cd.read_correct_ch_dam_data(block_4, slope, intercept) block_5 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/2526/2526_005_001.CSV'
# Rain data frame rain_df = pd.read_csv(rain_file, sep=',', header=0) # set index rain_df['Date_Time'] = pd.to_datetime(rain_df['Date_Time'], format=date_format) rain_df.set_index(rain_df['Date_Time'], inplace=True) # sort based on index rain_df.sort_index(inplace=True) # drop date time column rain_df = rain_df.drop('Date_Time', 1) """ Check dam calibration """ y_cal_1 = np.array([100, 1000, 2000, 3000, 4000, 5000]) x_cal_1 = np.array([1894, 2563, 3298, 4049, 4794, 5548]) a_stage_1 = cd.polyfit(x_cal_1, y_cal_1, 1) coeff_cal_1 = a_stage_1['polynomial'] slope_1 = coeff_cal_1[0] intercept_1 = coeff_cal_1[1] y_cal = np.array([100, 1000, 2000, 3000, 4000, 5000]) x_cal = np.array([1864, 2540, 3313, 4078, 4835, 5582]) a_stage = cd.polyfit(x_cal, y_cal, 1) coeff_cal = a_stage['polynomial'] slope = coeff_cal[0] intercept = coeff_cal[1] """ Read Check dam data """ block_1 = '/media/kiruba/New Volume/ACCUWA_Data/check_dam_water_level/3075/3075_012_001.CSV' water_level_1 = cd.read_correct_ch_dam_data(block_1, slope_1, intercept_1)