def _readHypFile(self, file_abs_path): origin: Origin = ObspyUtil.reads_hyp_to_origin(file_abs_path) try: event_model = EventLocationModel.create_from_origin(origin) event_model.save() except AttributeError: # TODO: what to do if it is already inserted? event_model = EventLocationModel.find_by(latitude=origin.latitude, longitude=origin.longitude, depth=origin.depth, origin_time=origin.time.datetime) return event_model
def get_NLL_info(self) -> Origin: location_file = os.path.join(self.get_loc_dir, "last.hyp") return ObspyUtil.reads_hyp_to_origin(location_file)