clean up params files

parent fad61739
Pipeline #163711 passed with stages
in 2 minutes and 19 seconds
......@@ -1109,8 +1109,26 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
{
int k;
// Print all parameters (as used in sampler, not converted to usal formats)
for(k=0; k<bayescbc->NP; k++) fprintf(fptr,"%f\t", bayescbc->pallx[ic][k]);
double Mchirp = exp(bayescbc->pallx[ic][0])/LAL_MSUN_SI;
double Mtot = exp(bayescbc->pallx[ic][1])/LAL_MSUN_SI;
double eta = pow((Mchirp/Mtot), (5.0/3.0));
double dm = sqrt(1.0-4.0*eta);
double m1 = Mtot*(1.0+dm)/2.0;
double m2 = Mtot*(1.0-dm)/2.0;
double chieff = (m1*bayescbc->pallx[ic][2]+m2*bayescbc->pallx[ic][3])/Mtot;
double DL = exp(bayescbc->pallx[ic][6])/(1.0e6*LAL_PC_SI); // includes conversion to Mpc
double z = z_DL(DL);
double tc =bayescbc->pallx[ic][5]-(Tobs-2.0);
fprintf(fptr,"%f %f %f %f ", m1/(1.0+z), m2/(1.0+z), Mchirp/(1.0+z), Mtot/(1.0+z)); //mass parameters in detector frame
fprintf(fptr,"%f %f %f ", bayescbc->pallx[ic][2], bayescbc->pallx[ic][3], chieff); //spin parameters: a1, a2, chieff
fprintf(fptr,"%f %f ", bayescbc->pallx[ic][4], bayescbc->pallx[ic][5]); //phase and time
fprintf(fptr,"%f %f ", DL, z); //distance, redshift
fprintf(fptr,"%f %f %f %f ", bayescbc->pallx[ic][bayescbc->NX], bayescbc->pallx[ic][bayescbc->NX+1], bayescbc->pallx[ic][bayescbc->NX+2], bayescbc->pallx[ic][bayescbc->NX+3]);//ra, sindec, psi, cosiota
fprintf(fptr,"%f %f %f %f ", m1, m2, Mchirp, Mtot); //mass parameters in source frame
fprintf(fptr,"\n");
// The below is for recreating the QuickCBC allchain file units
......@@ -1118,16 +1136,7 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
if (bayescbc->verbose==1)
{
double Mchirp = exp(bayescbc->pallx[ic][0])/LAL_MSUN_SI;
double Mtot = exp(bayescbc->pallx[ic][1])/LAL_MSUN_SI;
double eta = pow((Mchirp/Mtot), (5.0/3.0));
double dm = sqrt(1.0-4.0*eta);
double m1 = Mtot*(1.0+dm)/2.0;
double m2 = Mtot*(1.0-dm)/2.0;
double chieff = (m1*bayescbc->pallx[ic][2]+m2*bayescbc->pallx[ic][3])/Mtot;
double DL = exp(bayescbc->pallx[ic][6])/(1.0e6*LAL_PC_SI); // includes conversion to Mpc
double z = z_DL(DL);
// TODO: Add suport below for converting & printing neutron star tidal parameters
// if (NX > 7) {
......@@ -1148,7 +1157,7 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
// } else {
// Merger time is printed relative to trigger time, which is at Tobs-2.
double tc =bayescbc->pallx[ic][5]-(Tobs-2.0);
// [0] log(Mc) [1] log(Mt) [2] chi1 [3] chi2 [4] phi0 [5] tp [6] log(DL) [7] alpha [8] sindelta [9] psi [10] ciota
// counter, log likelihood, chirp mass (DF), total mass (DF), effective spin, geocenter orbital phase, geocenter arrival time, distance, RA , sine of DEC,
......
......@@ -402,7 +402,7 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior
//Parameters for reproducing CBC model
if(data->cbcFlag)
{
sprintf(filename,"chains/cbc_model.dat.%i",ic);
sprintf(filename,"chains/%s_params.dat.%i",modelname,ic);
chain->cbcChainFile[ic] = fopen(filename,"w");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment