WHOIGit / PhytO-ARM

PhytO-ARM: Phytoplankton Observing for Automated Real-time Management
https://hablab.whoi.edu/phyto-arm/
GNU General Public License v3.0
0 stars 0 forks source link

AML parser assumes raw values are provided #40

Open rgov opened 7 months ago

rgov commented 7 months ago

The AML parser expects values to be paired with their raw sensor readings, like this:

port1[data=Cond,0.000000,mS/cm][rawi=ADC,563,none][data=TempCT,23.881313,C][rawi=ADC,428710,none]

However this is dependent on the configuration, and raw values might be omitted.

port1[data=Cond,0.000000,mS/cm][data=TempCT,23.881313,C]

The code uses next(iterator) to pull the "raw" key-value parameter following a "data" parameter. To fix this, we would need to do a look-ahead to see whether the following key is rawi or rawf. Unfortunately this would require a different kind of parser.

https://github.com/WHOIGit/PhytO-ARM/blob/d7f493fc8f0bad54a2f68c0af40bf4ada0a84d06/src/aml_ctd/src/amlxparser.py#L27-L34

rgov commented 7 months ago

Workaround: Issue a set scan raw command to the AML.

AML assured us that raw values are always included, but that's not the case.