@varunaiot/varunalib
v1.0.8
Published
VarunaLib is the library of the [Digital Performance Twin API](https://github.com/decagonhq/varunax), a software that helps manage water stations, utility company's assets and help to deliver safe and quality water across the network, monitoring and predi
Downloads
4
Readme
VarunaLib
VarunaLib is the library of the Digital Performance Twin API, a software that helps manage water stations, utility company's assets and help to deliver safe and quality water across the network, monitoring and predicting asset failures in real time
Getting Started
These instructions will get you a copy of the library up and running on your local machine for data crunching purposes.
Prerequisites
Here are list of things you need to get started
Installing
A step by step series of examples that tell you how to get a development env running
- Run in your terminal within your projects directory
npm i @varunaiot/varunalib
How to use
The varunalib consist of 4 functions
- GetAverageORP
- GetAveragePH
- PumpRuntime
- Flowrate
GetAverageORP function
This function calculates the Average ORP of a given set of ORPs between two dates. To make use of this function do the following
import {GetAverageORP} from "@varunaiot/varunalib"
GetAverageORP(startTime: Date, endTime: Date, previousData: Array<Object>)
Parameters involved include
- startTime (DateTime):- The start date for processing the ORP
- endTime (DateTime):- This is the endDate for processing the ORP
- previousData (Array):- this is the historical data that is to be processed to get out the ORP
Expected Result
- return { orpAverage, orpData, orpInfo };
GetAveragePH function
This function calculates the Average PH of a given set of PHs between two dates. To make use of this function do the following
import {GetAveragePH} from "@varunaiot/varunalib"
GetAveragePH(startTime: Date, endTime: Date, previousData: Array<Object>)
Parameters involved include
- startTime (DateTime):- The start date for processing the PH
- endTime (DateTime):- This is the endDate for processing the PH
- previousData (Array):- this is the historical data that is to be processed to get out the PH
Expected Result
- return { phAverage, phData, phInfo };
PumpRuntime function
This function calculates the pump runtime of a given set of runtimes between two dates. To make use of this function do the following
import {PumpRuntime} from "@varunaiot/varunalib"
PumpRuntime(startTime: Date, endTime: Date, previousData: Array<Object>, pumpId: String)
Parameters involved include
- startTime (DateTime):- The start date for processing the PH
- endTime (DateTime):- This is the endDate for processing the PH
- previousData (Array):- this is the historical data that is to be processed to get out the PH
- pumpId (String):- The symbol of the pump whose runtime is needed
Expected Result
- return runtime;
Flowrates function
This function calculates the pump runtime of a given set of runtimes between two dates. To make use of this function do the following
import {Flowrates} from "@varunaiot/varunalib"
Flowrates(startTime: Date,
endTime: Date,
assets: Array<Object>,
pumpData: Array<Object>,
pumpType: String)
Parameters involved include
- startTime (DateTime):- The start date for processing the PH
- endTime (DateTime):- This is the endDate for processing the PH
- pumpData (Array):- This is the historical data that is to be processed to get out the PH
- assets: (Array):- This is an array of all assets in the database ,
- pumpType (String):- The type of the pump whose Flowrate is needed
Expected Result
- return flows;
And coding style
- Our coding style can be found here
Deployment
Add additional notes about how to deploy this on a live system
Built With
- TypeScript
Authors
Acknowledgments
- Hat tip to anyone whose code was used
- Inspiration
- etc