def test_is_seed(self): for filename in self.seed_files: self.assertTrue(_is_seed(filename), filename) for filename in self.xseed_files: self.assertFalse(_is_seed(filename), filename) for filename in self.resp_files: self.assertFalse(_is_seed(filename), filename) for filename in self.other_files: self.assertFalse(_is_seed(filename), filename)
def read_metadata(self, file_handle, file_name): """ :type file :param file_handle: :type str :param file_name: :return: :class obspy.core.inventory """ if file_handle.closed: LOGGER.error("File handle is closed") return None # check if dataless or stationxml if _is_stationxml(file_handle): inventory = reader(file_handle, format='STATIONXML') LOGGER.info("File " + file_name + " is STATIONXML...") elif _is_seed(file_handle): inventory = reader(file_handle, format='SEED') LOGGER.info("File " + file_name + " is dataless SEED...") elif is_fdsn_station_text_file(file_handle): inventory = reader(file_handle, format='STATIONTXT') LOGGER.info("File " + file_name + " is FDSN TXT...") elif kefx.is_array_kef(file_handle): LOGGER.info("File " + file_name + " is Array KEF...") inventory = [] elif is_ph5_array_csv(file_handle): inventory = array_csvtoinventory(file_handle) LOGGER.info("File " + file_name + " is Array csv...") else: LOGGER.info("Unknown file type: " + file_name) inventory = None return inventory