elif git!=True: ## Local folders
    maindir = 'C:/Users/Alex/Desktop/'### samoa/
    csvoutputdir = datadir+'samoa/WATERSHED_ANALYSIS/FAGAALU/MasterDataFiles/csv_output/'
    savedir = datadir+'samoa/WATERSHED_ANALYSIS/GoodFigures/'
    figdir = datadir+'samoa/WATERSHED_ANALYSIS/GoodFigures/rawfigoutput/'
    
#### Import PRECIP Data
from precip_data import raingauge, AddTimu1, AddTimu1Hourly, AddTimu1Daily, AddTimu1Monthly

print 'opening MASTER_DATA excel file...'+dt.datetime.now().strftime('%H:%M:%S')
if 'XL' not in locals():
    XL = pd.ExcelFile(datadir+'MASTER_DATA_FAGAALU.xlsx')
print 'MASTER_DATA opened: '+dt.datetime.now().strftime('%H:%M:%S')

## Timu-Fagaalu 1 (by the Quarry)
Precip = raingauge(XL,'Timu-Fagaalu1-2013',180) ## (path,sheet,shift) no header needed
Precip = Precip.append(raingauge(XL,'Timu-Fagaalu1-2014',0)) ## (path,sheet,shift) no header needed
Precip.columns=['Timu1']
Precip['Timu1-15']=Precip['Timu1'].resample('15Min',how='sum')
Precip['Timu1-30']=Precip['Timu1'].resample('30Min',how='sum')

Precip['Timu1hourly']= Precip['Timu1'].resample('H',how='sum')
Precip['Timu1hourly'].dropna().to_csv(datadir+'OUTPUT/Timu1hourly.csv',header=['Timu1hourly'])

Precip['Timu1daily'] = Precip['Timu1'].resample('D',how='sum')
Precip['Timu1daily'].dropna().to_csv(datadir+'OUTPUT/Timu1daily.csv',header=['Timu1daily'])

Precip['Timu1monthly'] = Precip['Timu1'].resample('MS',how='sum') ## Monthly Precip
Precip['Timu1monthly'].dropna().to_csv(datadir+'OUTPUT/Timu1monthly.csv',header=['Timu1monthly'])

## Timu-Fagaalu2 (up on Blunt's Point Ridge; only deployed for 2 months in 2012)
    

#### LOAD MASTER_XL Data
print 'opening MASTER_DATA excel file...'+dt.datetime.now().strftime('%H:%M:%S')
if 'XL' not in locals():
    print 'Opening XL...'
    XL = pd.ExcelFile(datadir+'MASTER_DATA_NUUULI.xlsx')
if 'XL_Fagaalu' not in locals():
    print 'Opening XL_Fagaalu...'
    XL_Fagaalu = pd.ExcelFile(datadir+'MASTER_DATA_FAGAALU.xlsx')
print 'MASTER_DATA opened: '+dt.datetime.now().strftime('%H:%M:%S')


#### Import PRECIP Data
from precip_data import raingauge, AddTimu1, AddTimu1Hourly, AddTimu1Daily, AddTimu1Monthly
Precip = raingauge(XL,'Timu-Nuuuli1',0) ## (path,sheet,shift) no header needed
Precip.columns=['Timu-Nuuuli1']
Precip['Timu-Nuuuli1-15']=Precip['Timu-Nuuuli1'].resample('15Min',how='sum')
Precip['Timu-Nuuuli1-hourly']=Precip['Timu-Nuuuli1'].resample('60Min',how='sum')
Precip['Timu-Nuuuli1-daily']=Precip['Timu-Nuuuli1'].resample('1D',how='sum')

Timu_Nuuuli2 = raingauge(XL,'Timu-Nuuuli2',0) ## (path,sheet,shift) no header needed
Precip['Timu-Nuuuli2'] = Timu_Nuuuli2['Events']
Precip['Timu-Nuuuli2-15'] = Precip['Timu-Nuuuli2'].resample('15Min',how='sum')
Precip['Timu-Nuuuli2-hourly']=Precip['Timu-Nuuuli2'].resample('60Min',how='sum')
Precip['Timu-Nuuuli2-daily']=Precip['Timu-Nuuuli2'].resample('1D',how='sum')

