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
c3e8c1db
Commit
c3e8c1db
authored
4 years ago
by
Jameson Rollins
Browse files
Options
Downloads
Patches
Plain Diff
cli: improve usage
parent
499a692b
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
gwinc/__main__.py
+27
-26
27 additions, 26 deletions
gwinc/__main__.py
with
27 additions
and
26 deletions
gwinc/__main__.py
+
27
−
26
View file @
c3e8c1db
...
...
@@ -15,29 +15,31 @@ logger.addHandler(handler)
##################################################
description
=
"""
Plot
GWINC noise budget
for specified IFO.
description
=
"""
GWINC noise budget
tool
Available included IFOs: {}
IFOs can be specified by name of included canonical budget (see
below), or by path to a budget module (.py), description file
(.yaml/.mat/.m), or HDF5 data file (.hdf5/.h5). Available included
IFOs are:
"""
.
format
(
'
,
'
.
join
([
"'
{}
'"
.
format
(
ifo
)
for
ifo
in
IFOS
]))
{}
"""
.
format
(
'
,
'
.
join
([
"
{}
"
.
format
(
ifo
)
for
ifo
in
IFOS
]))
# for ifo in available_ifos():
# description += " '{}'\n".format(ifo)
description
+=
"""
By default a GWINC noise budget of the specified IFO will calculated,
and plotted with an interactive plotter. If the --save option is
specified the plot will be saved directly to a file (without display)
(various formats are supported, indicated by file extension). If the
requested extension is
'
hdf5
'
or
'
h5
'
then the noise traces and IFO
parameters will be saved to an HDF5 file (without plotting). The
input file (IFO) can be an HDF5 file saved from a previous call, in
which case all noise traces and IFO parameters will be loaded from
that file.
Individual IFO parameters can be overriden with the --ifo option:
By default the noise budget of the specified IFO will be loaded and
plotted with an interactive plotter. Individual IFO parameters can be
overriden with the --ifo option:
gwinc --ifo Optics.SRM.Tunephase=3.14 ...
If the --save option is specified the plot will be saved directly to a
file (without display) (various file formats are supported, indicated
by file extension). If the requested extension is
'
hdf5
'
or
'
h5
'
then
the noise traces and IFO parameters will be saved to an HDF5 file.
If the inspiral_range package is installed, various figures of merit
can be calculated for the resultant spectrum with the --fom option,
e.g.:
...
...
@@ -45,8 +47,7 @@ e.g.:
gwinc --fom horizon ...
gwinc --fom range:m1=20,m2=20 ...
See documentation for inspiral_range package for details.
See the inspiral_range package documentation for details.
"""
IFO
=
'
aLIGO
'
...
...
@@ -58,10 +59,10 @@ parser = argparse.ArgumentParser(
description
=
description
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
)
parser
.
add_argument
(
'
--freq
'
,
'
-f
'
,
metavar
=
'
F
SPEC
'
,
help
=
"
frequency array specification in Hz
, either as
'
flo:fhi
'
or
'
flo:npoints:fhi
'
[{}]
"
.
format
(
FREQ
))
'
--freq
'
,
'
-f
'
,
metavar
=
'
F
LO:[NPOINTS:]FHI
'
,
help
=
"
frequency array specification in Hz [{}]
"
.
format
(
FREQ
))
parser
.
add_argument
(
'
--ifo
'
,
'
-o
'
,
'
--ifo
'
,
'
-o
'
,
metavar
=
'
PARAM=VAL
'
,
#nargs='+', action='extend',
action
=
'
append
'
,
help
=
"
override budget IFO parameter (may be specified multiple times)
"
)
...
...
@@ -69,14 +70,14 @@ parser.add_argument(
'
--title
'
,
'
-t
'
,
help
=
"
plot title
"
)
parser
.
add_argument
(
'
--fom
'
,
help
=
"
calculat
e inspiral
range for resultant spectrum (
'
func[:param=val,param=val]
'
)
"
)
'
--fom
'
,
metavar
=
'
FUNC[:PARAM=VAL,...]
'
,
help
=
"
us
e inspiral
_range.FUNC to calculate range figure-of-merit on resultant spectrum
"
)
group
=
parser
.
add_mutually_exclusive_group
()
group
.
add_argument
(
'
--interactive
'
,
'
-i
'
,
action
=
'
store_true
'
,
help
=
"
launch interactive shell
with plotting capability
after budget processing
"
)
help
=
"
launch interactive shell after budget processing
"
)
group
.
add_argument
(
'
--save
'
,
'
-s
'
,
action
=
'
append
'
,
'
--save
'
,
'
-s
'
,
metavar
=
'
PATH
'
,
action
=
'
append
'
,
help
=
"
save plot (.png/.pdf/.svg) or budget traces (.hdf5/.h5) to file (may be specified multiple times)
"
)
group
.
add_argument
(
'
--yaml
'
,
'
-y
'
,
action
=
'
store_true
'
,
...
...
@@ -86,13 +87,13 @@ group.add_argument(
help
=
"
print IFO as text table to stdout and exit (budget not calculated)
"
)
group
.
add_argument
(
'
--diff
'
,
'
-d
'
,
metavar
=
'
IFO
'
,
help
=
"
show difference
s
table between another IFO description and exit (budget not calculated)
"
)
help
=
"
show difference table between
IFO and
another IFO description
(name or path)
and exit (budget not calculated)
"
)
parser
.
add_argument
(
'
--no-plot
'
,
'
-np
'
,
action
=
'
store_false
'
,
dest
=
'
plot
'
,
help
=
"
supress plotting
"
)
help
=
"
sup
p
ress plotting
"
)
parser
.
add_argument
(
'
IFO
'
,
help
=
"
IFO name
,
or path
to budget module (.py), description file (.yaml/.mat/.m), or HDF5 data file (.hdf5/.h5)
"
)
help
=
"
IFO name or path
"
)
def
freq_from_spec
(
spec
):
...
...
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