if hostname.find('petb227a') >= 0: # This is the hostname for gaia. in_d = '/mnt/data/lima/iaq/maca/' out_d = '/mnt/data/lima/iaq/contam/weatherFiles/' elif hostname.find('sila') >= 0: in_d = '/Volumes/vonw/data/iaq/maca/' out_d = '/Volumes/vonw/data/iaq/contam/weatherFiles/' else: print('Not a valid computer for access to MACA data. Try again...') sys.exit() rcps = ['4.5', '8.5'] #rcps = ['8.5'] #years = [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019] years = [2048, 2052] # leap years #years = [2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054] #years = [2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098] #years = [2092, 2096] # leap years cities = pd.read_csv(in_d + 'iaq_cities.csv') models = ['CCSM4','CNRM-CM5','GFDL-ESM2M','HadGEM2-ES365','IPSL-CM5A-LR','MIROC-ESM','MIROC5'] #model = 'CNRM-CM5' for year in years: for row, city in cities.iterrows(): for rcp in rcps: for model in models: print('Processing: ' + str(year) + ' ' + city.city + ' ' + model + ' ' + rcp) wth = readMACA(city,year,rcp,model) writeContamWeatherFile(out_d + city.city + '_' + str(year) + '_' + str(rcp) + '_' + model + '.wth', wth)
'H007_winter_weather_final_contam.csv', 'H008_summer_weather_final_contam.csv', 'H008_winter_weather_final_contam.csv', 'H009_summer_weather_final_contam.csv', 'H009_winter_weather_final_contam.csv', 'H010_summer_weather_final_contam.csv', 'H010_winter_weather_final_contam.csv'] for fn in fns: print('Processing: ', d + fn) # Read the weather data and create a dataframe wth = readHouseData(d + fn) # Write the weather data to a contam wth file writeContamWeatherFile(d + fn.split('/')[-1][:11] + '.wth', wth) # Create summary figure output_file(d + fn.split('/')[-1][:11] + '.html') p1 = figure(plot_width=1000, plot_height=250, x_axis_type='datetime', x_axis_label='Time (local)', y_axis_label='Pressure (Pa)', title=fn.split('/')[-1][:11]) p1.scatter(wth.index, wth.Pb, color='blue') p2 = figure(plot_width=1000, plot_height=250, x_axis_type='datetime',
# -*- coding: utf-8 -*- """ Created on Thu Jun 7 12:42:28 2018 @author: Von P. Walden, Washington State University """ import pandas as pd from contam_input import readMACA, writeContamWeatherFile d = '/Volumes/vonw/data/iaq/maca/' cities = pd.read_csv(d + 'iaq_cities.csv') city = cities.iloc[0] year = 2010 rcp = 8.5 model = 'CNRM-CM5' wth = readMACA(city, year, rcp, model) writeContamWeatherFile( '/Users/vonw/Desktop/' + city.city + '_' + str(year) + '_' + str(rcp) + '_' + model + '.wth', wth)
# -*- coding: utf-8 -*- """ Created on Fri Jun 2 15:36:24 2017 @author: Von P. Walden, Washington State University """ from contam_input import readWRF_CMAQ, writeContamWeatherFile gridFile = '/Users/vonw/data/iaq/cmaq/GRIDCRO2D_19941215' dataFile = '/Users/vonw/data/iaq/cmaq/extr/rcp8.5/2040ei_v6_cb05v2_ref_RCP8.5.combine.aconc.2050.01' lat = 46.7 lon = -117.2 df = readWRF_CMAQ(gridFile, dataFile, lat, lon) wthrFile = '/Users/vonw/data/iaq/cmaq/tmp.wth' writeContamWeatherFile(wthrFile, df)
# -*- coding: utf-8 -*- """ Created on Tue Nov 14 09:36:49 2017 @author: Von P. Walden, Washington State University """ from contam_input import readNOAA_ISH, writeContamWeatherFile import pandas as pd import numpy as np stations = pd.read_csv('/Volumes/vonw/data/iaq/NCDC/ish/isd-history-IAQ.csv') for station in stations.itertuples(): print(station.CITY) for year in np.arange(2004, 2014): print(year) if ((station.CITY == 'Worcester') and (year < 2010)): continue df = readNOAA_ISH(str(station.USAF), str(station.WBAN), year) writeContamWeatherFile( '/Volumes/vonw/data/iaq/contam/weatherFiles/' + station.CITY + '_' + str(year) + '.wth', df)