Commit af9cc4d5 authored by Cody Messick's avatar Cody Messick

Removed hardcoded_srcbuf_crap function from itacac. This involves changing how...

Removed hardcoded_srcbuf_crap function from itacac. This involves changing how the snr time series are stored in the buffer passed to python, meaning the from_buffer function in snglinspiraltable.c had to be modified. The order of the snr time series were also changed, resulting in minor changes to gstlal_snglinspiral.c and snglinspiralrowtype.c.
parent 623dab93
This diff is collapsed.
......@@ -133,7 +133,6 @@ typedef struct {
GstClockTime initial_timestamp;
guint samples_available_for_padding;
GList *next_in_coinc_order;
} GSTLALItacacPad;
......@@ -158,6 +157,7 @@ typedef struct {
GMutex snr_lock;
gboolean waiting;
guint test;
GSTLALItacacPad *H1_itacacpad, *K1_itacacpad, *L1_itacacpad, *V1_itacacpad;
//guint max_coinc_window_samps;
......
......@@ -364,9 +364,9 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
* Populate the SNR snippet if available
* FIXME: only supported for single precision at the moment
*/
gsl_vector_complex_float_view L1_snr_vector_view, H1_snr_vector_view, V1_snr_vector_view, K1_snr_vector_view;
gsl_vector_complex_float_view L1_snr_series_view, H1_snr_series_view, V1_snr_series_view, K1_snr_series_view;
if ((L1_snr_matrix_view || H1_snr_matrix_view || V1_snr_matrix_view || K1_snr_matrix_view) && !input->no_peaks_past_threshold)
gsl_vector_complex_float_view H1_snr_vector_view, K1_snr_vector_view, L1_snr_vector_view, V1_snr_vector_view;
gsl_vector_complex_float_view H1_snr_series_view, K1_snr_series_view, L1_snr_series_view, V1_snr_series_view;
if ((H1_snr_matrix_view || K1_snr_matrix_view || L1_snr_matrix_view || V1_snr_matrix_view) && !input->no_peaks_past_threshold)
{
/* Allocate a set of empty time series. The event takes ownership, so no need to free it*/
/* Get the columns of SNR we are interested in */
......@@ -375,6 +375,11 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
H1_snr_timeseries_length = H1_snr_vector_view.vector.size;
} else
H1_snr_timeseries_length = 0;
if(K1_snr_matrix_view != NULL) {
K1_snr_vector_view = gsl_matrix_complex_float_column(&(K1_snr_matrix_view->matrix), channel);
K1_snr_timeseries_length = K1_snr_vector_view.vector.size;
} else
K1_snr_timeseries_length = 0;
if(L1_snr_matrix_view != NULL) {
L1_snr_vector_view = gsl_matrix_complex_float_column(&(L1_snr_matrix_view->matrix), channel);
L1_snr_timeseries_length = L1_snr_vector_view.vector.size;
......@@ -385,13 +390,8 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
V1_snr_timeseries_length = V1_snr_vector_view.vector.size;
} else
V1_snr_timeseries_length = 0;
if(K1_snr_matrix_view != NULL) {
K1_snr_vector_view = gsl_matrix_complex_float_column(&(K1_snr_matrix_view->matrix), channel);
K1_snr_timeseries_length = K1_snr_vector_view.vector.size;
} else
K1_snr_timeseries_length = 0;
event = gstlal_snglinspiral_new(H1_snr_timeseries_length, L1_snr_timeseries_length, V1_snr_timeseries_length, K1_snr_timeseries_length);
event = gstlal_snglinspiral_new(H1_snr_timeseries_length, K1_snr_timeseries_length, L1_snr_timeseries_length, V1_snr_timeseries_length);
if(H1_snr_matrix_view != NULL) {
/* Make a GSL view of the time series array data */
......@@ -399,24 +399,24 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
/* Use BLAS to do the copy */
gsl_blas_ccopy (&(H1_snr_vector_view.vector), &(H1_snr_series_view.vector));
}
if(K1_snr_matrix_view != NULL) {
/* Make a GSL view of the time series array data */
K1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length]), event->K1_length);
/* Use BLAS to do the copy */
gsl_blas_ccopy (&(K1_snr_vector_view.vector), &(K1_snr_series_view.vector));
}
if(L1_snr_matrix_view != NULL) {
/* Make a GSL view of the time series array data */
L1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length]), event->L1_length);
L1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length + event->K1_length]), event->L1_length);
/* Use BLAS to do the copy */
gsl_blas_ccopy (&(L1_snr_vector_view.vector), &(L1_snr_series_view.vector));
}
if(V1_snr_matrix_view != NULL) {
/* Make a GSL view of the time series array data */
V1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length + event->L1_length]), event->V1_length);
V1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length + event->K1_length + event->L1_length]), event->V1_length);
/* Use BLAS to do the copy */
gsl_blas_ccopy (&(V1_snr_vector_view.vector), &(V1_snr_series_view.vector));
}
if(K1_snr_matrix_view != NULL) {
/* Make a GSL view of the time series array data */
K1_snr_series_view = gsl_vector_complex_float_view_array((float *) &(event->snr[event->H1_length + event->L1_length + event->V1_length]), event->K1_length);
/* Use BLAS to do the copy */
gsl_blas_ccopy (&(K1_snr_vector_view.vector), &(K1_snr_series_view.vector));
}
} else {
if(!provided_empty_trigger) {
//fprintf(stderr, "allocating snglinspiral with 0 length for %s event\n", bankarray[channel].ifo);
......@@ -475,9 +475,9 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
gst_memory_new_wrapped(
GST_MEMORY_FLAG_READONLY | GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS,
event,
sizeof(*event) + (event->H1_length + event->L1_length + event->V1_length + event->K1_length) * sizeof(event->snr[0]),
sizeof(*event) + (event->H1_length + event->K1_length + event->L1_length + event->V1_length) * sizeof(event->snr[0]),
0,
sizeof(*event) + (event->H1_length + event->L1_length + event->V1_length + event->K1_length) * sizeof(event->snr[0]),
sizeof(*event) + (event->H1_length + event->K1_length + event->L1_length + event->V1_length) * sizeof(event->snr[0]),
event,
(GDestroyNotify) gstlal_snglinspiral_free
)
......@@ -486,7 +486,7 @@ int populate_snglinspiral_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *in
return 0;
}
GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, GstClockTimeDiff timediff)
GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, GstClockTimeDiff timediff)
{
GstBuffer *srcbuf = gst_buffer_new();
......@@ -513,7 +513,7 @@ GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *in
return srcbuf;
}
int gstlal_snglinspiral_append_peak_to_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view)
int gstlal_snglinspiral_append_peak_to_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view)
{
//
// Add peak information to a buffer, GST_BUFFER_OFFSET cannot be
......
......@@ -52,8 +52,8 @@ void gstlal_snglinspiral_array_free(SnglInspiralTable *bankarray);
/*
* FIXME: only support single precision SNR snippets at the moment
*/
GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, GstClockTimeDiff);
int gstlal_snglinspiral_append_peak_to_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view);
GstBuffer *gstlal_snglinspiral_new_buffer_from_peak(struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view, GstClockTimeDiff);
int gstlal_snglinspiral_append_peak_to_buffer(GstBuffer *srcbuf, struct gstlal_peak_state *input, SnglInspiralTable *bankarray, GstPad *pad, guint64 offset, guint64 length, GstClockTime time, guint rate, void *chi2, gsl_matrix_complex_float_view *H1_snr_matrix_view, gsl_matrix_complex_float_view *K1_snr_matrix_view, gsl_matrix_complex_float_view *L1_snr_matrix_view, gsl_matrix_complex_float_view *V1_snr_matrix_view);
G_END_DECLS
......
......@@ -45,14 +45,14 @@
*/
struct GSTLALSnglInspiral *gstlal_snglinspiral_new(size_t H1_length, size_t L1_length, size_t V1_length, size_t K1_length)
struct GSTLALSnglInspiral *gstlal_snglinspiral_new(size_t H1_length, size_t K1_length, size_t L1_length, size_t V1_length)
{
struct GSTLALSnglInspiral *row = calloc(1, sizeof(*row) + (H1_length + L1_length + V1_length + K1_length) * sizeof(row->snr[0]));
struct GSTLALSnglInspiral *row = calloc(1, sizeof(*row) + (H1_length + K1_length + L1_length + V1_length) * sizeof(row->snr[0]));
if (row) {
row->L1_length = L1_length;
row->H1_length = H1_length;
row->V1_length = V1_length;
row->K1_length = K1_length;
row->L1_length = L1_length;
row->V1_length = V1_length;
}
......
......@@ -56,15 +56,15 @@ struct GSTLALSnglInspiral {
SnglInspiralTable parent;
LIGOTimeGPS epoch;
double deltaT;
size_t L1_length;
size_t H1_length;
size_t V1_length;
size_t K1_length;
size_t L1_length;
size_t V1_length;
float complex snr[];
};
struct GSTLALSnglInspiral *gstlal_snglinspiral_new(size_t L1_length, size_t H1_length, size_t V1_length, size_t K1_length);
struct GSTLALSnglInspiral *gstlal_snglinspiral_new(size_t H1_length, size_t K1_length, size_t L1_length, size_t V1_length);
void gstlal_snglinspiral_free(struct GSTLALSnglInspiral *row);
......
This diff is collapsed.
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