Skip to content

Commit

Permalink
bug fix for AML driver
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Apr 15, 2024
1 parent 9b510aa commit 2190160
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 17 deletions.
209 changes: 209 additions & 0 deletions data/input/aml/aml_log_2024-04-07_20-39-17.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
[Header]
Date=2024-04-07
Time=20:39:17
CfgSaveAlarmSec=1
BatShutdownThres=6.20
BatWarningThres=6.90
Model=AML-3
SerialNumber=A31202
WifiSsid=AML_A31202
WapStopDelaySec=60
UpdateStatus=0
MinimumSleepTimeSecs=40
MuxVersion=3.2.2
HardwareVersion=03
Firmware=3.2.2
USBMacAddress=
Type=Logger
WakeOnPower=no
BatVNoBoot=0.00
BatINoBoot=0
ChgIntEna=yes
PWRRev=3
GPSEnabled=yes
WiFiEnabled=yes
UserBaudrate=115200
SampleRateHzMax=20
SensorSampleRate=2
SensorSampleRateUnits=/sec
ScanRateMillisecs=500
SampleRateMillisecs=50
SampleScanRatio=10
BurstIntervalSecs=30
BurstSamples=10
BurstMonitor=Samples
ScanTrigger=Time
ScanMode=Single
LogMode=Auto
LogFileType=Columns
DateFormat=yyyy-mm-dd
WifiPassword=A31202A31202
GnssMgaDbdAssist=yes
GnssOfflineAssist=yes
LocationMode=Instrument
Latitude=44.12345
Longitude=0.00000
SvWaterThreshold=1000.00
SvWetCount=3
SvDryCount=7
CndWaterThreshold=0.30
CndWetCount=3
CndDryCount=7
PrsWaterThreshold=99999.00
PrsWetCount=3
PrsDryCount=7
SoundInc=0.00
PressureInc=0.50
DeriveDensity=yes
DeriveDepth=yes
DeriveSoundvelocity=yes
DeriveSalinity_C=yes
DeriveSalinity_SV=yes
DisplaySerialNumber=no
DisplayDate=yes
DisplayTime=yes
DisplayBattery=yes
DisplayVbat=yes
DisplayIbat=no
DisplayVext=no
DisplayIext=no
DisplayChargeState=no
DisplayRawValues=yes
DisplayDensity=yes
DisplayDepth=yes
DisplaySalinity=yes
DisplaySoundVelocity=yes
RelayMode=RS232 mode
UsePressureOffset=no
PowerOffTimeout=20
MonitorFormat=columns
MonitorCustomColumns=
MonitorDelimiter=comma
AutoMonitor=0
MonitorSync=0
StartupMonitor=no
RobustMonitor=no
MonitorLog=no
MonitorChecksum=no
SleepMode=no
SleepDelay=5
StartupPrompt=yes
SendWakeUpEnable=no
SendWakeUpDelay=0
SendWakeUpChars=
SDfilesys=ext4
TotalMemory=30477881344
MemoryUsed=47124480
UvEnabled=no
UvOnTime=0
UvOffTime=0
GPSLatitude=46.01474
GPSLongitude=-66.63000
GPSHDOP=3.22
GeoLocationSource=Instrument


[SensorMetaData]
Columns=Port,Model,SerialNumber,Firmware,Parameter,Units,CalibrationDate,CalibrationTime,Accuracy,RangeMin,RangeMax

[SensorData]
1,CT.X2,451884,1.00.1,Cond,mS/cm,2024-01-30,14:15:31,0.008,0,90
1,CT.X2,451884,1.00.1,TempCT,C,2024-02-08,08:04:19,0.002,-5,45
2,P.X2,309183,1.07.0,Pressure,dBar,2023-12-27,07:44:59,0.004,0,500
3,SV.X2,212610,2.02.0,SV,m/s,2024-02-16,06:43:26,0.017,1413,1509

