-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from SamuelDahlberg/master
Issue #15717 - Makes pco2a_a new sba5 format compatible with parser, using new driver.
- Loading branch information
Showing
3 changed files
with
182 additions
and
44 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
mi/dataset/driver/pco2a_a/sample/pco2a_a_sample_newsba5_telemetered_driver.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
@package mi.dataset.driver.pco2a_a.sample.pco2a_a_sample_newsba5_telemetered_driver | ||
@file mi/dataset/driver/pco2a_a/sample/pco2a_a_sample_newsba5_telemetered_driver.py | ||
@author Samuel Dahlberg | ||
@brief Telemetered driver for pco2a_a_sample data parser with the new sba5 format. | ||
""" | ||
|
||
from mi.dataset.driver.pco2a_a.sample.pco2a_a_sample_driver import process, \ | ||
TELEMETERED_PARTICLE_CLASSES | ||
from mi.core.versioning import version | ||
|
||
from mi.dataset.parser.pco2a_a_sample import Pco2aADclParticleClassKey, \ | ||
Pco2aADclTelemeteredInstrumentDataParticleAirNewSBA5, Pco2aADclTelemeteredInstrumentDataParticleWaterNewSBA5 | ||
|
||
TELEMETERED_PARTICLE_CLASSES_NEWSBA5 = { | ||
Pco2aADclParticleClassKey.AIR_PARTICLE_CLASS: Pco2aADclTelemeteredInstrumentDataParticleAirNewSBA5, | ||
Pco2aADclParticleClassKey.WATER_PARTICLE_CLASS: Pco2aADclTelemeteredInstrumentDataParticleWaterNewSBA5 | ||
} | ||
|
||
@version("0.1.0") | ||
def parse(unused, source_file_path, particle_data_handler): | ||
process(source_file_path, particle_data_handler, TELEMETERED_PARTICLE_CLASSES_NEWSBA5) | ||
|
||
return particle_data_handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
@package mi.dataset.driver.turbd_a | ||
@file mi-dataset/mi/dataset/driver/turbd_a/dcl/turbd_a_dcl_driver.py | ||
@author Samuel Dahlberg | ||
@brief DCL driver for the turbd_a instrument | ||
""" | ||
|
||
from mi.dataset.dataset_driver import SimpleDatasetDriver | ||
from mi.dataset.dataset_parser import DataSetDriverConfigKeys | ||
from mi.dataset.parser.flort_dj_dcl import FlortDjDclParser | ||
|
||
def parse(unused, source_file_path, particle_data_handler): | ||
""" | ||
This is the method called by Uframe | ||
:param unused | ||
:param source_file_path This is the full path and filename of the file to be parsed | ||
:param particle_data_handler Java Object to consume the output of the parser | ||
:return particle_data_handler | ||
""" | ||
|
||
with open(source_file_path, 'rb') as stream_handle: | ||
TurbdADclDriver(unused, stream_handle, particle_data_handler).processFileStream() | ||
|
||
return particle_data_handler | ||
|
||
|
||
class TurbdADclDriver(SimpleDatasetDriver): | ||
""" | ||
The turbd_a driver class extends the SimpleDatasetDriver. | ||
""" | ||
|
||
def __init__(self, unused, stream_handle, particle_data_handler): | ||
super(TurbdADclDriver, self).__init__(unused, stream_handle, particle_data_handler) | ||
|
||
def _build_parser(self, stream_handle): | ||
parser_config = { | ||
DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.flort_dj_dcl', | ||
DataSetDriverConfigKeys.PARTICLE_CLASS: 'TurbdADclDataParticle'} | ||
|
||
parser = FlortDjDclParser(parser_config, stream_handle, self._exception_callback) | ||
|
||
return parser | ||
#!/usr/bin/env python | ||
|
||
""" | ||
@package mi.dataset.driver.turbd_a | ||
@file mi-dataset/mi/dataset/driver/turbd_a/dcl/turbd_a_dcl_driver.py | ||
@author Samuel Dahlberg | ||
@brief DCL driver for the turbd_a instrument | ||
""" | ||
|
||
from mi.dataset.dataset_driver import SimpleDatasetDriver | ||
from mi.dataset.dataset_parser import DataSetDriverConfigKeys | ||
from mi.dataset.parser.flort_dj_dcl import FlortDjDclParser | ||
|
||
def parse(unused, source_file_path, particle_data_handler): | ||
""" | ||
This is the method called by Uframe | ||
:param unused | ||
:param source_file_path This is the full path and filename of the file to be parsed | ||
:param particle_data_handler Java Object to consume the output of the parser | ||
:return particle_data_handler | ||
""" | ||
|
||
with open(source_file_path, 'rb') as stream_handle: | ||
TurbdADclDriver(unused, stream_handle, particle_data_handler).processFileStream() | ||
|
||
return particle_data_handler | ||
|
||
|
||
class TurbdADclDriver(SimpleDatasetDriver): | ||
""" | ||
The turbd_a driver class extends the SimpleDatasetDriver. | ||
""" | ||
|
||
def __init__(self, unused, stream_handle, particle_data_handler): | ||
super(TurbdADclDriver, self).__init__(unused, stream_handle, particle_data_handler) | ||
|
||
def _build_parser(self, stream_handle): | ||
parser_config = { | ||
DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.flort_dj_dcl', | ||
DataSetDriverConfigKeys.PARTICLE_CLASS: 'TurbdADclDataParticle'} | ||
|
||
parser = FlortDjDclParser(parser_config, stream_handle, self._exception_callback) | ||
|
||
return parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters