diff --git a/SimulationPipeline.py b/SimulationPipeline.py index f467d48..4ab9b0f 100644 --- a/SimulationPipeline.py +++ b/SimulationPipeline.py @@ -177,25 +177,26 @@ def Simul_Pipeline(ParamsDict): # Concancatanate to end of Scorr output file. Scorr = Scorr + FCFC - # Export the simulation if requested - - if ParamsDict["ExportSim"] == True: - time_now = time.strftime("%Y%m%d-%H%M%S") - date = time.strftime("%Y_%m_%d/") - # Create new directory which is the date. - os.makedirs("do-not-track/" + date,exist_ok=True) - - # Params Dictionary - Note how we sort the dictionary. - with open("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_Params_" + time_now + "_.csv", "w") as outfile: - writer = csv.writer(outfile) - for key, val in sorted(ParamsDict.items()): - writer.writerow([key, val]) - + # Export the simulation information + time_now = time.strftime("%Y%m%d-%H%M%S") + date = time.strftime("%Y_%m_%d/") + # Create new directory which is the date. + os.makedirs("do-not-track/" + date,exist_ok=True) + + # Params Dictionary - Note how we sort the dictionary. + with open("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_Params_" + time_now + "_.csv", "w") as outfile: + writer = csv.writer(outfile) + for key, val in sorted(ParamsDict.items()): + writer.writerow([key, val]) + + np.savetxt("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_FCM_" + time_now + "_.csv", FCM, delimiter = "\t") + np.savetxt("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_Scorr_" + time_now + "_.csv", Scorr, delimiter = "\t") + +# Export the time series simulation (which is a large file) + if ParamsDict["ExportSim"] == True: # Create Time Series and save. TSeries = np.concatenate((bold_time[Snip:].reshape(1,len(bold_time[Snip:])),TSeriesMatrix)) np.savetxt("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_Tseries_" + time_now + "_.csv", TSeries, delimiter="\t") - np.savetxt("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_FCM_" + time_now + "_.csv", FCM, delimiter = "\t") - np.savetxt("do-not-track/" + date + ParamsDict["tag"] + "_" + ParamsDict["name"] + "_Scorr_" + time_now + "_.csv", Scorr, delimiter = "\t") return Scorr