# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
mseed, sac, datacube, stationxml, textfiles, virtual, yaml, tdms_idas
mseed, sac, datacube, stationxml, textfiles, virtual, yaml, tdms_idas]
'''Update global mapping from file format to io backend module.'''
global g_format_providers
''' Exception raised when file format detection fails. '''
self, 'format detection failed for file: %s' % path)
''' Exception raised when user requests an unknown file format. '''
self, 'unknown format: %s' % format)
''' Get squirrel io backend module for a given file format.
:params str fmt: format identifier '''
raise UnknownFormat(fmt)
''' Determine file type from first 512 bytes.
:param str path: path of file '''
raise FormatDetectionFailed(path)
raise FormatDetectionFailed(path)
''' Get list of file formats supported by Squirrel. '''
''' Get list of supported content kinds offered through Squirrel. ''' return g_content_kinds
paths, segment=None, format='detect', database=None, check=True, commit=True, skip_unchanged=False, content=g_content_kinds):
''' Iteratively load content or index/reindex meta-information from files.
:param paths: iterator yielding file names to load from or :py:class:`pyrocko.squirrel.Selection` object :param str segment: file-specific segment identifier (con only be used when loading from a single file. :param str format: file format identifier or ``'detect'`` for autodetection. When loading from a selection, per-file format assignation is taken from the hint in the selection and this flag is ignored. :param database: database to use for meta-information caching :type database: :py:class:`pyrocko.squirrel.Database` :param bool check: if ``True``, investigate modification time and file sizes of known files to debunk modified files (pessimistic mode), or ``False`` to deactivate checks (optimistic mode) :param bool commit: flag, whether to commit updated information to the meta-information database :param bool skip_unchanged: if ``True``, only yield index nuts for new / modified files :param content: list of strings, selection of content types to load
This generator yields :py:class:`pyrocko.squirrel.Nut` objects for individual pieces of information found when reading the given files. Such a nut may represent a waveform, a station, a channel, an event or other data type. The nut itself only contains the meta-information. The actual content information is attached to the nut if requested. All nut meta-information is stored in the squirrel meta-information database. If possible, this function avoids accessing the actual disk files and provides the requested information straight from the database. Modified files are recognized and reindexed as needed. '''
else: raise TypeError( 'iload: segment argument can only be used when loading from ' 'a single file')
raise TypeError( 'iload: database argument must be None when called with a ' 'selection')
raise TypeError( 'iload: need selection when called with "skip_unchanged=True"')
else:
else:
else:
n_load, n_db, path)
nut for nut in old_nuts if nut.file_segment == segment]
nut.kind_id in kind_ids and nut.content_in_db for nut in old_nuts)
# logger.debug('using cached information for file %s, ' # % path)
database.undig_content(nut)
else: else:
logger.error('An error occured while reading file: %s' % path)
n_db, n_load, n_files))
'iload', 'detect_format', 'supported_formats', 'supported_content_kinds', 'get_backend', 'FormatDetectionFailed', 'UnknownFormat', ] |