Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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 GWpy. If not, see .
"""Utilties for plotting directly from frames
"""
from .. import version
from ..timeseries import TimeSeries
from .timeseries import TimeSeriesPlot
__author__ = "Duncan Macleod "
__version__ = version.version
__all__ = ["GWFramePlot"]
class GWFramePlot(TimeSeriesPlot):
"""Utility to plot directly from gravitational wave frames.
"""
def __init__(self, gwf, channel, **kwargs):
# read the frame
self._gwf = gwf
self._channel = channel
start = kwargs.pop("start", -1)
end = kwargs.pop("end", -1)
self.read_frame(self._gwf, channel, start=start, end=end)
super(GWFramePlot, self).__init__(self._series, **kwargs)
This module is based on the
"""
import json
import numpy
from urllib2 import HTTPError
from glue.auth.saml import HTTPNegotiateAuthHandler
from .. import version
from ..detector import (Channel, ChannelList)
from . import auth
__author__ = "Duncan Macleod "
__version__ = version.version
CIS_API_URL = 'https://cis.ligo.org/api/channel'
CIS_DATA_TYPE = {4: numpy.float32}
def query(name, debug=False):
"""Query the Channel Information System for details on the given
channel name
Parameters
----------
name : `~gwpy.detector.Channel`, or `str`
Name of the channel of interest
Returns
-------
# (at your option) any later version.
#
# GWpy 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 GWpy. If not, see .
"""Create and apply time-domain or frequency-domain windows to Series
"""
from .. import version
__author__ = "Duncan Macleod "
__version__ = version.version
from .core import *
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GWpy. If not, see .
"""This module provides a spectral-variation histogram class
"""
import numpy
import sys
if sys.version_info[0] < 3:
range = xrange
from .. import version
__version__ = version.version
__author__ = 'Duncan Macleod '
from ..data import (Quantity, Array, Array2D)
from .core import FrequencySeries
from ..detector import Channel
__all__ = ['SpectralVariance']
class SpectralVariance(Array2D):
"""A 2-dimensional array containing the variance histogram of a
frequency-series `FrequencySeries`
"""
_metadata_slots = FrequencySeries._metadata_slots + ['bins']
_default_xunit = FrequencySeries._default_xunit
from math import modf
from matplotlib import (ticker as mticker, pyplot, transforms as mtransforms)
from matplotlib.dates import (SEC_PER_MIN, SEC_PER_HOUR, SEC_PER_DAY,
SEC_PER_WEEK)
from ..time import Time
from .. import version
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
__author__ = "Duncan Macleod "
__version__ = version.version
GPS_SCALE = OrderedDict([(1, ('seconds', 's', 1)),
(SEC_PER_MIN, ('minutes', 'mins', 10)),
(SEC_PER_HOUR, ('hours', 'hrs', 4)),
(SEC_PER_DAY, ('days', 'd', 7)),
(SEC_PER_WEEK, ('weeks', 'w', 4))])
class GPSMixin(object):
"""Mixin adding GPS-related attributes to a `Locator`.
"""
def __init__(self, *args, **kwargs):
self.set_scale(kwargs.pop('scale', 1))
self.set_epoch(kwargs.pop('epoch', None))
# call super for __init__ if this is part of a larger MRO
try: