Beispiel #1
0
 def return_GRB(self):
     """ Creates a new GRB object with only bins and rates. """
     return EmptyGRB(self.bin_left, self.bin_right, self.counts, **self.kwargs)
Beispiel #2
0
 def test_counts_shape(self):
     counts = np.ones((4,10))
     with self.assertRaises(AssertionError):
         EmptyGRB(bin_left = self.bin_left, bin_right = self.bin_right,
                     counts = counts)
Beispiel #3
0
import numpy as np
from PyGRB.preprocess.grb import EmptyGRB

GRB_discsc = EmptyGRB(bin_left=np.arange(100) * 0.064,
                      bin_right=np.arange(100) * 0.064 + 0.064,
                      counts=np.ones((100, 1)),
                      burst=1,
                      colours=['g'],
                      clabels=['1'],
                      datatype='discsc',
                      satellite='test',
                      simulated=True)

GRB_tte = EmptyGRB(bin_left=np.arange(100) * 0.064,
                   bin_right=np.arange(100) * 0.005 + 0.005,
                   counts=np.ones((100, 1)),
                   burst=1,
                   colours=['g'],
                   clabels=['1'],
                   datatype='tte',
                   satellite='test',
                   simulated=True)
Beispiel #4
0
 def test_assert_type_error_bin_right(self):
     bin_right = 2j
     with self.assertRaises(ValueError):
         EmptyGRB(bin_left = self.bin_left, bin_right = bin_right,
                     counts = self.counts)
Beispiel #5
0
 def test_assert_type_error_counts(self):
     counts = ['peanut']
     with self.assertRaises(ValueError):
         EmptyGRB(bin_left = self.bin_left, bin_right = self.bin_right,
                     counts = counts)
Beispiel #6
0
 def test_counts_assignment(self):
     test = EmptyGRB(bin_left = self.bin_left, bin_right = self.bin_right,
                        counts = self.counts)
     self.assertTrue(np.array_equal(self.counts, test.counts))
Beispiel #7
0
 def test_burst_assignment(self):
     test = EmptyGRB(bin_left = self.bin_left, bin_right = self.bin_right,
                        counts = self.counts)
Beispiel #8
0
 def test_bin_cross_over(self):
     bin_left  = np.arange(10) - 0.1
     with self.assertRaises(AssertionError):
         EmptyGRB(bin_left = bin_left, bin_right = self.bin_right,
                     counts = self.counts)
Beispiel #9
0
 def test_unequal_time_counts(self):
     counts = np.ones((9,4))
     with self.assertRaises(AssertionError):
         EmptyGRB(bin_left = self.bin_left, bin_right = self.bin_right,
                     counts = counts)
Beispiel #10
0
 def test_unequal_time_bins(self):
     bin_left = np.arange(9)
     with self.assertRaises(AssertionError):
         EmptyGRB(bin_left = bin_left, bin_right = self.bin_right,
                     counts = self.counts)