def test_parse_quadrant(self): data = [('N30E', 30), ('E30N', 60), ('E30S', 120), ('S80E', 100), ('S10W', 190), ('W10S', 260), ('W30N', 300), ('N10E', 10), ('N10W', 350), ('N 10 W', 350), ] for strike, azi in data: assert azi == mplstereonet.parse_quadrant_measurement(strike)
def test_parse_quadrant(self): data = [ ('N30E', 30), ('E30N', 60), ('E30S', 120), ('S80E', 100), ('S10W', 190), ('W10S', 260), ('W30N', 300), ('N10E', 10), ('N10W', 350), ('N 10 W', 350), ] for strike, azi in data: assert azi == mplstereonet.parse_quadrant_measurement(strike)
""" Basic quadrant, strike/dip, and rake parsing. `mplstereonet` expects measurements to follow the "right-hand-rule" (RHR) to indicate dip direction. If you have a set of measurements that don't necessarily follow the RHR, there are a number of parsing and standardization functions in `mplstereonet` to correct for this. """ import mplstereonet print('Parse quadrant azimuth measurements') for original in ['N30E', 'E30N', 'W10S', 'N 10 W']: azi = mplstereonet.parse_quadrant_measurement(original) print('"{}" --> {:.1f}'.format(original, azi)) print('\nParse quadrant strike/dip measurements.') print('Note that the output follows the right-hand-rule.') def parse_sd(original, seperator): strike, dip = mplstereonet.parse_strike_dip(*original.split(seperator)) print('"{}" --> Strike: {:.1f}, Dip: {:.1f}'.format(original, strike, dip)) parse_sd('215/10', '/') parse_sd('215/10E', '/') parse_sd('215/10NW', '/') parse_sd('N30E/45NW', '/') parse_sd('E10N\t20 N', '\t') parse_sd('W30N/46.7 S', '/')
def test_parse_quadrant_errors(self): data = ['N10S', 'S80N', 'E10W', 'W30E'] for quad in data: with pytest.raises(ValueError): mplstereonet.parse_quadrant_measurement(quad)
def test_parse_quadrant_errors(self): data = ['N10S', 'S80N', 'E10W', 'W30E'] for quad in data: with pytest.raises(ValueError): mplstereonet.parse_quadrant_measurement(quad)