Skip to content

Commit

Permalink
minor edits to post processing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
grasingerm committed Dec 17, 2021
1 parent b61d8f9 commit 95062a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
31 changes: 26 additions & 5 deletions scripts/aggregate_mcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,42 @@ using DelimitedFiles;
using Quadmath;
using DecFP;

if length(ARGS) != 4
println("usage: julia aggregate.jl <outfile> <indir> <pattern> <dielectric|polar>");
if length(ARGS) < 4
println("usage: julia aggregate.jl <outfile> <indir> <pattern> <dielectric|polar> [<3D|2D>]");
exit(1);
end

dims = if length(ARGS) == 5
if ARGS[5] == "2D"
2
elseif ARGS[5] == "3D"
3
else
println("usage: julia aggregate.jl <outfile> <indir> <pattern> <dielectric|polar> [<3D|2D>]");
exit(1);
end
else
3
end

outfile = open(ARGS[1], "w");
indir = ARGS[2];
pattern = Glob.GlobMatch(ARGS[3]);

if ARGS[4] == "dielectric"
writedlm(outfile, ["E0" "K1" "K2" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "r3" "lambda1" "lambda2" "lambda3" "r1sq" "r2sq" "r3sq" "rsquared" "p1" "p2" "p3" "p1sq" "p2sq" "p3sq" "psquared" "U" "Usquared" "AR"], ',');
if dims == 3
writedlm(outfile, ["E0" "K1" "K2" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "r3" "lambda1" "lambda2" "lambda3" "r1sq" "r2sq" "r3sq" "rsquared" "p1" "p2" "p3" "p1sq" "p2sq" "p3sq" "psquared" "U" "Usquared" "AR"], ',');
else
writedlm(outfile, ["E0" "K1" "K2" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "lambda1" "lambda2" "r1sq" "r2sq" "rsquared" "p1" "p2" "p1sq" "p2sq" "psquared" "U" "Usquared" "AR"], ',');
end
elseif ARGS[4] == "polar"
writedlm(outfile, ["E0" "mu" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "r3" "lambda1" "lambda2" "lambda3" "r1sq" "r2sq" "r3sq" "rsquared" "p1" "p2" "p3" "p1sq" "p2sq" "p3sq" "psquared" "U" "Usquared" "AR"], ',');
if dims == 3
writedlm(outfile, ["E0" "mu" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "r3" "lambda1" "lambda2" "lambda3" "r1sq" "r2sq" "r3sq" "rsquared" "p1" "p2" "p3" "p1sq" "p2sq" "p3sq" "psquared" "U" "Usquared" "AR"], ',');
else
writedlm(outfile, ["E0" "mu" "kT" "Fz" "Fx" "n" "b" "r1" "r2" "lambda1" "lambda2" "r1sq" "r2sq" "rsquared" "p1" "p2" "p1sq" "p2sq" "psquared" "U" "Usquared" "AR"], ',');
end
else
println("I don't understand the last argument");
println("I don't understand the second to last argument");
exit(1);
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/compare_mcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using Logging;
using Printf;

if length(ARGS) != 2
println("usage: julia statistical_analysis_mcmc.jl <indir> <subpattern>");
println("usage: julia compare_mcmc.jl <indir> <subpattern>");
exit(1);
end

Expand Down

0 comments on commit 95062a3

Please sign in to comment.