Skip to content
Snippets Groups Projects
Commit 4892a7eb authored by Soichiro Kuwahara's avatar Soichiro Kuwahara
Browse files

gstlal_string_triggergen: transform() error checking tweak

- move the check for odd-lengthed autocorrelation vectors to the top to serve the dual-purpose of also checking for missing autocorrelation vectors
parent 1944f1b7
No related branches found
No related tags found
No related merge requests found
......@@ -209,6 +209,15 @@ static GstFlowReturn trigger_generator(GSTLALStringTriggergen *element, GstBuffe
guint sample;
gint channel;
/* check that autocorrelation vector has odd number of samples.
* NOTE: autocorrelation_length() returns 0 if the
* autocorrelation_matrix is not set, so this g_assert also tests
* for a missing autocorrelation_matrix. in set_property(), if the
* conversion from GValueArray fails the matrix will be left set to
* NULL, so this is also catching those failures. */
g_assert(autocorrelation_length(element->autocorrelation_matrix) & 1);
/* do we have enough SNR to search for triggers? */
length = get_available_samples(element);
if(length < autocorrelation_length(element->autocorrelation_matrix)) {
/* FIXME: PTS and duration are not necessarily correct.
......@@ -237,9 +246,6 @@ static GstFlowReturn trigger_generator(GSTLALStringTriggergen *element, GstBuffe
if(!element->autocorrelation_norm)
element->autocorrelation_norm = gstlal_autocorrelation_chi2_compute_norms_string(element->autocorrelation_matrix, NULL);
/* check that autocorrelation vector has odd number of samples */
g_assert(autocorrelation_length(element->autocorrelation_matrix) & 1);
/* find events. earliest sample that can be a new trigger starts a
* little bit in from the start of the adapter because we are
* re-using data from the last iteration for \chi^2 calculation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment