Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duncan Macleod
gstlal
Commits
fd1674b8
Commit
fd1674b8
authored
5 years ago
by
Cody Messick
Browse files
Options
Downloads
Patches
Plain Diff
itacac: Updated all if statements to convention if()
parent
55e42cfe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-inspiral/gst/lal/gstlal_itacac.c
+16
-16
16 additions, 16 deletions
gstlal-inspiral/gst/lal/gstlal_itacac.c
with
16 additions
and
16 deletions
gstlal-inspiral/gst/lal/gstlal_itacac.c
+
16
−
16
View file @
fd1674b8
...
...
@@ -160,7 +160,7 @@ static void free_bank(GSTLALItacacPad *itacacpad) {
static
void
update_peak_info_from_autocorrelation_properties
(
GSTLALItacacPad
*
itacacpad
)
{
// FIXME Need to make sure that itacac can run without autocorrelation matrix
if
(
itacacpad
->
maxdata
&&
itacacpad
->
tmp_maxdata
&&
itacacpad
->
autocorrelation_matrix
)
{
if
(
itacacpad
->
maxdata
&&
itacacpad
->
tmp_maxdata
&&
itacacpad
->
autocorrelation_matrix
)
{
itacacpad
->
maxdata
->
pad
=
itacacpad
->
tmp_maxdata
->
pad
=
autocorrelation_length
(
itacacpad
)
/
2
;
free
(
itacacpad
->
snr_mat
);
free
(
itacacpad
->
tmp_snr_mat
);
...
...
@@ -254,10 +254,10 @@ static gboolean setcaps(GstAggregator *agg, GstAggregatorPad *aggpad, GstEvent *
itacacpad
->
chi2
=
calloc
(
itacac
->
channels
,
width
);
itacacpad
->
tmp_chi2
=
calloc
(
itacac
->
channels
,
width
);
if
(
itacacpad
->
maxdata
)
if
(
itacacpad
->
maxdata
)
gstlal_peak_state_free
(
itacacpad
->
maxdata
);
if
(
itacacpad
->
tmp_maxdata
)
if
(
itacacpad
->
tmp_maxdata
)
gstlal_peak_state_free
(
itacacpad
->
tmp_maxdata
);
itacacpad
->
maxdata
=
gstlal_peak_state_new
(
itacac
->
channels
,
itacac
->
peak_type
);
...
...
@@ -397,7 +397,7 @@ static void gstlal_itacac_pad_set_property(GObject *object, enum padproperty id,
case
ARG_SIGMASQ
:
g_mutex_lock
(
&
itacacpad
->
bank_lock
);
if
(
itacacpad
->
bankarray
)
{
if
(
itacacpad
->
bankarray
)
{
g_assert
(
itacac
!=
NULL
);
gint
length
;
double
*
sigmasq
=
gstlal_doubles_from_g_value_array
(
g_value_get_boxed
(
value
),
NULL
,
&
length
);
...
...
@@ -583,9 +583,9 @@ static void copy_nongapsamps(GSTLALItacac *itacac, GSTLALItacacPad *itacacpad, g
gsl_matrix_set
(
itacacpad
->
data
->
duration_dataoffset_trigwindowoffset_peakfindinglength_matrix
,
data_container_index
,
3
,
(
double
)
peak_finding_length
);
// copy the samples that we will call the peak finding library on (if no events are found the result will be a GAP)
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
gst_audioadapter_copy_samples
(
itacacpad
->
adapter
,
(
float
complex
*
)
itacacpad
->
data
->
data
+
offset_from_copied_data
*
itacacpad
->
maxdata
->
channels
,
copysamps
,
NULL
,
NULL
);
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
gst_audioadapter_copy_samples
(
itacacpad
->
adapter
,
(
double
complex
*
)
itacacpad
->
data
->
data
+
offset_from_copied_data
*
itacacpad
->
maxdata
->
channels
,
copysamps
,
NULL
,
NULL
);
...
...
@@ -627,7 +627,7 @@ static void generate_triggers(GSTLALItacac *itacac, GSTLALItacacPad *itacacpad,
// AEP- 180417 Turning XLAL Errors off
old_gsl_error_handler
=
gsl_set_error_handler_off
();
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
// Find the peak, making sure to put the data pointer at the start of the interval we care about
gstlal_float_complex_peak_over_window_interp
(
this_maxdata
,
(
float
complex
*
)
itacacpad
->
data
->
data
+
peak_finding_start
*
this_maxdata
->
channels
,
peak_finding_length
);
//FIXME At the moment, empty triggers are added to inform the
...
...
@@ -643,7 +643,7 @@ static void generate_triggers(GSTLALItacac *itacac, GSTLALItacacPad *itacacpad,
}
}
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
// Find the peak, making sure to put the data pointer at the start of the interval we care about
gstlal_double_complex_peak_over_window_interp
(
this_maxdata
,
(
double
complex
*
)
itacacpad
->
data
->
data
+
peak_finding_start
*
this_maxdata
->
channels
,
peak_finding_length
);
//FIXME At the moment, empty triggers are added to inform the
...
...
@@ -679,7 +679,7 @@ static void generate_triggers(GSTLALItacac *itacac, GSTLALItacacPad *itacacpad,
gstlal_double_complex_series_around_peak
(
this_maxdata
,
(
double
complex
*
)
itacacpad
->
data
->
data
+
peak_finding_start
*
this_maxdata
->
channels
,
(
double
complex
*
)
this_snr_mat
,
this_maxdata
->
pad
);
gstlal_autocorrelation_chi2
((
double
*
)
this_chi2
,
(
double
complex
*
)
this_snr_mat
,
autocorrelation_length
(
itacacpad
),
-
((
int
)
autocorrelation_length
(
itacacpad
))
/
2
,
itacacpad
->
snr_thresh
,
itacacpad
->
autocorrelation_matrix
,
itacacpad
->
autocorrelation_mask
,
itacacpad
->
autocorrelation_norm
);
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
/* extract data around peak for chisq calculation */
gstlal_float_complex_series_around_peak
(
this_maxdata
,
(
float
complex
*
)
itacacpad
->
data
->
data
+
peak_finding_start
*
this_maxdata
->
channels
,
(
float
complex
*
)
this_snr_mat
,
this_maxdata
->
pad
);
gstlal_autocorrelation_chi2_float
((
float
*
)
this_chi2
,
(
float
complex
*
)
this_snr_mat
,
autocorrelation_length
(
itacacpad
),
-
((
int
)
autocorrelation_length
(
itacacpad
))
/
2
,
itacacpad
->
snr_thresh
,
itacacpad
->
autocorrelation_matrix
,
itacacpad
->
autocorrelation_mask
,
itacacpad
->
autocorrelation_norm
);
...
...
@@ -826,18 +826,18 @@ static void get_snr_series(GSTLALItacac *itacac, GSTLALItacacPad *itacacpad, gui
// find snr time series
// FIXME Should the gstlal*series_around_peak functions be generalized so that they can do this?
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
tmp_snr_mat_doubleptr
=
(
double
complex
*
)
itacacpad
->
tmp_snr_mat
;
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
tmp_snr_mat_floatptr
=
(
float
complex
*
)
itacacpad
->
tmp_snr_mat
;
}
for
(
snr_index
=
0
;
snr_index
<
2
*
itacacpad
->
maxdata
->
pad
+
1
;
snr_index
++
)
{
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
tmp_snr_mat_doubleptr
[
snr_index
*
itacacpad
->
maxdata
->
channels
+
channel
]
=
*
(((
double
complex
*
)
itacacpad
->
data
->
data
)
+
(
series_start
+
snr_index
)
*
itacacpad
->
maxdata
->
channels
+
channel
);
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
tmp_snr_mat_floatptr
[
snr_index
*
itacacpad
->
maxdata
->
channels
+
channel
]
=
*
(((
float
complex
*
)
itacacpad
->
data
->
data
)
+
(
series_start
+
snr_index
)
*
itacacpad
->
maxdata
->
channels
+
channel
);
}
...
...
@@ -863,11 +863,11 @@ static void populate_snr_in_other_detectors(GSTLALItacac *itacac, GSTLALItacacPa
// Identify which sample was the peak
// See if we that have that sample in the other ifos
// zeropad other ifos if we need to
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_DOUBLE_COMPLEX
)
{
// First check if there's a trigger
if
(
!
itacacpad
->
maxdata
->
values
.
as_double_complex
[
channel
])
continue
;
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
}
else
if
(
itacac
->
peak_type
==
GSTLAL_PEAK_COMPLEX
)
{
// First check if there's a trigger
if
(
!
itacacpad
->
maxdata
->
values
.
as_float_complex
[
channel
])
continue
;
...
...
@@ -1185,7 +1185,7 @@ static GstFlowReturn aggregate(GstAggregator *aggregator, gboolean timeout)
// FIXME if we were more careful we wouldn't lose so much data around disconts
// FIXME I don't think this logic works for itacac, it came from itac, need to think carefully about what to do around disconts
if
(
GST_BUFFER_FLAG_IS_SET
(
sinkbuf
,
GST_BUFFER_FLAG_DISCONT
))
{
if
(
GST_BUFFER_FLAG_IS_SET
(
sinkbuf
,
GST_BUFFER_FLAG_DISCONT
))
{
// FIXME For now, this should ensure we only see disconts at start up
g_assert
(
gst_audioadapter_available_samples
(
itacacpad
->
adapter
)
==
0
);
itacacpad
->
initial_timestamp
=
GST_CLOCK_TIME_NONE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment