Skip to content

Commit

Permalink
Changed export defaults. Always exports info now
Browse files Browse the repository at this point in the history
  • Loading branch information
Spokhim committed Sep 6, 2020
1 parent 9c8af03 commit f64f42a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions SimulationPipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f64f42a

Please sign in to comment.