예제 #1
0
 def test_get_units(self):
     """
     Should return (segy units, plot units) or None.
     """
     fig = plt.figure()
     ax = fig.add_subplot(111)
     splt = SEGYPlotManager(ax, self.segy)
     splt.DISTANCE_UNIT = 'distance_unit_marker'
     splt.TIME_UNIT = 'time_unit_marker'
     for key in TRACE_HEADER_KEYS:
         if key in splt.SEGY_TIME_UNITS:
             # should return TIME_UNIT for a time attribute
             self.assertEqual(splt._get_units(key)[1],
                              'time_unit_marker')
         elif key in splt.SEGY_DISTANCE_UNITS:
             # should return DISTANCE_UNIT for a distance attribute
             self.assertEqual(splt._get_units(key)[1],
                              'distance_unit_marker')
         else:
             # should return None values are unitless
             self.assertEqual(splt._get_units(key), None)