diff --git a/geomagio/pcdcp/PCDCPFactory_test.py b/geomagio/pcdcp/PCDCPFactory_test.py index ebcf084ea9b8eebe5a25e3702fb02fc2bd0540bd..7dc149436ee46916081b2d62ca97caa5a96f745c 100644 --- a/geomagio/pcdcp/PCDCPFactory_test.py +++ b/geomagio/pcdcp/PCDCPFactory_test.py @@ -20,7 +20,7 @@ def test_parse_string(): Send a PCDCP file string in to parse_string to make sure a well formed stream is created with proper values. """ - stream = PCDCPFactory().parse_string(pcdcpString) + stream = PCDCPFactory('').parse_string(pcdcpString) assert_equals(type(stream), Stream) assert_equals(stream[0].stats.network, 'NT') diff --git a/geomagio/pcdcp/PCDCPParser.py b/geomagio/pcdcp/PCDCPParser.py index a2deeb81be5deb1b9dd77e28ad3deaff3909bec3..f82a51a1d62a651ce2bb5c0044ad113ba4dcc7b1 100644 --- a/geomagio/pcdcp/PCDCPParser.py +++ b/geomagio/pcdcp/PCDCPParser.py @@ -66,7 +66,7 @@ class PCDCPParser(object): """ self.header['header'] = line self.header['station'] = line[0:3] - self.header['year'] = line[5:10] + self.header['year'] = line[5:9] self.header['yearday'] = line[11:14] self.header['date'] = line[16:25] diff --git a/geomagio/pcdcp/PCDCPParser_test.py b/geomagio/pcdcp/PCDCPParser_test.py index d47e24b4523f5226113473699256d4e9f5772cab..418c5907fb581886fe90b5927ade9d5d2f53e5bf 100644 --- a/geomagio/pcdcp/PCDCPParser_test.py +++ b/geomagio/pcdcp/PCDCPParser_test.py @@ -29,7 +29,7 @@ def test__parse_header(): parser._parse_header('BOU 2015 001 01-Jan-15 HEZF 0.01nT' + ' File Version 2.00') - assert_equals(parser.headers['date'], '01-Jan-15') - assert_equals(parser.headers['observatory'], 'BOU') - assert_equals(parser.headers['year'], '2015') - assert_equals(parser.headers['yearday'], '001') + assert_equals(parser.header['date'], '01-Jan-15') + assert_equals(parser.header['station'], 'BOU') + assert_equals(parser.header['year'], '2015') + assert_equals(parser.header['yearday'], '001')