예제 #1
0
 def test_simple_get_area_dipping(self):
     '''
     Tests the area calculation for a dipping fault
     '''
     self.dip = 30.
     self.fault = SimpleFaultGeometry(self.trace, self.dip,
                                      self.upper_depth, self.lower_depth)
     self.assertAlmostEqual(2400., self.fault.get_area(), 5)
     self.assertAlmostEqual(40., self.fault.downdip_width, 5)
예제 #2
0
    def test_simple_get_area_vertical(self):
        '''
        Tests the area calculation for a vertical fault
        '''
        # Case 1 - Vertical fault
        self.fault = SimpleFaultGeometry(self.trace, self.dip,
                                         self.upper_depth, self.lower_depth)

        self.assertAlmostEqual(1200., self.fault.get_area(), 5)
        self.assertAlmostEqual(20., self.fault.downdip_width, 5)
        self.assertAlmostEqual(0., self.fault.surface_width, 5)
예제 #3
0
 def test_simple_fault_instantiation(self):
     '''
     Test the instantiation of the fault and the calculation of the length
     '''
     expected_keys = ['trace', 'downdip_width', 'area', 'surface', 
                      'upper_depth', 'length', 'surface_width', 
                      'lower_depth', 'dip', 'typology']
     self.fault = SimpleFaultGeometry(self.trace, self.dip, 
                                      self.upper_depth, self.lower_depth)
     self.assertListEqual(self.fault.__dict__.keys(), expected_keys)
     self.assertAlmostEqual(self.fault.length, 60., 5)
     self.assertEqual(self.fault.typology, 'Simple')
     self.assertTrue(isinstance(self.fault.surface, 
                 simple_fault.SimpleFaultSurface))