def processing(): #Reading the configfile specifications = readConfig() number = specifications[0] filenames = specifications[1] species = specifications[2] horizontalGridLat = specifications[3] horizontalGridLon = specifications[4] verticalGrid = specifications[5] output = specifications[6] filename = specifications[7] airden = specifications[8] airdenfiles = specifications[9] apriori = specifications[10] aks = specifications[11] modeloutput = [] modeloutputFilenames = [] airdenFilenames = [] cache = [] if(airden == "False" or airden == "false" or airden == "0" or airden == "no" or airden == "No"): airden = False else: airden = True aksNew = [] apriori = pr.preprocessing(apriori) for elem in aks: aksNew.append(pr.preprocessing(elem)) for i in range(number): if(airden): print("Processing Air density..") airdenFilenames.append(density.airden(airdenfiles[i], verticalGrid, output)) print("Processing Air density: Done!") print("Processing ASCII-Files: {}/{}".format(i+1,number)) nameOfFile = a2d.ipAscii(filenames[i], species, horizontalGridLat, horizontalGridLon, verticalGrid, output) print("Interpolating the model..") cache = pm.interpolateModel(filename, species, nameOfFile, verticalGrid, output) modeloutputFilenames.append(cache) print("Interpolation: Done!") print("Processing ASCII-Files: Done!") print("Computing total column...") for i in range(number): tc.createTC(filenames[i], apriori, species, aksNew[i], output, modeloutputFilenames[i], airdenFilenames) print("Computing total column: Done!") return
def processing(): # Reading the configfile specifications = readConfig() number = specifications[0] filenames = specifications[1] species = specifications[2] horizontalGridLat = specifications[3] horizontalGridLon = specifications[4] verticalGrid = specifications[5] output = specifications[6] retrieval = specifications[7] airden = specifications[8] airdenfiles = specifications[9] apriori = specifications[10] aks = specifications[11] try: akssza = specifications[12] except IndexError: akssza = None modeloutputFilenames = [] airdenFilenames = [] cache = [] if airden == "False" or airden == "false" or airden == "0" or airden == "no" or airden == "No": airden = False else: airden = True aksNew = [] apriori = pr.preprocessing(apriori) for elem in aks: print("Preprocessing {}".format(elem)) aksNew.append(pr.preprocessing(elem)) for i in range(number): print("Processing ASCII-Files: {}/{}".format(i + 1, number)) if airden: print("Processing Air density..") airdenFilenames.append(density.airden(airdenfiles[i], verticalGrid, output)) print("Processing Air density: Done!") nameOfFile = a2d.ipAscii(filenames[i], species, horizontalGridLat, horizontalGridLon, verticalGrid, output) print("Interpolating the model..") cache = pm.interpolateModel(retrieval, species, nameOfFile, verticalGrid, output) modeloutputFilenames.append(cache) print("Interpolation: Done!") print("Processing ASCII-Files: Done!") print("Computing total column...") for i in range(number): print(aksNew[i]) tc.createTC( filenames[i], apriori, species, output, modeloutputFilenames[i][0], airdenFilenames, akssza, aksNew[i] ) print("Computing total column: Done!") print("Delete temporary files ...") f = open("./config.dat", "r") directory = f.readlines()[-2].split(":")[1].rstrip() for temporary in os.listdir(directory): if "PROCESSED" in temporary: os.remove("{}{}".format(directory, temporary)) print("Delete temporary files: Done!") return