Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Operate
Environments
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
gwinc
pygwinc
Commits
cf5943a3
Commit
cf5943a3
authored
3 years ago
by
Sebastian Steinlechner
Browse files
Options
Downloads
Patches
Plain Diff
fixed cmdline ignoring default freq spec
parent
e340abb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!133
Fix cmdline ignoring default freq spec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gwinc/__init__.py
+12
-7
12 additions, 7 deletions
gwinc/__init__.py
gwinc/__main__.py
+5
-8
5 additions, 8 deletions
gwinc/__main__.py
with
17 additions
and
15 deletions
gwinc/__init__.py
+
12
−
7
View file @
cf5943a3
...
...
@@ -27,6 +27,8 @@ logger = logging.getLogger('gwinc')
DEFAULT_FREQ
=
'
5:3000:6000
'
class
InvalidFrequencySpec
(
Exception
):
pass
def
freq_from_spec
(
spec
=
None
):
"""
logarithmicly spaced frequency array, based on specification string
...
...
@@ -41,13 +43,16 @@ def freq_from_spec(spec=None):
elif
spec
is
None
:
spec
=
DEFAULT_FREQ
fspec
=
spec
.
split
(
'
:
'
)
if
len
(
fspec
)
==
2
:
fspec
=
fspec
[
0
],
DEFAULT_FREQ
.
split
(
'
:
'
)[
1
],
fspec
[
1
]
return
np
.
logspace
(
np
.
log10
(
float
(
fspec
[
0
])),
np
.
log10
(
float
(
fspec
[
2
])),
int
(
fspec
[
1
]),
)
try
:
if
len
(
fspec
)
==
2
:
fspec
=
fspec
[
0
],
DEFAULT_FREQ
.
split
(
'
:
'
)[
1
],
fspec
[
1
]
return
np
.
logspace
(
np
.
log10
(
float
(
fspec
[
0
])),
np
.
log10
(
float
(
fspec
[
2
])),
int
(
fspec
[
1
]),
)
except
(
ValueError
,
IndexError
):
raise
InvalidFrequencySpec
(
f
'
Improper frequency specification:
{
spec
}
'
)
def
load_module
(
name_or_path
):
...
...
This diff is collapsed.
Click to expand it.
gwinc/__main__.py
+
5
−
8
View file @
cf5943a3
...
...
@@ -8,7 +8,7 @@ from . import (
__version__
,
IFOS
,
DEFAULT_FREQ
,
freq_from_s
pec
,
InvalidFrequencyS
pec
,
load_budget
,
logger
,
)
...
...
@@ -58,7 +58,6 @@ See the inspiral_range package documentation for details.
"""
IFO
=
'
aLIGO
'
FREQ
=
'
5:3000:6000
'
RANGE_PARAMS
=
dict
(
m1
=
1.4
,
m2
=
1.4
)
DATA_SAVE_FORMATS
=
[
'
.hdf5
'
,
'
.h5
'
]
...
...
@@ -142,11 +141,9 @@ def main():
else
:
try
:
freq
=
freq_from_spec
(
args
.
freq
)
except
IndexError
:
parser
.
error
(
f
"
Improper frequency specification:
{
args
.
freq
}
"
)
try
:
budget
=
load_budget
(
args
.
IFO
,
freq
=
freq
,
bname
=
args
.
bname
)
budget
=
load_budget
(
args
.
IFO
,
freq
=
args
.
freq
,
bname
=
args
.
bname
)
except
InvalidFrequencySpec
as
e
:
parser
.
error
(
e
)
except
RuntimeError
as
e
:
parser
.
exit
(
2
,
f
"
Error:
{
e
}
\n
"
)
name
=
budget
.
name
...
...
@@ -258,7 +255,7 @@ def main():
if
not
trace
:
logger
.
info
(
"
calculating budget...
"
)
trace
=
budget
.
run
(
freq
=
freq
)
trace
=
budget
.
run
()
if
args
.
range
:
logger
.
info
(
"
calculating inspiral ranges...
"
)
...
...
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