Skip to content
Snippets Groups Projects
Commit 6e517c2f authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

improve test for ctd and ctd.header

parent 9cd16f2d
No related branches found
No related tags found
No related merge requests found
...@@ -22,17 +22,17 @@ titleSummary = "CTD profiles processed during PIRATA-FR29 cruise" ...@@ -22,17 +22,17 @@ titleSummary = "CTD profiles processed during PIRATA-FR29 cruise"
typeInstrument = "SBE911+" typeInstrument = "SBE911+"
instrumentNumber = "09P1263" instrumentNumber = "09P1263"
[ctd.header] [ctd.header]
isHeader = '^[*#]' isHeader = '^[*#]'
isDevice = '^\*\s+(Sea-Bird)' isDevice = '^\*\s+(Sea-Bird)'
DATETIME = 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)' DATETIME = 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)'
LATITUDE = 'NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+\.\d+)\s+(\w)' LATITUDE = 'NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+\.\d+)\s+(\w)'
LONGITUDE = 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)' LONGITUDE = 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)'
DATE = 'Date\s*:\s*(\d+)/(\d+)/(\d+)' DATE = 'Date\s*:\s*(\d+)/(\d+)/(\d+)'
TIME = '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)' TIME = '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)'
bottomDepth = 'Bottom Depth\s*:\s*(\d*\.?\d+?)\s*\S*' bottomDepth = 'Bottom Depth\s*:\s*(\d*\.?\d+?)\s*\S*'
operator = 'Operator\s*:\s*(.*)' operator = 'Operator\s*:\s*(.*)'
type = 'Type\s*:\s*(.*)' type = 'Type\s*:\s*(.*)'
[btl] [btl]
typeInstrument = "SBE32 standard 24 Niskin bottles" typeInstrument = "SBE32 standard 24 Niskin bottles"
......
...@@ -20,14 +20,14 @@ class testConfig(unittest.TestCase): ...@@ -20,14 +20,14 @@ class testConfig(unittest.TestCase):
'creator': 'Jacques.Grelet@ird.fr'} 'creator': 'Jacques.Grelet@ird.fr'}
self.ctd = {'cruisePrefix': 'fr29', 'station': 'Station\\s*:\\s*\\D*(\\d*)', 'stationPrefixLength': 3, self.ctd = {'cruisePrefix': 'fr29', 'station': 'Station\\s*:\\s*\\D*(\\d*)', 'stationPrefixLength': 3,
'titleSummary': 'CTD profiles processed during PIRATA-FR29 cruise', 'typeInstrument': 'SBE911+', 'titleSummary': 'CTD profiles processed during PIRATA-FR29 cruise', 'typeInstrument': 'SBE911+',
'instrumentNumber': '09P1263', 'isHeader': '^[*#]', 'isDevice': ['^\\*\\s+(Sea-Bird)', '(\\*END\\*)'], 'instrumentNumber': '09P1263', 'header': {'isHeader': '^[*#]', 'isDevice': '^\\*\\s+(Sea-Bird)',
'latitude': 'NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)', 'LATITUDE': 'NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+\.\d+)\s+(\w)',
'longitude': 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)', 'LONGITUDE': 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)',
'time': 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)', 'DATETIME': 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)',
'date': 'Date\s*:\s*(\d+)/(\d+)/(\d+)', 'DATE': 'Date\s*:\s*(\d+)/(\d+)/(\d+)',
'hour': '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)', 'TIME': '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)',
'bottomDepth': 'Bottom Depth\\s*:\\s*(\\d*\\.?\\d+?)\\s*\\S*', 'operator': 'Operator\\s*:\\s*(.*)', 'bottomDepth': 'Bottom Depth\\s*:\\s*(\\d*\\.?\\d+?)\\s*\\S*', 'operator': 'Operator\\s*:\\s*(.*)',
'type': 'Type\\s*:\\s*(.*)'} 'type': 'Type\\s*:\\s*(.*)'}}
self.splitCtd = {'ETDD': 2, 'PRES': 3, 'DEPTH': 4, 'TEMP': 5, 'PSAL': 18, self.splitCtd = {'ETDD': 2, 'PRES': 3, 'DEPTH': 4, 'TEMP': 5, 'PSAL': 18,
'DENS': 20, 'SVEL': 22, 'DOX2': 16, 'FLU2': 14, 'FLU3': 15, 'TUR3': 13, 'NAVG': 23} 'DENS': 20, 'SVEL': 22, 'DOX2': 16, 'FLU2': 14, 'FLU3': 15, 'TUR3': 13, 'NAVG': 23}
self.splitCtdAll = {'ETDD': 2, 'PRES': 3, 'DEPTH': 4, 'TE01': 5, 'TE02': 6, 'CND1': 7, 'CND2': 8, 'DOV1': 9, 'DOV2': 10, 'DVT1': 11, 'DVT2': 12, self.splitCtdAll = {'ETDD': 2, 'PRES': 3, 'DEPTH': 4, 'TE01': 5, 'TE02': 6, 'CND1': 7, 'CND2': 8, 'DOV1': 9, 'DOV2': 10, 'DVT1': 11, 'DVT2': 12,
...@@ -54,7 +54,7 @@ class testConfig(unittest.TestCase): ...@@ -54,7 +54,7 @@ class testConfig(unittest.TestCase):
d = self.cfg['ctd'] d = self.cfg['ctd']
for k in d.keys(): for k in d.keys():
self.assertEqual(d[k], self.ctd[k]) self.assertEqual(d[k], self.ctd[k])
def test_split_ctd(self): def test_split_ctd(self):
""" Test if all value in block [SPLIT.CTD] are correct """ """ Test if all value in block [SPLIT.CTD] are correct """
d = self.cfg['split']['ctd'] d = self.cfg['split']['ctd']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment