commit 4bdfcc45d50e0c057f7b42f611d17e7693ab48fb
parent 3c32f710d758a88018e440f17803fe091e1493fc
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Mon, 7 Dec 2015 14:25:42 +0100
generate CSV file of results
Diffstat:
2 files changed, 123 insertions(+), 1 deletion(-)
diff --git a/index.php b/index.php
@@ -148,8 +148,11 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
deviation from the others, remove it from the data
set. NaN results in total erosion rate mean that the rate
exceeds values which are possible to constrain.</p>
-
</div>
+ <div class="card-action">
+ <a href="output/<?php
+ echo($_GET['results_id']); ?>_Walks.csv"
+ target="_blank">Link to CSV (import to Excel)</a>
</div>
</div>
</div>
diff --git a/matlab/generate_plots.m b/matlab/generate_plots.m
@@ -836,6 +836,125 @@ fileID = fopen(filename,'w');
fprintf(fileID, html);
fclose(fileID);
+%% generate csv table of results
+filename = [save_file, '.csv'];
+disp('Saving CSV table of results')
+% header
+csv = [...
+ 'Parameter;Percentile;'];
+
+for i=1:Nwalkers
+ csv = [csv, ...
+ 'Walker ', num2str(i), ';'];
+end
+
+% epsilon_int
+csv = [csv, ...
+ 'Average\n'...
+ ';25%%;'];
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_int_25(i),3),';'];
+end
+
+csv = [csv, num2str(sum(epsilon_int_25)/Nwalkers,3),'\n'...
+ 'epsilon_int [m/Myr];50%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_int_50(i),3),';'];
+end
+
+
+csv = [csv, num2str(sum(epsilon_int_50)/Nwalkers,3),'\n'...
+ ';75%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_int_75(i),3),';'];
+end
+
+csv = [csv, num2str(sum(epsilon_int_75)/Nwalkers,3),'\n'];
+
+
+% epsilon_gla
+csv = [csv, ...
+ 'Average\n'...
+ ';25%%;'];
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_gla_25(i),3),';'];
+end
+
+csv = [csv, num2str(sum(epsilon_gla_25)/Nwalkers,3),'\n'...
+ 'epsilon_gla [m/Myr];50%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_gla_50(i),3),';'];
+end
+
+
+csv = [csv, num2str(sum(epsilon_gla_50)/Nwalkers,3),'\n'...
+ ';75%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(epsilon_gla_75(i),3),';'];
+end
+
+csv = [csv, num2str(sum(epsilon_gla_75)/Nwalkers,3),'\n'];
+
+% record_threshold
+csv = [csv, ...
+ 'Average\n'...
+ ';25%%;'];
+for i=1:Nwalkers
+ csv = [csv, num2str(record_threshold_25(i),3),';'];
+end
+
+csv = [csv, num2str(sum(record_threshold_25)/Nwalkers,3),'\n'...
+ 'd18O_threshold [permille];50%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(record_threshold_50(i),3),';'];
+end
+
+
+csv = [csv, num2str(sum(record_threshold_50)/Nwalkers,3),'\n'...
+ ';75%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(record_threshold_75(i),3),';'];
+end
+
+csv = [csv, num2str(sum(record_threshold_75)/Nwalkers,3),'\n'];
+
+
+% E
+csv = [csv, ...
+ 'Average\n'...
+ ';25%%;'];
+for i=1:Nwalkers
+ csv = [csv, num2str(E_25(i),3),';'];
+end
+
+csv = [csv, num2str(sum(E_25)/Nwalkers,3),'\n'...
+ 'E [m/Myr];50%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(E_50(i),3),';'];
+end
+
+
+csv = [csv, num2str(sum(E_50)/Nwalkers,3),'\n'...
+ ';75%%;'];
+
+for i=1:Nwalkers
+ csv = [csv, num2str(E_75(i),3),';'];
+end
+
+csv = [csv, num2str(sum(E_75)/Nwalkers,3),'\n'];
+
+
+fileID = fopen(filename,'w');
+fprintf(fileID, csv);
+fclose(fileID);
+
%% generate html table of input parameters
filename = [save_file, '-input.html'];