-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaps_extraction_runner.cpp
More file actions
75 lines (54 loc) · 2.21 KB
/
aps_extraction_runner.cpp
File metadata and controls
75 lines (54 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
This code gives an example of how to use the aps_extractor class defined
in aps_extractor.h and aps_extractor.cpp to take the output from APS and
return both Frequentist confidence limits and Bayesian credible limits.
This file can be compiled using
make aps_extract
the executable aps_extract will then run this file
*/
#include "aps_extractor.h"
int main(){
char sizeflag[100];
char outname[letters];
aps_extractor apsExtractorObj;
/*set the name of the file where the APS data is stored
note that the data file referred to here is not a part of the repository
*/
apsExtractorObj.set_filename("aps_output/WMAP/apsWMAP_unitSphere_GaussLearn_output.sav");
/*
set the delta chisquared so that
chisquared_lim = chisquared_min + delta chisquared
12.6 is the delta chisquared corresponding to the 95% Frequentist
confidence limit for a chisquared distribution with 6 degrees of freedom
*/
apsExtractorObj.set_delta_chi(12.6);
/*one could alternative set chisquared_lim by hand using*/
//apsExtractorObj.set_target(1283.3)
/*optionally set the maximum number of points from the data file to use*/
//apsExtractorObj.set_cutoff(47000);
/*select out only those points with chisquared < chisquared_lim and print them to the output file*/
apsExtractorObj.write_good_points("aps_processed/WMAP/frequentist/gaussLearn_good_points.sav");
/*plot chisquared_min discovered as a function of the number of samples*/
apsExtractorObj.plot_chimin("aps_chi_min_test.sav");
/*
The code below draws Frequentist and Bayesian limits in 2-dimensional sub-spaces of the
parameter space
*/
int i,j;
for(i=0;i<6;i++){
for(j=i+1;j<6;j++){
if(i!=3 && j!=3){
sprintf(outname,"aps_processed/WMAP/bayesian/gaussLearn_%d_%d_bayes.sav",i,j);
/*
Below:
the first argument is the name of the output file.
the second and third arguments denote which dimensions to plot.
the fourth argument is the confidence limit to plot
*/
apsExtractorObj.draw_bayesian_bounds(outname,i,j,0.95);
sprintf(outname,"aps_processed/WMAP/frequentist/gaussLearn_%d_%d_frequentist.sav",i,j);
apsExtractorObj.write_good_points(outname,i,j);
}
}
}
}