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
362811d4
Commit
362811d4
authored
6 years ago
by
chad.hanna
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_inspiral_add_mass_models: Add some code to peice together multiple mass model files
parent
1db4410f
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_mass_models
+41
-0
41 additions, 0 deletions
gstlal-inspiral/bin/gstlal_inspiral_add_mass_models
with
41 additions
and
0 deletions
gstlal-inspiral/bin/gstlal_inspiral_add_mass_models
0 → 100755
+
41
−
0
View file @
362811d4
#!/usr/bin/env python
#
# Copyright (C) 2017,2018 Heather Fong and Chad Hanna
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import
h5py
import
argparse
import
numpy
parser
=
argparse
.
ArgumentParser
(
description
=
"
Add mass models for prior weighting of templates
"
)
parser
.
add_argument
(
"
--output
"
,
metavar
=
'
name
'
,
type
=
str
,
help
=
'
The output file name
'
,
default
=
"
inspiral_mass_model.h5
"
)
parser
.
add_argument
(
"
modelfiles
"
,
nargs
=
"
+
"
)
options
=
parser
.
parse_args
()
f
=
h5py
.
File
(
options
.
modelfiles
[
0
],
"
r
"
)
SNR
=
numpy
.
zeros
(
f
[
"
SNR
"
].
shape
)
coefficients
=
numpy
.
zeros
(
f
[
"
coefficients
"
].
shape
)
f
.
close
()
for
fname
in
options
.
modelfiles
:
f
=
h5py
.
File
(
options
.
modelfiles
[
0
],
"
r
"
)
SNR
+=
f
[
"
SNR
"
]
coefficients
+=
f
[
"
coefficients
"
]
f
.
close
()
f
=
h5py
.
File
(
options
.
output
,
"
w
"
)
f
.
create_dataset
(
"
SNR
"
,
data
=
SNR
)
f
.
create_dataset
(
"
coefficients
"
,
data
=
coefficients
)
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