year = '10' month = '04' day = range(01,31) hour = range(0,24,6) totalruns = len(stations)*len(day)*len(hour)*len(heights) runs = 0 #select meteorology files meteo_list = tools.get_files('Select Meteorology Files') meteo_files = meteo_list.split() #set output directory output_dir = tools.set_dir('Select Output Directory') for s in stations: for d in day: for h in hour: for z in heights: start_time = [year,month,d,h] run_hours = '-240' tools.control_single(s,start_time,run_hours,z,meteo_files,output_dir) startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW proc = subprocess.call('c:/hysplit4/exec/hyts_std', startupinfo=startupinfo) runs += 1
for n in range(0,len(a['station'])): aerodate = a['date'][n,2] if aerodate in hydates: for key in a.keys(): try: tempdict[key].append(a[key][n]) except KeyError: tempdict[key] = a[key][n] except AttributeError: tempdict[key] = np.vstack((tempdict[key],a[key][n])) aerolist_mod.append(tempdict) output_dict = {'Hysplit':hylist,'Aeronet':aerolist_mod} scipy.io.savemat('Combproc',output_dict) if __name__ == '__main__': import hysplit_tools as tools aerofilt_topdir = tools.set_dir('Select Top Level Directory') print 'Generating Aeronet Processed Data File' aeroproc(aerofilt_topdir) print 'Generating Hysplit Processed Data File' traceproc(aerofilt_topdir) ## print 'Generating Aeronet Combined Data File' ## combproc(aerofilt_topdir)
import numpy as np import scipy.io import os, sys # STEP #1: Filter original Hysplit files to include only days that have aeronet data level = "15" aerofilt_dir = "K:\Hysplit\AEROFILT" os.chdir(aerofilt_dir) startdir = os.getcwd() aeronet_file = tools.get_files("Choose Aeronet File", ("Aeronet Files", "*.Dubovik")) hysplit_path = tools.set_dir("Select Hysplit Directory") hydir = os.path.split(hysplit_path)[1] tools.aeronet_dayfilter(level, aeronet_path[1:-1], aerofilt_dir, hysplit_path) # STEP #2: Convert aeronet file and filtered hysplit files to .mat format tools.hysplit_matfile_generator(level, hydir, aerofilt_dir) tools.aeronet_matfile_generator(level, aeronet_file[1:-1], hydir, aerofilt_dir) # STEP #3: Generate Hysplit traceback file traceback.traceback(level, hydir, aerofilt_dir)
import scipy.io import os, sys #STEP #1: Filter original Hysplit files to include only days that have aeronet data level = '15' aerofilt_dir = 'K:\Hysplit\AEROFILT' os.chdir(aerofilt_dir) startdir = os.getcwd() aeronet_file = tools.get_files('Choose Aeronet File', ('Aeronet Files', '*.Dubovik')) hysplit_path = tools.set_dir('Select Hysplit Directory') hydir = os.path.split(hysplit_path)[1] tools.aeronet_dayfilter(level, aeronet_path[1:-1], aerofilt_dir, hysplit_path) #STEP #2: Convert aeronet file and filtered hysplit files to .mat format tools.hysplit_matfile_generator(level, hydir, aerofilt_dir) tools.aeronet_matfile_generator(level, aeronet_file[1:-1], hydir, aerofilt_dir) #STEP #3: Generate Hysplit traceback file traceback.traceback(level, hydir, aerofilt_dir)
year = "10" month = "04" day = range(01, 31) hour = range(0, 24, 6) totalruns = len(stations) * len(day) * len(hour) * len(heights) runs = 0 # select meteorology files meteo_list = tools.get_files("Select Meteorology Files") meteo_files = meteo_list.split() # set output directory output_dir = tools.set_dir("Select Output Directory") for s in stations: for d in day: for h in hour: for z in heights: start_time = [year, month, d, h] run_hours = "-240" tools.control_single(s, start_time, run_hours, z, meteo_files, output_dir) startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW proc = subprocess.call("c:/hysplit4/exec/hyts_std", startupinfo=startupinfo) runs += 1
aerodate = a['date'][n, 2] if aerodate in hydates: for key in a.keys(): try: tempdict[key].append(a[key][n]) except KeyError: tempdict[key] = a[key][n] except AttributeError: tempdict[key] = np.vstack( (tempdict[key], a[key][n])) aerolist_mod.append(tempdict) output_dict = {'Hysplit': hylist, 'Aeronet': aerolist_mod} scipy.io.savemat('Combproc', output_dict) if __name__ == '__main__': import hysplit_tools as tools aerofilt_topdir = tools.set_dir('Select Top Level Directory') print 'Generating Aeronet Processed Data File' aeroproc(aerofilt_topdir) print 'Generating Hysplit Processed Data File' traceproc(aerofilt_topdir) ## print 'Generating Aeronet Combined Data File' ## combproc(aerofilt_topdir)