Coverage for /opt/obspy/update-docs/src/obspy/obspy/gse2/core : 98%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- GSE2/GSE1 bindings to ObsPy core module. """
""" Checks whether a file is GSE2 or not.
:type filename: string :param filename: GSE2 file to be checked. :rtype: bool :return: ``True`` if a GSE2 file. """ # Open file.
'station': 'station', 'samp_rate': 'sampling_rate', 'n_samps': 'npts', 'channel': 'channel', 'calib': 'calib', }
'instype', 'datatype', 'vang', 'hang', 'auxid', 'calper', ]
**kwargs): # @UnusedVariable """ Reads a GSE2 file and returns a Stream object.
GSE2 files containing multiple WID2 entries/traces are supported.
.. warning:: This function should NOT be called directly, it registers via the ObsPy :func:`~obspy.core.stream.read` function, call this instead.
:type filename: string :param filename: GSE2 file to be read. :type headonly: boolean, optional :param headonly: If True read only head of GSE2 file. :type verify_chksum: boolean, optional :param verify_chksum: If True verify Checksum and raise Exception if it is not correct. :rtype: :class:`~obspy.core.stream.Stream` :returns: Stream object containing header and data.
.. rubric:: Example
>>> from obspy import read >>> st = read("/path/to/loc_RJOB20050831023349.z") """ # read GSE2 file else: # valid gse2 part else: # assign all header entries to a new dictionary compatible with an # ObsPy Trace object. # assign gse specific header entries # Calculate start time. header['d_year'], header['d_mon'], header['d_day'], header['t_hour'], header['t_min'], 0) + header['t_sec'] else:
""" Write GSE2 file from a Stream object.
.. warning:: This function should NOT be called directly, it registers via the the :meth:`~obspy.core.stream.Stream.write` method of an ObsPy :class:`~obspy.core.stream.Stream` object, call this instead.
:type stream: :class:`~obspy.core.stream.Stream` :param stream: The ObsPy Stream object to write. :type filename: string :param filename: Name of file to write. :type inplace: boolean, optional :param inplace: If True, do compression not on a copy of the data but on the data itself - note this will change the data values and make them therefore unusable!
.. rubric:: Example
>>> from obspy import read >>> st = read() >>> st.write('filename.gse', format='GSE2') #doctest: +SKIP """ # # Translate the common (renamed) entries # year, month, day, hour, min, sec header['d_mon'], header['d_day'], header['t_hour'], header['t_min'], header['t_sec']) = trace.stats.starttime.timetuple()[0:6] else: (dtype.name, trace.data.dtype)
""" Checks whether a file is GSE1 or not.
:type filename: string :param filename: GSE1 file to be checked. :rtype: bool :return: ``True`` if a GSE1 file. """ # Open file. except: return False
**kwargs): # @UnusedVariable """ Reads a GSE1 file and returns a Stream object.
GSE1 files containing multiple WID1 entries/traces are supported.
.. warning:: This function should NOT be called directly, it registers via the ObsPy :func:`~obspy.core.stream.read` function, call this instead.
:type filename: string :type param: GSE2 file to be read. :type headonly: boolean, optional :param headonly: If True read only header of GSE1 file. :type verify_chksum: boolean, optional :param verify_chksum: If True verify Checksum and raise Exception if it is not correct. :rtype: :class:`~obspy.core.stream.Stream` :returns: Stream object containing header and data.
.. rubric:: Example
>>> from obspy import read >>> st = read("/path/to/y2000.gse") """ # read GSE1 file else: |