Skip to content

Commit

Permalink
Merge branch 'release/0.11.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Jun 15, 2018
2 parents 64c1b04 + 0dbe9d5 commit 09a6e21
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions gwpy/timeseries/core.py
Expand Up @@ -1274,15 +1274,15 @@ def get(cls, channels, start, end, pad=None, dtype=None, verbose=False,
`TimeSeriesBaseDict.find` (for direct GWF file access) or
`TimeSeriesBaseDict.fetch` for remote NDS2 access
"""
try_frames = True
# work out whether to use NDS2 or frames
if not os.getenv('LIGO_DATAFIND_SERVER'):
try_frames = False
host = kwargs.get('host', None)
if host is not None and host.startswith('nds'):
try_frames = False
# separate non-None nds2-only keywords here
nds_kw = {}
for key in ('host', 'port', 'connection'):
val = kwargs.pop(key, None)
if val is not None:
nds_kw[key] = val

# try and find from frames
if try_frames:
if os.getenv('LIGO_DATAFIND_SERVER') and not nds_kw:
if verbose:
gprint("Attempting to access data from frames...")
try:
Expand All @@ -1298,6 +1298,7 @@ def get(cls, channels, start, end, pad=None, dtype=None, verbose=False,
# remove kwargs for .find()
for key in ('nproc', 'frametype', 'frametype_match', 'observatory'):
kwargs.pop(key, None)
kwargs.update(nds_kw) # replace nds keywords

# otherwise fetch from NDS
try:
Expand Down

0 comments on commit 09a6e21

Please sign in to comment.