Skip to content
/ TimeSeriesDataCapture Public template

This is the parent project for a suite of applications which take time series data from an instrument, store as tagged, searchable, indexed files, and display on a publicly accessible website.

License

Notifications You must be signed in to change notification settings

CMDT/TimeSeriesDataCapture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimeSeriesDataCapture

This is the parent project for a suite of applications which take time series data from an instrument, store as tagged, searchable, indexed files, and display on a publicly accessible website.
Here is the original briefing note

How it's used

Researchers commonly use instruments which save their data in a convenient data format. CSV (comma seperated values) are the de facto standard. The advent of remote file stores, like Microsoft OneDrive make it easy for researchers to share this data between research groups. That's the raw data - but how about if you want to discuss or compare different sets of data? That means importing particular data to a a spreadsheet, wrangling and formatting and then distributing the files. Often by email.

What we wanted to do with this project was to make it much, much easier for that data to be communicated.

Here's what you can do with this project:

  1. Import the raw data from a CSV file in OneDrive (other file store providers can be accomodated)
  2. Tag the data to make it easily discoverable
  3. View: Pan, Zoom the data
  4. Add annotations to particular points in the data
  5. Compare: add another data set, offset it to compare features
  6. Make your data sharable, by adding a 'public' tag.
  7. Share a particular view of the data, as a URL

Developing the project

This project is open source; we welcome use, feedback and pull requests. The project will also feature in MMU CMDT's Professional Development module as a Live Project: Student teams will be adding features to their own forks, and submitting pull requests.


Sub Projects

BrowseData

ImportSource

Single Page Web Application

Private

Trello

Trello Team
Parent Trello Board

Wireframes

Github Pages On the Repo

Setup

MongoDB Hosting

The MongoDB database will store the runs, authentication, algorithms palettes and tags. To host the database a combination of Heroku and mLab will be used.

Prerequisites

Heroku Account

To host the database first a Heroku account is needed, sign up to Heroku

Hosting

From the Heroku dashboard create a new application, name the app, and choose the appropriate region.

To install mLab MongoDb navigate to mongolab addons page and install, ensuring the add-on is added to the newly created app

Within the Resources tab for the newely created application if you see the mLab MongoDB add-on mLab has been succesfully installed.

MongoDB user

Within the Resources tab for the database application click the mLab MongoDB add-on to navigate to the mLab dashboard.

Under the users tab add a new database user, you will need the database-username and database-password to connect.

MongoDB Creation

To create the mongoDB database the mongo shell will be used.

Prerequisites

MongoDB Shell

Before creating the MongoDB database, first MongoDB must be installed locally. Install MongoDB Community Edition for the appropriate OS.

To start the mongo shell change directory to the <mongodb installation dir>

cd <mongodb installation dir>

Type ./bin/mongo to start mongo. To ensure mongodb installation:

mongo --version

alternatively add <mongodb installation dir>/bin to the PATH environment variable.

Creation

Connect to the mongodb server, mLab dashboard provides instruction on how to.

mongo <mongo server URI> -u <dbuser> -p <dbpassword>

Verify the database, the output should be the <database name>

db

To create the starting database template:

db.createCollection("runsCollection",{capped:false}); db.createCollection("tagsCollection",{capped:false});db.createCollection("algorithmsCollection",{capped:false}); db.createCollection("authenticationCollection",{capped:false}); db.createCollection("palettesCollection",{capped:false}); db.algorithmsCollection.insert({"name" : "default","parameters" : [ "T(Copper)", "T(Cell1)", "DAC"],"algorithm" : "return((T1-T2)/((DAC*DAC)/22))"}); db.palettesCollection.insert({"name" : "default","description" : "default colour palette","palette" : [ "#B2003F", "#00B20F","#FF005A"]});

for more information of the starting database template see mongodb-database-template.md

OneDrive Application Setup

To setup OneDrive application

Prerequisites

A OneDrive Developer account is needed

Creating Application

  1. Navigate to Microsoft Graph : https://developer.microsoft.com/en-us/graph/
  2. Click the My Apps login, located on the top bar when not signed in.
  3. Microsoft will prompt for a login
  4. Once logged in, click the Add An App button
  5. Name the application and create

Filling Application Details

Within a specific application :

  1. Take note of the Application Id (also known as Client Id)
  2. Under Platforms click the Add Platform button
  3. Choose the Web Option
  4. Check the Allow Implicit Flow checkbox
  5. Under Redirect URLs enter the applications callback, example [application_domain]/callback.html
  6. Under Microsoft Graph Permissions , remove any default permissions
  7. Add the Sites.Read.All Application Permission (not Delegated Permissions)

Auth0

The single page web application (SPWA) uses Auth0 for authentication.

Prerequisites

Auth0 Account

To use authentication first a Auth0 account is needed, sign up to Auth0

Setup

The SPWA uses Auth0 SINGLE PAGE APPLICATION application type.

Create Single Page Application

On the Auth0 dashboard under the Applications section create a new application, picking the Single Page Web Applications application type.

Under settings for the newly created application add the domain of the SPWA within the Allowed Callbacks URLs, Allowed Web Origins and Allowed Origins text areas.

If the domain of the application is not known the text areas can be filled later

Under Advanced Setting, under Endpoints take note of the OAuth Endpoints, these will be used for the Browse API

Create Machine To Machine API

On the Auth0 dashboard under the API section create a new API.

Take note of the API Audience

Dataformats

When importing runs from the OneDrive into the database the runs must be in an exact format.

Folder Structure

<date-time>/
-----------T-Data/
-----------------data.txt
-----------Remarks/
-------------------Remark01.txt

Formats

  • run folder name must be the date and time delimited by a '-' format: yyyymmdd-hhmmss.
  • Temperature_Log must be a csv file dimilited by a space, with a minimum of two columns. Line 1 must be column names, line 2 must be column units
  • Remarks must be a txt file. Line 1 must be Remark added after < seconds > seconds where < seconds > is the remarks position. Line 2 must be the remark discription.

see example dataformat


How to Use

The single page web application (SPWA) has two user types casual and admin both, below describes each use case.

Casual user

The casual user is user who is not logged in thus admin controls are disabled.

Prerequisites

  • none

Features

  • public runs are only visible
  • searching runs
  • viewing & sharing runs
  • exporting runs

Uses

Searching

To search for a run: on the home page of the SPWA the user can search by tags/time/date within the seach bar. When searching by tags a auto-complete will show.

Viewing

Once a run has been searched for, a single run can be viewed simply by clicking on it, to view multiple runs use the checkboxes and blue View button.

One the view page the graph can be zoomed in and out using the mouse wheel and panned using click and drag. To offset the active drag click and drag while holding shift.

Underneath the graph is the Column-Tag panel, from here run tags can be viewed and columns visibility can be toggled. To switch the active graph simply click on a visible column.

To lock an axis, when panning or offsetting, the lock buttons located at the end of each axis can be toggled.

To view an annotation description click on an annotation label

Exporting

Once a run has been searched for, runs can be zipped and saved to the users local machine by using the checkboxes to select multiple runs and clicking the green Export button.

Admin User

The admin user is a user who is logged in thus admin controls are enabled. The admin users features and uses are a superset of the casual user features and uses.

Prerequisites

  • A OneDrive account is needed to import runs into the database, sign up to OneDrive
  • Logged into the SPWA

Features

  • private runs are visible
  • deleting runs
  • modifying runs
  • importing runs

Uses

Deleting

Once a run has been searched for, runs can be deleted from the database (runs cannot be deleted from OneDrive) by using the checkboxes to select multiple runs and clicking the red Delete button.

Modifying Annotations

On the view page, to add a new annotation click the '+' button.

To change the annotation position click the down-wards arrow button on the annotation panel. Using the black downward arrow click and hold to reposition. To confirm the new position click the black square.

To edit the annotation description click the pencil icon on the annotation panel.

Modifying Tags

One the Column Tag panel switch to view tags. Click the pencil icon to edit the tags.

Importing Runs

To import runs from a OneDrive account, click the import button. If not already logged in click the login button to login into OneDrive. To preview a run click the graph preview button, to import runs select the checkboxes and click confirm.


This project was funded via the Marloes Peeters Research Group and mentored by DigitalLabs@MMU as a DigitalLabs Summer Project. It is the work of Yusof Bandar.

About

This is the parent project for a suite of applications which take time series data from an instrument, store as tagged, searchable, indexed files, and display on a publicly accessible website.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •