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_v2 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)
year = '10' month = '03' day = [24]#range(10,13) 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] 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 complete = 100.0*runs/totalruns print_time = ' '
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_v2 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 hysplit_traceback_single as traceback import file_process_tools as proc import numpy as np import scipy.io import os, sys #STEP #1: Filter original Hysplit files to include only days that have aeronet data aerofilt_topdir = 'F:\Hysplit\AEROFILT' os.chdir(aerofilt_topdir) startdir = os.getcwd() aeronet_path = tools.get_files('Choose Aeronet File', ('Aeronet Files', '*.dubovik')) hysplit_path = tools.set_dir('Select Hysplit Directory') aerofilt_dir = tools.aeronet_dayfilter(aeronet_path[1:-1], aerofilt_topdir, hysplit_path) #STEP #2: Convert aeronet file and filtered hysplit files to .mat format tools.hysplit_matfile_generator(aerofilt_dir) tools.aeronet_matfile_generator(aeronet_path[1:-1], aerofilt_dir) #STEP #3: Generate Hysplit traceback file traceback.traceback(aerofilt_dir)
import file_process_tools as proc import numpy as np import scipy.io import os,sys #STEP #1: Filter original Hysplit files to include only days that have aeronet data aerofilt_topdir = 'F:\Hysplit\AEROFILT' os.chdir(aerofilt_topdir) startdir = os.getcwd() aeronet_path = tools.get_files('Choose Aeronet File',('Aeronet Files','*.dubovik')) hysplit_path = tools.set_dir('Select Hysplit Directory') aerofilt_dir = tools.aeronet_dayfilter(aeronet_path[1:-1],aerofilt_topdir,hysplit_path) #STEP #2: Convert aeronet file and filtered hysplit files to .mat format tools.hysplit_matfile_generator(aerofilt_dir) tools.aeronet_matfile_generator(aeronet_path[1:-1],aerofilt_dir) #STEP #3: Generate Hysplit traceback file traceback.traceback(aerofilt_dir)
hour = range(0,24,6) totalruns = len(stations)*len(day)*len(hour)*len(heights) runs = 0 #select meteorology files olddir = os.getcwd() os.chdir('C:\hysplit4\meteo') meteo_list = tools.get_files('Select Meteorology Files') meteo_files = meteo_list.split() #set output directory os.chdir('C:\Hysplit') 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] 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 complete = 100.0*runs/totalruns print_time = ' '