[MeasurementMetadata]
Columns=Date,Time,Vbat,Cond,ADC,TempCT,ADC,Pressure,ADC,SV,NSV,Salinity,Density,CalcSV,Depth
Units=yyyy-mm-dd,hh:mm:ss.ss,V,mS/cm,none,C,none,dBar,2sComp,m/s,samples,PSU,kg/cm3,m/s,m

[MeasurementData]
2024-04-07,20:39:17.58,8.05,0.041,603,5.705,178218,-0.26038,835058,1460.429,3597.670166,0.029734,999.974182,1429.336426,-0.25824
2024-04-07,20:39:18.08,8.05,21.630,28181,4.901,168280,-0.08679,837389,1425.624,3599.361328,21.721230,1017.174316,1453.438721,-0.08607
2024-04-07,20:39:18.58,8.05,21.692,28259,4.786,166870,0.00549,838628,1425.455,3599.546875,21.863800,1017.296570,1453.133545,0.00544
2024-04-07,20:39:19.08,8.05,21.694,28262,4.765,166615,0.12844,840279,1425.149,3600.310303,21.880077,1017.311646,1453.067749,0.12738
2024-04-07,20:39:19.58,8.04,21.695,28264,4.773,166705,0.15033,840573,1425.812,3597.560547,21.876945,1017.308716,1453.095337,0.14910
2024-04-07,20:39:20.08,8.04,21.699,28268,4.793,166955,0.12144,840185,1425.996,3598.128906,21.866951,1017.299072,1453.168823,0.12044
2024-04-07,20:39:20.58,8.05,21.699,28268,4.763,166586,0.11839,840144,1425.927,3598.235352,21.886822,1017.317139,1453.066162,0.11741
2024-04-07,20:39:21.08,8.05,21.699,28269,4.783,166828,0.13559,840375,1425.890,3598.416260,21.874641,1017.306030,1453.134888,0.13448
2024-04-07,20:39:21.58,8.05,21.702,28273,4.848,167629,0.14386,840486,1425.820,3598.626709,21.835058,1017.269653,1453.362061,0.14267
2024-04-07,20:39:22.08,8.05,21.702,28273,4.801,167051,0.15346,840615,1425.748,3598.788086,21.866087,1017.297913,1453.201538,0.15220
2024-04-07,20:39:22.58,8.05,21.706,28278,4.827,167367,0.14453,840495,1425.682,3598.880371,21.853420,1017.285828,1453.294678,0.14334
2024-04-07,20:39:23.08,8.05,21.705,28276,4.782,166827,0.11422,840088,1425.750,3598.737305,21.880741,1017.310791,1453.141968,0.11328
2024-04-07,20:39:23.58,8.05,21.710,28282,4.886,168097,0.17305,840878,1425.676,3599.064941,21.817734,1017.253052,1453.502197,0.17163
2024-04-07,20:39:24.08,8.05,21.713,28286,4.872,167920,0.12799,840273,1425.707,3598.785156,21.830664,1017.264160,1453.456787,0.12694
2024-04-07,20:39:24.58,8.05,21.716,28290,4.910,168394,0.14862,840550,1425.602,3599.032959,21.808744,1017.243896,1453.592773,0.14740
2024-04-07,20:39:25.08,8.05,21.721,28297,4.888,168118,0.13358,840348,1425.860,3598.468262,21.829525,1017.262024,1453.523682,0.13248
2024-04-07,20:39:25.58,8.05,21.724,28300,4.891,168156,0.14624,840518,1425.835,3598.466309,21.830067,1017.262268,1453.537720,0.14504
2024-04-07,20:39:26.08,8.05,21.725,28302,4.886,168097,0.12650,840253,1425.962,3598.156006,21.834953,1017.266418,1453.523193,0.12546
2024-04-07,20:39:26.58,8.05,21.731,28310,4.821,167296,0.13551,840374,1426.642,3596.150879,21.884815,1017.311096,1453.309814,0.13440
2024-04-07,20:39:27.08,8.05,21.734,28313,4.843,167565,0.17297,840877,1425.919,3598.462646,21.872929,1017.300110,1453.388428,0.17155
2024-04-07,20:39:27.58,8.05,21.737,28317,4.883,168056,0.16016,840705,1425.866,3598.479492,21.850037,1017.278748,1453.528809,0.15885
2024-04-07,20:39:28.08,8.05,21.742,28324,4.808,167144,0.14803,840542,1426.270,3597.481445,21.905060,1017.328125,1453.283081,0.14681
2024-04-07,20:39:28.58,8.05,21.748,28331,4.894,168188,0.10878,840015,1426.071,3598.017578,21.855030,1017.281616,1453.579834,0.10789
2024-04-07,20:39:29.08,8.05,21.753,28337,4.936,168706,0.12516,840235,1426.070,3597.995605,21.832468,1017.260498,1453.729980,0.12414
2024-04-07,20:39:29.58,8.05,21.759,28345,4.935,168693,0.06953,839488,1426.141,3597.816895,21.840057,1017.266296,1453.734253,0.06896
2024-04-07,20:39:30.08,8.05,21.763,28350,4.830,167405,0.07430,839552,1425.602,3599.069336,21.913445,1017.332703,1453.382935,0.07369
2024-04-07,20:39:30.58,8.05,21.766,28354,4.842,167554,0.09120,839779,1425.966,3598.084961,21.908867,1017.328186,1453.428955,0.09045
2024-04-07,20:39:31.08,8.05,21.771,28361,4.879,168013,0.07676,839585,1425.856,3598.631836,21.890236,1017.310425,1453.563599,0.07613
2024-04-07,20:39:31.58,8.05,21.778,28370,4.841,167545,0.09076,839773,1425.286,3600.123291,21.923136,1017.339539,1453.443848,0.09001
2024-04-07,20:39:32.08,8.05,21.783,28376,4.820,167287,0.06871,839477,1425.359,3599.461914,21.942215,1017.356201,1453.378540,0.06815
2024-04-07,20:39:32.58,8.05,21.789,28383,4.781,166810,0.05680,839317,1425.793,3598.782227,21.974018,1017.384338,1453.253540,0.05633
2024-04-07,20:39:33.08,8.05,21.795,28391,4.804,167096,0.07244,839527,1425.394,3599.701660,21.965458,1017.375854,1453.342041,0.07184
2024-04-07,20:39:33.58,8.05,21.802,28400,4.824,167339,0.08651,839716,1425.766,3598.327148,21.960096,1017.370056,1453.419556,0.08580
2024-04-07,20:39:34.08,8.05,21.806,28405,4.764,166605,0.07884,839613,1425.854,3598.426025,22.004103,1017.409607,1453.221069,0.07819
2024-04-07,20:39:34.58,8.05,21.812,28413,4.783,166836,0.06499,839427,1425.648,3598.941895,21.998503,1017.403625,1453.293701,0.06446
2024-04-07,20:39:35.08,8.05,21.819,28422,4.788,166896,0.07095,839507,1425.522,3599.467773,22.003025,1017.406799,1453.320435,0.07036
2024-04-07,20:39:35.58,8.05,21.823,28427,4.750,166429,0.07273,839531,1425.666,3598.834229,22.032656,1017.433289,1453.196167,0.07214
2024-04-07,20:39:36.08,8.05,0.445,1119,4.792,166948,0.04146,839111,1425.535,3599.278809,0.353240,1000.253784,1425.701660,0.04112
2024-04-07,20:39:36.58,8.05,0.076,647,4.781,166811,0.06439,839419,1425.560,3599.205078,0.057473,1000.016479,1425.261719,0.06386
2024-04-07,20:39:37.08,8.05,0.072,642,4.760,166555,0.06633,839445,1425.586,3599.142090,0.054453,1000.014343,1425.163452,0.06579
2024-04-07,20:39:37.58,8.05,0.072,642,4.803,167075,0.06827,839471,1425.496,3599.144531,0.054385,1000.013733,1425.354736,0.06771
2024-04-07,20:39:38.08,8.05,0.077,648,4.812,167187,0.03937,839083,1426.299,3597.446777,0.058031,1000.016418,1425.400391,0.03905
2024-04-07,20:39:38.58,8.05,0.073,643,4.862,167806,0.06402,839414,1425.158,3600.460693,0.054898,1000.013306,1425.623901,0.06350
2024-04-07,20:39:39.08,8.05,0.073,644,4.780,166802,0.01085,838700,1425.084,3600.392090,0.055641,1000.014771,1425.255127,0.01076
2024-04-07,20:39:39.58,8.05,0.073,643,4.808,167143,0.01360,838737,1425.020,3600.446045,0.054986,1000.013855,1425.379761,0.01349
2024-04-07,20:39:40.08,8.05,0.072,642,4.757,166520,-0.00092,838542,1425.393,3599.626953,0.054458,1000.014038,1425.149536,-0.00091
2024-04-07,20:39:40.58,8.05,0.070,640,4.770,166672,-0.04188,837992,1425.381,3599.766113,0.053216,1000.012695,1425.203247,-0.04154
2024-04-07,20:39:41.08,8.05,0.071,641,4.762,166575,0.00668,838644,1425.290,3599.911621,0.053839,1000.013489,1425.169067,0.00662
2024-04-07,20:39:41.58,8.05,0.072,642,4.762,166573,-0.01522,838350,1425.150,3600.245850,0.054451,1000.013916,1425.168823,-0.01509
2024-04-07,20:39:42.08,8.05,0.072,642,4.777,166762,-0.04113,838002,1425.181,3600.298096,0.054426,1000.013550,1425.237915,-0.04080
2024-04-07,20:39:42.58,8.05,0.072,642,4.763,166585,-0.02341,838240,1425.126,3600.356201,0.054449,1000.013855,1425.173096,-0.02322
2024-04-07,20:39:43.08,8.05,0.072,642,4.750,166427,-0.03525,838081,1425.386,3599.554688,0.054470,1000.013977,1425.114746,-0.03496
2024-04-07,20:39:43.58,8.05,0.069,639,4.763,166588,-0.09788,837240,1425.335,3599.980469,0.052615,1000.012024,1425.170654,-0.09708
2024-04-07,20:39:44.08,8.05,0.070,640,4.740,166313,-0.08746,837380,1425.167,3600.183838,0.053262,1000.012878,1425.070312,-0.08674
2024-04-07,20:39:44.58,8.05,0.069,639,4.765,166617,-0.08180,837456,1425.174,3600.187256,0.052611,1000.012024,1425.181519,-0.08112
2024-04-07,20:39:45.08,8.05,0.069,638,4.749,166413,-0.09073,837336,1425.130,3600.361084,0.052026,1000.011719,1425.105469,-0.08999
2024-04-07,20:39:45.58,8.05,0.069,638,4.814,167213,-0.08381,837429,1424.981,3600.681641,0.051925,1000.010864,1425.399902,-0.08312
2024-04-07,20:39:46.08,8.05,0.068,637,4.798,167012,-0.09758,837244,1424.960,3600.760498,0.051341,1000.010559,1425.324951,-0.09678
2024-04-07,20:39:46.58,8.05,0.068,637,4.785,166857,-0.10310,837170,1425.154,3600.393555,0.051360,1000.010681,1425.267944,-0.10225
2024-04-07,20:39:47.08,8.05,0.067,636,4.803,167073,-0.11546,837004,1425.089,3600.391357,0.050723,1000.009888,1425.346313,-0.11451
2024-04-07,20:39:47.58,8.05,0.068,637,4.763,166591,-0.11464,837015,1425.065,3600.483398,0.051393,1000.010925,1425.169800,-0.11370
2024-04-07,20:39:48.08,8.05,0.067,636,4.717,166025,-0.10719,837115,1425.030,3600.653320,0.050852,1000.011108,1424.960571,-0.10631
2024-04-07,20:39:48.58,8.05,0.067,636,4.764,166597,-0.06146,837729,1424.932,3600.810547,0.050781,1000.010681,1425.172119,-0.06096
2024-04-07,20:39:49.08,8.05,0.066,635,4.774,166722,-0.08083,837469,1424.896,3600.914795,0.050155,1000.009949,1425.216919,-0.08016
2024-04-07,20:39:49.58,8.05,0.066,635,4.779,166785,-0.07278,837577,1424.902,3600.878906,0.050147,1000.009949,1425.240234,-0.07219
2024-04-07,20:39:50.08,8.05,0.068,637,4.763,166586,-0.09565,837270,1424.938,3600.795410,0.051394,1000.011047,1425.168335,-0.09486
2024-04-07,20:39:50.58,8.05,0.066,634,4.753,166467,-0.07792,837508,1424.940,3600.865479,0.049574,1000.009766,1425.122314,-0.07728
2024-04-07,20:39:51.08,8.05,0.068,637,4.740,166308,-0.10347,837165,1424.895,3600.898926,0.051428,1000.011292,1425.065796,-0.10262
2024-04-07,20:39:51.58,8.05,0.067,636,4.747,166391,-0.10123,837195,1424.883,3600.947266,0.050806,1000.010742,1425.095581,-0.10040
2024-04-07,20:39:52.08,8.05,0.066,635,4.782,166822,-0.07889,837495,1424.873,3600.966309,0.050143,1000.009888,1425.253784,-0.07824
2024-04-07,20:39:52.58,8.05,0.067,636,4.749,166423,-0.08537,837408,1424.859,3601.000244,0.050803,1000.010742,1425.107544,-0.08467
2024-04-07,20:39:53.08,8.05,0.068,637,4.766,166631,-0.08172,837457,1424.895,3600.912598,0.051388,1000.011047,1425.185059,-0.08105
2024-04-07,20:39:53.58,8.05,0.067,636,4.735,166247,-0.06839,837636,1424.920,3600.887451,0.050824,1000.011047,1425.042969,-0.06783
2024-04-07,20:39:54.08,8.05,0.066,635,4.750,166435,-0.08388,837428,1424.959,3600.796387,0.050190,1000.010254,1425.111206,-0.08319
2024-04-07,20:39:54.58,8.05,0.066,635,4.711,165956,-0.07949,837487,1424.913,3600.849854,0.050248,1000.010803,1424.934692,-0.07884
2024-04-07,20:39:55.08,8.05,0.068,637,4.750,166431,-0.07457,837553,1424.901,3600.891602,0.051413,1000.011292,1425.111572,-0.07396
2024-04-07,20:39:55.58,8.05,0.068,637,4.713,165981,-0.07301,837574,1424.886,3600.941406,0.051469,1000.011780,1424.945557,-0.07241
2024-04-07,20:39:56.08,8.05,0.068,637,4.735,166246,-0.04315,837975,1424.867,3600.992920,0.051436,1000.011658,1425.043823,-0.04279
2024-04-07,20:39:56.58,8.05,0.068,637,4.746,166384,-0.03905,838030,1424.863,3600.991699,0.051419,1000.011536,1425.094727,-0.03873
2024-04-07,20:39:57.08,8.05,0.068,637,4.702,165837,-0.06698,837655,1424.881,3600.956787,0.051487,1000.011963,1424.892578,-0.06643
2024-04-07,20:39:57.58,8.05,0.068,637,4.753,166462,-0.08306,837439,1424.886,3600.957520,0.051409,1000.011230,1425.122803,-0.08238
2024-04-07,20:39:58.08,8.05,0.067,636,4.721,166081,-0.10131,837194,1424.878,3600.939453,0.050845,1000.011047,1424.981323,-0.10048
2024-04-07,20:39:58.58,8.05,0.067,636,4.754,166480,-0.07211,837586,1424.872,3600.986816,0.050795,1000.010742,1425.128784,-0.07152
2024-04-07,20:39:59.08,8.05,0.068,637,4.759,166540,-0.09974,837215,1424.904,3600.873779,0.051399,1000.011047,1425.151245,-0.09893
2024-04-07,20:39:59.58,8.05,0.067,636,4.739,166293,-0.09505,837278,1424.924,3600.847168,0.050819,1000.010864,1425.059570,-0.09427
2024-04-07,20:40:00.08,8.05,0.069,638,4.745,166374,-0.12901,836822,1424.901,3600.929688,0.052031,1000.011597,1425.090454,-0.12795
2024-04-07,20:40:00.58,8.05,0.068,637,4.737,166265,-0.13415,836753,1424.889,3600.903809,0.051434,1000.011169,1425.049438,-0.13305
2024-04-07,20:40:01.08,8.05,0.069,638,4.770,166680,-0.14242,836642,1424.910,3600.835205,0.051992,1000.011169,1425.203003,-0.14125
2024-04-07,20:40:01.58,8.05,0.069,638,4.779,166780,-0.18926,836013,1424.997,3600.377930,0.051980,1000.010864,1425.239014,-0.18771
2024-04-07,20:40:02.08,8.05,0.064,632,4.888,168124,-0.43748,832680,1545.581,3356.670898,0.048158,1000.005066,1425.723755,-0.43389
2 changes: 1 addition & 1 deletion hyo2/ssm2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger.addHandler(logging.NullHandler())

