Skip to content
Snippets Groups Projects
Commit edcf83fe authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

show available included IFOs in CLI help

parent e5c08461
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,19 @@ from IPython.terminal.embed import InteractiveShellEmbed
import logging
logging.basicConfig(level=logging.INFO)
from . import load_ifo
from .ifo import available_ifos, load_ifo
from . import plot_noise
##################################################
description = """Plot GWINC noise budget for specified IFO
description = """Plot GWINC noise budget for specified IFO.
Available included IFOs: {}
""".format(', '.join(["'{}'".format(ifo) for ifo in available_ifos()]))
# for ifo in available_ifos():
# description += " '{}'\n".format(ifo)
description += """
If the inspiral_range package is installed, various figures of merit
can be calculated for the resultant spectrum with the --fom argument,
e.g.:
......
import os
import re
import fnmatch
import yaml
import scipy
import scipy.io
......@@ -208,6 +209,14 @@ class Struct(object):
raise IOError("Unknown file type: {}".format(ext))
def available_ifos():
"""List available included IFO files"""
ifos = []
for f in os.listdir(os.path.dirname(__file__)):
if fnmatch.fnmatch(f, '*.yaml'):
ifos.append(f.split('.')[0])
return ifos
def load_ifo(name_or_path):
"""Load IFO by name or from file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment