Git Product home page Git Product logo

beam_pdkit's Introduction

beam_pdkit

Beam Pdkit

Install

pip install -r requirements.txt

Run

python welch_beam_pdkit.py

Instructions

It takes as input acceleration data with the id at each line:

timestamp,x,y,z,user_id

As an example take the file: tremor_data_with_user.csv

In this example the method used from pdkit is welch but any method will work as it is now.

Saving results to file

The results are stored in file. Just pass --output="filename.csv to define the file name. By default now is output.csv

2678,10.540682,02:23:00,02:23:30
2678,10.656897,02:22:40,02:23:10
2678,11.103284,02:22:50,02:23:20
2678,9.163072,02:23:10,02:23:40
2678,3.228065,02:23:20,02:23:50
2678,4.506551,02:22:30,02:23:00
2458,62.922552,12:21:40,12:22:10
2458,67.516632,12:21:20,12:21:50
2458,25.660236,12:22:00,12:22:30
2458,4.092081,12:22:10,12:22:40
2458,51.772989,12:21:50,12:22:20
2458,81.424755,12:21:30,12:22:00
3037,24.125740,00:39:30,00:40:00
3037,27.619027,00:39:20,00:39:50
3037,107.838542,00:39:50,00:40:20
3037,165.204399,00:40:00,00:40:30
3037,55.552502,00:39:40,00:40:10
3037,397.174782,00:40:10,00:40:40

where id, welch_value, start, end

Streaming data

This example shows how to use the google cloud streaming.

python welch_beam_pdkit.py --input_topic "projects/<PROJECT>/topics/<TOPIC>" --output_topic
"projects/<PROJECT>/topics/<TOPIC>"

where the parameters are the following:

--input_topic is the Input PubSub topic of the form "projects/<PROJECT>/topics/<TOPIC>" --output_topic is the Output PubSub topic of the form "projects/<PROJECT>/topics/<TOPIC>"

You'll need to register to google cloud services. Install instructions for google cloud. Don't forget to create a project and a topic using for example the command line or using the web interface

There is a supporting file that subscribes to a topic and prints out the messages that come in.

python subscribeToGcloud.py --input_topic "projects/<PROJECT>/topics/<TOPIC>"

Tip: To test the Pub/Sub it's recommended to publish a message with the contents of the file using the google cloud platform interface. It's possible to publish a message just pasting the contents of the file data.

beam_pdkit's People

Contributors

uh-joan avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.