Commit c76f1627 authored by Qi Chu's avatar Qi Chu
Browse files

f_final population in trigger table

parent 4e20875c
......@@ -1234,6 +1234,7 @@ static int cuda_postcoh_write_table_to_buf(CudaPostcoh *postcoh, GstBuffer *outb
cur_tmplt_idx = pklist->tmplt_idx[peak_cur];
XLALINT8NSToGPS(&end_time, ts);
// NOTE: adjust for the merger/epoch time of the trigger
GST_DEBUG_OBJECT(postcoh, "cur time %" GST_TIME_FORMAT ", sngl end time %d", GST_TIME_ARGS(ts), sngl_table[cur_tmplt_idx].end.gpsSeconds);
XLALGPSAddGPS(&end_time, &(sngl_table[cur_tmplt_idx].end));
len_cur = pklist->len_idx[peak_cur];
XLALGPSAdd(&(end_time), (double) len_cur/exe_len);
......@@ -1290,6 +1291,7 @@ static int cuda_postcoh_write_table_to_buf(CudaPostcoh *postcoh, GstBuffer *outb
output->spin2y = sngl_table[tmplt_idx].spin2y;
output->spin2z = sngl_table[tmplt_idx].spin2z;
output->eta = sngl_table[tmplt_idx].eta;
output->f_final = sngl_table[tmplt_idx].f_final;
/* convert pixel index to ra and dec */
double theta, phi;
/* ra = phi, dec = pi/2 - theta */
......
......@@ -27,7 +27,7 @@
#include <cuda_runtime.h>
//#define __DEBUG__ 0
#define NSNGL_TMPLT_COLS 14
#define NSNGL_TMPLT_COLS 15
void cuda_device_print(int deviceCount)
{
......@@ -625,7 +625,8 @@ char * ColNames[] = {
"sngl_inspiral:spin2z",
"sngl_inspiral:eta",
"sngl_inspiral:end_time",
"sngl_inspiral:end_time_ns"
"sngl_inspiral:end_time_ns",
"sngl_inspiral:f_final"
};
void
......@@ -725,6 +726,10 @@ cuda_postcoh_sngl_tmplt_from_xml(char *fname, SnglInspiralTable **psngl_table)
#endif
}
val = g_hash_table_lookup(hash, col_names[14]);
for (jlen=0; jlen<val->data->len; jlen++)
sngl_table[jlen].f_final = g_array_index(val->data, float, jlen);
/* free memory */
freeTable(xtable);
free(xtable);
......
......@@ -95,6 +95,7 @@ tagPostcohInspiralTable
REAL8 deff_L;
REAL8 deff_V;
REAL8 rank;
REAL4 f_final;
LIGOTimeGPS epoch;
double deltaT;
size_t snr_length;
......
......@@ -1031,7 +1031,7 @@ class CoincsDocFromPostcoh(object):
row.alpha5 = 0
row.alpha6 = 0
row.beta = 0
row.f_final = 2048
row.f_final = trigger.f_final
row.snr = getattr(trigger, "snglsnr_%s" % ifo[0])
row.chisq = getattr(trigger, "chisq_%s" % ifo[0])
row.chisq_dof = 4
......
......@@ -126,6 +126,7 @@ static struct PyMemberDef members[] = {
{"deff_L", T_DOUBLE, offsetof(gstlal_GSTLALPostcohInspiral, row.deff_L), 0, "deff_L"},
{"deff_H", T_DOUBLE, offsetof(gstlal_GSTLALPostcohInspiral, row.deff_H), 0, "deff_H"},
{"deff_V", T_DOUBLE, offsetof(gstlal_GSTLALPostcohInspiral, row.deff_V), 0, "deff_V"},
{"f_final", T_FLOAT, offsetof(gstlal_GSTLALPostcohInspiral, row.f_final), 0, "f_final"},
{"_process_id", T_LONG, offsetof(gstlal_GSTLALPostcohInspiral, row.process_id), 0, "process_id (long)"},
{"_event_id", T_LONG, offsetof(gstlal_GSTLALPostcohInspiral, row.event_id), 0, "event_id (long)"},
{NULL,}
......
......@@ -10,7 +10,7 @@ dbtables.ligolwtypes.ToPyType["ilwd:char"] = unicode
PostcohInspiralID = ilwd.get_ilwdchar_class(u"postcoh", u"event_id")
# defined in postcohinspiral_table.h
# need to be consistent with the table defined in postcohinspiral_table.h
class PostcohInspiralTable(table.Table):
tableName = "postcoh"
validcolumns = {
......@@ -74,6 +74,7 @@ class PostcohInspiralTable(table.Table):
"spin2y": "real_4",
"spin2z": "real_4",
"eta": "real_4",
"f_final": "real_4",
"ra": "real_8",
"dec": "real_8",
"deff_L": "real_8",
......
Supports Markdown
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