Package: dulogpy
Pkg: dulogpy
Purpose: Handle data retrived by the duolog bio-logging system (e.g. range and proximity data)
Author: Dr. Jesus R. Hernández Montero
Contact: jesus.hdezmontero@gmail.com
Last uptade: 2023.03.30dulogpyThis is a package with functions for handling files retrived bydulog. Dulog is a bio-logging system based on wireless sensors developed byNiklas Duda. This bio-loging system delivers interactions among components in terms of proximity between them.Dulog componentsThe dulog bio-logging system has the following components (please refer to the developer's manual to read the details about each component):Ground NodesBase Station (BS)Download Station (DS)Mobile Nodes (MN)Stationary Nodes (SN)Retrived dataThe data retrived can be categorized into:Range data: this data is delivered by GN and indicates the detection of a mobile or stationary node within its detectin range. The tables are saved in the files named"RANGE.CSV". BS as well DS deliver this data but tables have subtle differences.Proximity data: this data indicates the interaction between MN-MN, MN-SN and SN-SN. Both ground nodes can save this data in the file"MN_DATA.CSV". This data have redundancy.dulogpyfunctionsThe functions provide in this package are for loading the data (Range and Proximity)into your local environment ready to use for analysis. The functions are the followingmn_range_loader()This function is for load range data delivered by the BS and DS. The functions does the following:Parse datetime columnsTransform datatypesSort records chronologicallySets the date and time as an indexFunction arguments:path: is the directory of the file where the "RANGE.CSV" file is stored.is_ds: indicates if the files comes from a Download Station or not. The default isTrue. If you are loading range data from a Base Station this parameter should be setFalse.mn_data_loader()This function is for loading the proximity data delivered by ground nodes. The function does the following:Parse datetime columns.Transform datatypes.Handle potential duplicates.Sort records chronologically.Sets the date and time as index.Function arguments:path: is the directory of the file where the "MN_DATA.CSV" is stored.no_redundancy()This functions deals with redundancy of the data between dyads. Since Node A meets B and node B meets A, this data is redundant. This function deliver pair-wise interactions of specified nodes. This function uses the output DataFrame delivered by themn_data_loader()function to do the following:Captures interactions between specified nodes (e.g. A-B and B-A).Fill missing values where data is not redundant.Get the maximum RSSI values between nodes (returned in the columnRSSI_max).Specify the dyad in string format in the columdyad.If specified, returns interactions between a time window.Function argumentsdf: DataFrame where the output of themn_data_loader()is stored.Node1: string of the first node of a given dyad (e.g.'A')Node2: string of the second node of a given dyad (e.g.'B')start: datetime string specifying the start of the observation window, it should be specified in the following formatYYYY-MM-DD HH:MM:SS. Default value isNone.end: datetime string specifying the end of the observation window, it should be specified in the following formatYYYY-MM-DD HH:MM:SS. Default value isNone.save_csv()This is a basic function to store, into your working directory, DataFrames as .csv files delivered bymn_range_loader(),mn_data_loader()andno_redundancy().Function arguments:df: DataFrame to be saved as .csvname: name of the file, do not include '.csv' e.g. 'my_file'index: specify is the index should be saved as a column or kept as index. The default value isTruesaving the index as colum. Saving the index as column allows to use the output file in R.