Metadata-Version: 2.1
Name: agcounts
Version: 0.1.3
Summary: This project contains code to generate activity counts from accelerometer data.
Home-page: https://github.com/actigraph/agcounts
License: GPL-3.0-or-later
Author: Actigraph LLC
Author-email: data.science@theactigraph.com
Maintainer: Ali Neishabouri
Maintainer-email: ali.neishabouri@theactigraph.com
Requires-Python: >=3.7,<3.11
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: numpy (>=1.21.5,<2.0.0)
Requires-Dist: pandas (>=1.0.5,<2.0.0)
Requires-Dist: scipy (>=1.7.0,<2.0.0)
Project-URL: Repository, https://github.com/actigraph/agcounts
Description-Content-Type: text/markdown

# agcounts
![Tests](https://github.com/actigraph/agcounts/actions/workflows/tests.yml/badge.svg)

A python package for extracting actigraphy counts from accelerometer data. 

## Install
```bash
pip install agcounts
```
## Test
Download test data:
```bash
curl -L https://github.com/actigraph/agcounts/files/8247896/GT3XPLUS-AccelerationCalibrated-1x8x0.NEO1G75911139.2000-01-06-13-00-00-000-P0000.sensor.csv.gz --output data.csv.gz
```

Run a simple test
```python
from pandas import read_csv
import numpy as np
from agcounts.extract import get_counts

def get_counts_csv(file, freq: int, epoch: int, fast: bool = True, verbose: bool = False):
  if verbose:
    print("Reading in CSV", flush = True)
  raw = read_csv(file, skiprows=0)
  raw = raw[["X", "Y", "Z"]]
  if verbose:
    print("Converting to array", flush = True)  
  raw = np.array(raw)
  if verbose:
    print("Getting Counts", flush = True)    
  counts = get_counts(raw, freq = freq, epoch = epoch, fast = fast, verbose = verbose)
  del raw
  return counts

counts = get_counts_csv("data.csv.gz", freq = 80, epoch = 60)
```
