Read File From InSituInc Aquatroll
Usage
readLogger_InSituInc_Aquatroll(
csv,
headerPattern = NULL,
timestampFormat = c("%d.%m.%Y %H:%M:%S", "%d.%m.%Y%H:%M:%S"),
tz = "Etc/GMT+1",
maxRowToLookForHeader = 700,
model = "",
dbg = FALSE,
fileEncoding = "latin1"
)
Arguments
- csv
full path to logger file
- headerPattern
pattern matching the header of the table. See source code for the default.
- timestampFormat
vector of possible timestamp formats. See help for the default.
- tz
time zone. default: "Etc/GMT+1"
- maxRowToLookForHeader
number of first rows in the file to read in advance to look for the header line. Default: 700
- model
model of the Aquatroll (either "" or "600")
- dbg
if
TRUE
, debug messages are shown- fileEncoding
encoding of the input file. Default: "latin1"
Value
if model = "600" data frame with columns DateTime
,
Seconds
, Temp
, ActCond
, SpecCond
,
TDS
, Resis
, WaterD
, DOC
, DOP
,
Tur
, Sal
otherwise data frame with columns
DateTime
, WaterTemp.C
, SpecCond.uS
Examples
# set path to example file (contained in this package)
file_1 <- extdataFile("InSituInc/example_InSituInc_Aquatroll.csv")
file_2 <- extdataFile("InSituInc/example_InSituInc_Aquatroll_600.csv")
# let's have a look on the file structure (read first 75 lines)
writeLines(kwb.utils::readLinesWithEncoding(file_1, 75, fileEncoding = "latin1"))
#> Report Date:;08.04.2014 12:24:28
#> Report User Name:;miacsomini
#> Report Computer Name:;KWB45
#> Application:;WinSitu.exe
#> Application Version:;5.6.21.0
#>
#>
#> Log File Properties
#> File Name;March19_test_Append_2014-04-08_10-00-41-718.wsl
#> Create Date;08.04.2014 10:00:41
#>
#> Device Properties
#> Device;Aqua TROLL 100
#> Site;Panke Messstelle Bürgerpark
#> Device Name;
#> Serial Number;192791
#> Firmware Version;1.10
#> Hardware Version;2
#> Device Address;1
#> Device Comm Cfg;19200,8,Even,1,(Modbus-RTU)
#> Used Memory;26
#> Used Battery;61
#>
#> Log Configuration
#> ;Log Name;March19_test
#> ;Created By;miacsomini
#> ;Computer Name;KWB45
#> ;Application;WinSitu.exe
#> ;Application Version;5.6.21.0
#> ;Create Date;19.03.2014 16:04:56 Westeuropäische Normalzeit
#> ;Log Setup Time Zone;Westeuropäische Normalzeit
#> ;Notes Size(bytes);4096
#> ;Overwrite when full;Disabled
#> ;Scheduled Start Time;Manual Start
#> ;Scheduled Stop Time;No Stop Time
#> ;Type;Linear
#> ;Interval;Days: 0 hrs: 00 mins: 15 secs: 00
#>
#>
#>
#>
#>
#> Other Log Settings
#>
#> ;Specific Conductivity Model:;Standard Methods
#> ;;Reference Temperature:;25
#> ;;Temperature Coefficient:;0.0191
#>
#>
#> Log Notes:
#> Date and Time;Note
#> 19.03.2014 16:04:59;Sensor SN: 192791 Factory calibration has expired.: 31.07.2012 19:14:39
#> 19.03.2014 16:05:00;Used Battery: 61% Used Memory: 28% User Name: miacsomini
#> 19.03.2014 16:05:22;Manual Start Command
#> 28.03.2014 10:26:46;Log Download - Used Battery: 61% Used Memory: 28% User Name: miacsomini
#> 04.04.2014 12:06:06;Log Download - Used Battery: 62% Used Memory: 28% User Name: miacsomini Interval - Start Time: 28.03.2014 10:20:22
#> 08.04.2014 10:00:20;Log Download - Used Battery: 62% Used Memory: 28% User Name: miacsomini Interval - Start Time: 04.04.2014 12:05:22
#>
#>
#> Log Data:
#> Record Count;1892
#>
#> Sensors;1
#>
#> ,1,192791,Conductivity
#>
#> Time Zone: Westeuropäische Normalzeit/Westeuropäische Sommerzeit
#>
#> ;;Sensor: Cond ;Sensor: Cond ;Sensor: Cond ;
#> ;Elapsed Time;SN#: 192791 ;SN#: 192791 ;SN#: 192791 ;
#> Date and Time;Seconds ;Actual Conductivity (µS) ;Temperature (C) ;Specific Conductivity (µS) ;
#> 19.03.2014 16:05:22; 0.000; 0.000; 15.388; 0.000;
#> 19.03.2014 16:20:22; 900.000; 594.037; 9.188; 851.072;
#> 19.03.2014 16:35:22; 1800.000; 592.425; 9.034; 852.341;
#> 19.03.2014 16:50:22; 2700.000; 591.354; 9.014; 851.265;
# now read the file
x <- readLogger_InSituInc_Aquatroll(csv = file_1)
# show the first lines
head(x)
#> DateTime WaterTemp.C SpecCond.uS
#> 1 2014-03-19 16:05:22 15.388 0.000
#> 2 2014-03-19 16:20:22 9.188 851.072
#> 3 2014-03-19 16:35:22 9.034 852.341
#> 4 2014-03-19 16:50:22 9.014 851.265
#> 5 2014-03-19 17:05:22 9.002 853.110
#> 6 2014-03-19 17:20:22 8.994 851.842
# Read a file of Aquatroll, model "600"
x600 <- readLogger_InSituInc_Aquatroll(csv = file_2, model = "600")
# show the first lines
head(x600)
#> DateTime Seconds Temp ActCond SpecCond TDS Resis WaterD
#> 1 2016-05-23 15:31:50 0 21.989 850.124 901.993 0.586 1176.299 0.998
#> 2 2016-05-23 15:41:50 600 21.958 850.227 902.682 0.587 1176.156 0.998
#> 3 2016-05-23 15:51:50 1200 22.020 852.309 903.728 0.587 1173.284 0.998
#> 4 2016-05-23 16:01:50 1800 22.240 855.438 903.051 0.587 1168.992 0.998
#> 5 2016-05-23 16:11:50 2400 22.323 856.954 903.168 0.587 1166.924 0.998
#> 6 2016-05-23 16:21:50 3000 22.279 856.129 903.067 0.587 1168.048 0.998
#> DOC DOP Tur Sal
#> 1 7.625 85.414 2.280 0.449
#> 2 7.760 86.878 27.350 0.449
#> 3 7.757 86.949 6.956 0.450
#> 4 8.073 90.873 23.021 0.449
#> 5 8.248 92.985 8.576 0.449
#> 6 8.135 91.631 5.611 0.449
# show the structure
str(x600)
#> 'data.frame': 124 obs. of 12 variables:
#> $ DateTime: POSIXct, format: "2016-05-23 15:31:50" "2016-05-23 15:41:50" ...
#> $ Seconds : num 0 600 1200 1800 2400 3000 3600 4200 4800 5400 ...
#> $ Temp : num 22 22 22 22.2 22.3 ...
#> $ ActCond : num 850 850 852 855 857 ...
#> $ SpecCond: num 902 903 904 903 903 ...
#> $ TDS : num 0.586 0.587 0.587 0.587 0.587 0.587 0.587 0.587 0.587 0.587 ...
#> $ Resis : num 1176 1176 1173 1169 1167 ...
#> $ WaterD : num 0.998 0.998 0.998 0.998 0.998 0.998 0.998 0.998 0.998 0.998 ...
#> $ DOC : num 7.62 7.76 7.76 8.07 8.25 ...
#> $ DOP : num 85.4 86.9 86.9 90.9 93 ...
#> $ Tur : num 2.28 27.35 6.96 23.02 8.58 ...
#> $ Sal : num 0.449 0.449 0.45 0.449 0.449 0.449 0.449 0.449 0.449 0.449 ...