Within-hour incremental movement data of finishing pigs over 20 days using RFID–LoRaWAN technology
收藏资源简介:
**Version 1.1 (March 2026 update):** Improved description, aggregation instructions, and Python code block for reproducibility. Within-hour incremental movement data of finishing pigs over 20 days using RFID–LoRaWAN technology This dataset contains 1,048,573 repeated within-hour movement increment records collected from 16 finishing pigs during the final 20 days before slaughter (2–21 February 2023) using a custom RFID–LoRaWAN monitoring system. File structure (MOVEMENT_Final.csv): pid_id: Unique pig identifier (string) Day_s: Consecutive day number (1–20, integer) Hour: Start time of the hourly block in HH:MM:SS format (e.g. 13:00:00 = beginning of 13:00–13:59 block) distance: Incremental movement in cm for an approximately 20-second processed output interval In complete pig-day-hour blocks the file typically contains ~180 records (approximately evenly spaced during active periods). The dataset does not include sub-second timestamps beyond the Hour column. How to obtain hourly totals (cm/h): Sum the distance values within each pig × day × hour block: Group by pid_id, Day_s, and integer hour (extracted from Hour timestamp, e.g. pd.to_datetime(Hour).dt.hour in Python) Sum the distance column This aggregation yields 6,026 valid hourly observations out of 7,680 theoretically possible blocks (16 pigs × 20 days × 24 hours). Important notes: Complete data gaps exist due to technical interruptions at the study boundaries: no records for any pig on day 1 from 12:00 onward (initial setup and system stabilization) and on day 20 from 00:00 to 16:00 (pre-slaughter preparations and removal from monitoring). Treat these as missing data rather than zero activity. Dataset completeness varies across pigs (see table in associated Data Descriptor paper for details). Data represent a proxy for movement within the covered pen zone (RSSI-based estimates); interpret with caution due to potential tag orientation and multipath effects. The dataset supports research on activity rhythms, behavioural variability, preprocessing workflows for livestock sensor data, and development of precision livestock farming methods. Python aggregation script (aggregate_to_hourly.py) Here is a simple Python script to aggregate the incremental records to hourly totals: import pandas as pd # Load the CSV (semicolon separated)df = pd.read_csv('MOVEMENT_Final.csv', sep=';') # Convert Hour (HH:MM:SS) to integer hourdf['hour_int'] = pd.to_datetime(df['Hour'], format='%H:%M:%S').dt.hour # Aggregate: sum distance per pig-day-hourhourly = df.groupby(['pid_id', 'Day_s', 'hour_int'])['distance'].sum().reset_index() # Rename for clarityhourly = hourly.rename(columns={'hour_int': 'Hour', 'distance': 'dist_hour_cm'}) # Save the aggregated filehourly.to_csv('aggregated_hourly_movement.csv', index=False) print(f"Number of valid hourly records: {len(hourly)}") # Should be ~6026print(hourly.head()) Usage tip: Run this script in a Python environment with pandas installed. It will produce aggregated_hourly_movement.csv with one row per pig-day-hour. **License:** CC BY 4.0 **Cite as:** Ocepek, M. (2025). Within-hour incremental movement data of finishing pigs over 20 days using RFID–LoRaWAN technology. Zenodo. https://doi.org/10.5281/zenodo.17266727 (version 1.1)



