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
8b6d034c
Commit
8b6d034c
authored
6 years ago
by
Chad Hanna
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_svd_bank: cleanup writing the psd
parent
361be1ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gstlal-inspiral/bin/gstlal_svd_bank
+1
-2
1 addition, 2 deletions
gstlal-inspiral/bin/gstlal_svd_bank
gstlal-inspiral/python/svd_bank.py
+9
-3
9 additions, 3 deletions
gstlal-inspiral/python/svd_bank.py
with
10 additions
and
5 deletions
gstlal-inspiral/bin/gstlal_svd_bank
+
1
−
2
View file @
8b6d034c
...
...
@@ -148,6 +148,5 @@ svd_bank.write_bank(
contenthandler
=
svd_bank
.
DefaultContentHandler
)
for
(
template_bank
,
bank_id
)
in
zip
(
options
.
template_bank
,
options
.
bank_id
)],
options
.
clipleft
,
options
.
clipright
,
write_psd
=
True
options
.
clipright
)
This diff is collapsed.
Click to expand it.
gstlal-inspiral/python/svd_bank.py
+
9
−
3
View file @
8b6d034c
...
...
@@ -259,7 +259,7 @@ def build_bank(template_bank_url, psd, flow, ortho_gate_fap, snr_threshold, svd_
return
bank
def
write_bank
(
filename
,
banks
,
cliplefts
=
None
,
cliprights
=
None
,
write_psd
=
False
,
verbose
=
False
):
def
write_bank
(
filename
,
banks
,
cliplefts
=
None
,
cliprights
=
None
,
verbose
=
False
):
"""
Write SVD banks to a LIGO_LW xml file.
"""
# Create new document
...
...
@@ -333,8 +333,7 @@ def write_bank(filename, banks, cliplefts = None, cliprights = None, write_psd =
# put a copy of the processed PSD file in
# FIXME in principle this could be different for each bank included in
# this file, but we only put one here
if
write_psd
:
lal
.
series
.
make_psd_xmldoc
({
bank
.
sngl_inspiral_table
[
0
].
ifo
:
bank
.
processed_psd
},
lw
)
lal
.
series
.
make_psd_xmldoc
({
bank
.
sngl_inspiral_table
[
0
].
ifo
:
bank
.
processed_psd
},
lw
)
# Write to file
ligolw_utils
.
write_filename
(
xmldoc
,
filename
,
gz
=
filename
.
endswith
(
'
.gz
'
),
verbose
=
verbose
)
...
...
@@ -348,6 +347,10 @@ def read_banks(filename, contenthandler, verbose = False):
banks
=
[]
# FIXME in principle this could be different for each bank included in
# this file, but we only put one in the file for now
psd
=
lal
.
series
.
read_psd_xmldoc
(
xmldoc
)
for
root
in
(
elem
for
elem
in
xmldoc
.
getElementsByTagName
(
ligolw
.
LIGO_LW
.
tagName
)
if
elem
.
hasAttribute
(
u
"
Name
"
)
and
elem
.
Name
==
"
gstlal_svd_bank_Bank
"
):
# Create new SVD bank object
...
...
@@ -370,6 +373,9 @@ def read_banks(filename, contenthandler, verbose = False):
bank
.
autocorrelation_mask
=
ligolw_array
.
get_array
(
root
,
'
autocorrelation_mask
'
).
array
bank
.
sigmasq
=
ligolw_array
.
get_array
(
root
,
'
sigmasq
'
).
array
# attach a reference to the psd
bank
.
psd
=
psd
# Read bank fragments
bank
.
bank_fragments
=
[]
for
el
in
(
node
for
node
in
root
.
childNodes
if
node
.
tagName
==
ligolw
.
LIGO_LW
.
tagName
):
...
...
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