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
222ed2d3
Commit
222ed2d3
authored
6 years ago
by
Duncan Meacher
Committed by
Kipp Cannon
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_inspiral_add_template_ids: Can loop over multiple bank files
parent
8ee275f0
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/bin/gstlal_inspiral_add_template_ids
+9
-6
9 additions, 6 deletions
gstlal-inspiral/bin/gstlal_inspiral_add_template_ids
with
9 additions
and
6 deletions
gstlal-inspiral/bin/gstlal_inspiral_add_template_ids
+
9
−
6
View file @
222ed2d3
...
...
@@ -31,12 +31,15 @@ from glue.ligolw import utils as ligolw_utils
class
LIGOLWContentHandler
(
ligolw
.
LIGOLWContentHandler
):
pass
fname
=
sys
.
argv
[
1
]
cnt
=
0
xmldoc
=
ligolw_utils
.
load_filename
(
fname
,
verbose
=
True
,
contenthandler
=
LIGOLWContentHandler
)
sngl_inspiral_table
=
lsctables
.
SnglInspiralTable
.
get_table
(
xmldoc
)
for
fname
in
sys
.
argv
[
1
:]:
for
n
,
row
in
enumerate
(
sngl_inspiral_table
):
row
.
template_id
=
n
xmldoc
=
ligolw_utils
.
load_filename
(
fname
,
verbose
=
True
,
contenthandler
=
LIGOLWContentHandler
)
sngl_inspiral_table
=
lsctables
.
SnglInspiralTable
.
get_table
(
xmldoc
)
ligolw_utils
.
write_filename
(
xmldoc
,
fname
,
gz
=
fname
.
endswith
(
'
gz
'
),
verbose
=
True
)
for
row
in
sngl_inspiral_table
:
row
.
template_id
=
cnt
cnt
+=
1
ligolw_utils
.
write_filename
(
xmldoc
,
fname
,
gz
=
fname
.
endswith
(
'
gz
'
),
verbose
=
True
)
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