[docs]defget_events(self,starttime=None,endtime=UTCDateTime.now(),**kwargs):"""Get events from IRIS :param starttime: Start time of events, defaults to None :type starttime: :class:`obspy.UTCDateTime`, optional :param endtime: End time of events, defaults to UTCDateTime.now() :type endtime: :class:`obspy.UTCDateTime`, optional :return: Events :rtype: :class:`obspy.Catalog` """ifendtime>UTCDateTime.now():endtime=UTCDateTime.now()events=Catalog()ifendtime-starttime<365*86400:events+=self.client.get_events(starttime=starttime,endtime=endtime,orderby='time-asc',**kwargs)else:chunk_length=365*86400whilestarttime<=endtime:ifendtime-starttime<chunk_length:nowtime=endtimeelse:nowtime=starttime+chunk_lengthtry:events+=self.client.get_events(starttime=starttime,endtime=nowtime,orderby='time-asc',**kwargs)except:starttime+=chunk_lengthcontinueifstarttime+chunk_length>endtime:chunk=endtime-starttimeifchunk<=1:breakstarttime+=chunk_lengthself.events=_cat2df(events)self.events_raw=events