#### Import WX STATION Data
from load_from_MASTER_XL import WeatherStation

FPa = WeatherStation(XL_Fagaalu,'FP-30min')
    maindir = 'C:/Users/Alex/Desktop/'  ### samoa/
    csvoutputdir = datadir + 'samoa/WATERSHED_ANALYSIS/FAGAALU/MasterDataFiles/csv_output/'
    savedir = datadir + 'samoa/WATERSHED_ANALYSIS/GoodFigures/'
    figdir = datadir + 'samoa/WATERSHED_ANALYSIS/GoodFigures/rawfigoutput/'

#### Import PRECIP Data
from precip_data import raingauge, AddTimu1, AddTimu1Hourly, AddTimu1Daily, AddTimu1Monthly

print 'opening MASTER_DATA excel file...' + dt.datetime.now().strftime(
    '%H:%M:%S')
if 'XL' not in locals():
    XL = pd.ExcelFile(datadir + 'MASTER_DATA_FAGAALU.xlsx')
print 'MASTER_DATA opened: ' + dt.datetime.now().strftime('%H:%M:%S')

## Timu-Fagaalu 1 (by the Quarry)
Precip = raingauge(XL, 'Timu-Fagaalu1-2013',
                   180)  ## (path,sheet,shift) no header needed
Precip = Precip.append(raingauge(XL, 'Timu-Fagaalu1-2014',
                                 0))  ## (path,sheet,shift) no header needed
Precip.columns = ['Timu1']
Precip['Timu1-15'] = Precip['Timu1'].resample('15Min', how='sum')
Precip['Timu1-30'] = Precip['Timu1'].resample('30Min', how='sum')

Precip['Timu1hourly'] = Precip['Timu1'].resample('H', how='sum')
Precip['Timu1hourly'].dropna().to_csv(datadir + 'OUTPUT/Timu1hourly.csv',
                                      header=['Timu1hourly'])

Precip['Timu1daily'] = Precip['Timu1'].resample('D', how='sum')
Precip['Timu1daily'].dropna().to_csv(datadir + 'OUTPUT/Timu1daily.csv',
                                     header=['Timu1daily'])

Precip['Timu1monthly'] = Precip['Timu1'].resample('MS',
Ejemplo n.º 4
0
#### LOAD MASTER_XL Data
print 'opening MASTER_DATA excel file...' + dt.datetime.now().strftime(
    '%H:%M:%S')
if 'XL' not in locals():
    print 'Opening XL...'
    XL = pd.ExcelFile(datadir + 'MASTER_DATA_NUUULI.xlsx')
if 'XL_Fagaalu' not in locals():
    print 'Opening XL_Fagaalu...'
    XL_Fagaalu = pd.ExcelFile(datadir + 'MASTER_DATA_FAGAALU.xlsx')
print 'MASTER_DATA opened: ' + dt.datetime.now().strftime('%H:%M:%S')

#### Import PRECIP Data
from precip_data import raingauge, AddTimu1, AddTimu1Hourly, AddTimu1Daily, AddTimu1Monthly

Precip = raingauge(XL, 'Timu-Nuuuli1',
                   0)  ## (path,sheet,shift) no header needed
Precip.columns = ['Timu-Nuuuli1']
Precip['Timu-Nuuuli1-15'] = Precip['Timu-Nuuuli1'].resample('15Min', how='sum')
Precip['Timu-Nuuuli1-hourly'] = Precip['Timu-Nuuuli1'].resample('60Min',
                                                                how='sum')
Precip['Timu-Nuuuli1-daily'] = Precip['Timu-Nuuuli1'].resample('1D', how='sum')

Timu_Nuuuli2 = raingauge(XL, 'Timu-Nuuuli2',
                         0)  ## (path,sheet,shift) no header needed
Precip['Timu-Nuuuli2'] = Timu_Nuuuli2['Events']
Precip['Timu-Nuuuli2-15'] = Precip['Timu-Nuuuli2'].resample('15Min', how='sum')
Precip['Timu-Nuuuli2-hourly'] = Precip['Timu-Nuuuli2'].resample('60Min',
                                                                how='sum')
Precip['Timu-Nuuuli2-daily'] = Precip['Timu-Nuuuli2'].resample('1D', how='sum')

#### Import WX STATION Data