def run_pecube_map(faultParamsListFiltered): [initA, accel, srA1, srA2, initB, srB1, srB2] = faultParamsListFiltered netExtension = psc.calcNetExtension(initA, accel, srA1, srA2, dipFaultA, initB, srB1, srB2, dipFaultB) # test for amount of extension (maybe do this with a filter function # or something similar when making the variable list) # modify input files, psc.modifyInputFiles(initA, accel, srA1, srA2, initB, srB1, srB2, inputFile, outputFile) #rename fault parameters psc.renameFaultParams(inputFile, outputFile) # run pecube pecube_print = psc.run_pecube_cloud() # save output out_name = psc.save_output(comparison_file, initA, accel, srA1, srA2, initB, srB1, srB2) # calculate chi square chi_square = psc.calc_chi_square(obs, out_name) # append results to results file(s) out_array = psc.append_info(out_name, chi_square, initA, accel, srA1, srA2, initB, srB1, srB2, netExtension) #cloud.files.get(out_array, '/home/itchy/src/Pecube/picloud/results/cctrN/{}'.format(out_array)) return pecube_print
# define list of variable lists faultParamsList = [[j, k, l, m, n, o, p] for j in initFaultAs for k in accelFaults for l in slipRate1FaultAs for m in slipRate2FaultAs for n in initFaultBs for o in slipRate1FaultBs for p in slipRate2FaultBs ] #t1 = time.time() #print t1-t0, 's to generate fault list' # filter variables faultParamsListFiltered = [] for faultParams in faultParamsList: [initA, accel, srA1, srA2, initB, srB1, srB2] = faultParams netExtension = psc.calcNetExtension(initA, accel, srA1, srA2, dipFaultA, initB, srB1, srB2, dipFaultB) #print netExtension if netExtension < 10.5: if netExtension >10: faultParamsListFiltered.append(faultParams) print len(faultParamsListFiltered) def run_pecube_map(faultParamsListFiltered): [initA, accel, srA1, srA2, initB, srB1, srB2] = faultParamsListFiltered