예제 #1
0
 def test_dec_gardner_knopoff(self):
     # Testing the Gardner and Knopoff algorithm
     config = {'time_distance_window': GardnerKnopoffWindow(),
               'fs_time_prop': 1.0}
     # Instantiate the declusterer and process the sample catalogue
     dec = GardnerKnopoffType1()
     vcl, flagvector = dec.decluster(self.cat, config)
     print('vcl:', vcl)
     print('flagvector:', flagvector, self.cat.data['flag'])
     np.testing.assert_allclose(flagvector, self.cat.data['flag'])
예제 #2
0
 def test_dec_gardner_knopoff_time_cutoff(self):
     """
     Testing the Gardner and Knopoff algorithm using a cutoff
     time of 100 days
     """
     config = {'time_distance_window' : GardnerKnopoffWindow(),
               'fs_time_prop' : 1.0,
               'time_cutoff' : 100}
     # Instantiate the declusterer and process the sample catalogue
     dec = GardnerKnopoffType1()
     vcl, flagvector = dec.decluster(self.cat, config)
     print('vcl:', vcl)
     catalog_flag = self.cat.data['flag']
     catalog_flag[4] = 0 # event becomes mainshock when time_cutoff = 100
     print('flagvector:', catalog_flag)
     np.testing.assert_allclose(flagvector,self.cat.data['flag'])