name = "Sound Speed"
__version__ = '2024.0.4'
__version__ = '2024.0.5'
__copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping'

pkg_info = PkgInfo(
Expand Down
40 changes: 24 additions & 16 deletions hyo2/ssm2/lib/formats/readers/aml.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def __init__(self):
self.header = "[header]"
self.date = "date"
self.time = "time"
self.lat = "latitude"
self.long = "longitude"
self.lat2 = "gpslatitude"
self.long2 = "gpslongitude"
self.lat = "gpslatitude"
self.long = "gpslongitude"
self.lat2 = "latitude"
self.long2 = "longitude"
self.serial = "serialnumber"
self.serial2 = "sn"

Expand Down Expand Up @@ -199,6 +199,8 @@ def _aml_header(self):
time = None
lat = None
lon = None
lat2 = None
lon2 = None

for row_nr, line in enumerate(self.lines):

Expand Down Expand Up @@ -251,34 +253,34 @@ def _aml_header(self):
lat = None
continue

if (tokens[0].lower() == self._aml.lat2) and (lat is None):
if tokens[0].lower() == self._aml.long:
try:
if not math.isclose(float(tokens[1]), 0.0):
lat = float(tokens[1])
lon = float(tokens[1])
else:
lat = None
lon = None
except ValueError: # it may be no-lock
lat = None
lon = None
continue

if tokens[0].lower() == self._aml.long:
if tokens[0].lower() == self._aml.lat2:
try:
if not math.isclose(float(tokens[1]), 0.0):
lon = float(tokens[1])
lat2 = float(tokens[1])
else:
lon = None
lat2 = None
except ValueError: # it may be no-lock
lon = None
lat2 = None
continue

if (tokens[0].lower() == self._aml.long2) and (lon is None):
if tokens[0].lower() == self._aml.long2:
try:
if not math.isclose(float(tokens[1]), 0.0):
lon = float(tokens[1])
lon2 = float(tokens[1])
else:
lon = None
lon2 = None
except ValueError: # it may be no-lock
lon = None
lon2 = None
continue

if tokens[0].lower() == self._aml.serial:
Expand Down Expand Up @@ -315,6 +317,12 @@ def _aml_header(self):
(self.ssp.cur.meta.latitude is None) and (self.ssp.cur.meta.longitude is None):
self.ssp.cur.meta.latitude = lat
self.ssp.cur.meta.longitude = lon
logger.debug("retrieved GPS location: (%s, %s)" % (self.ssp.cur.meta.longitude, self.ssp.cur.meta.latitude))

elif (lat2 is not None) and (lon2 is not None) and \
(self.ssp.cur.meta.latitude is None) and (self.ssp.cur.meta.longitude is None):
self.ssp.cur.meta.latitude = lat2
self.ssp.cur.meta.longitude = lon2
logger.debug("retrieved location: (%s, %s)" % (self.ssp.cur.meta.longitude, self.ssp.cur.meta.latitude))

if (date is not None) and (time is not None):
Expand Down

0 comments on commit 2190160

Please sign in to comment.