Giter VIP home page Giter VIP logo

pmu_report_generator's Introduction

Description

This is a python script that fetches data of user defined points from the PMU historian API and dumps the data as an excel file at a user defined folder location

Installation

  • Ensure python (above version 3) is installed in the computer
  • You may have to setup system environment variable 'PATH' or 'Path', such that you can access 'python' command from command line
  • Keep the 'PMUDataAdapter.exe' file in the same folder location of index.py file
  • Ensure the 'config.xlsx' file in the same folder location of index.py file. You can use 'config_dummy.xlsx' to create 'config.xlsx' file
  • run 'setup_env.bat' file. This should create a folder named 'project_env'

Running this script

  • Mention all the configuration in 'config.xlsx' file
  • run the 'run.bat' file
  • you can see the outut report generated in the user configured dump folder

Configuration

Configuring the points to be fetched

The list of points to be fetched can be defined in the 'pnts' sheet of 'config.xlsx' file

API fetch configuration

This configuration is defined in the 'config' sheet of 'config.xlsx' file

The description of configuration parameters is as follows

  • dummyFetchFlag: If its value is 1, dummy data will be dumped
  • host: ip address of api host (example: '10.5.10.6')
  • port: port of the data api service (example: 80)
  • path: path of the data fetch api (example: '/path/to/api')
  • username: username for data api access (example: 'uname')
  • password: password for data api access (example: 'pass')
  • refMeasId: reference measurement id for data fetch (example: 100)

Dumping configuration

This configuration is defined in the 'config' sheet of 'config.xlsx' file

  • dumpFolder: folder path at which the report is to be dumped (example: 'D:\dumps\pmudata')
  • filenamePrefix: prefix of the report filename (example: 'pmu_report_')

Data fetch start and end times configuration

This configuration is defined in the 'config' sheet of 'config.xlsx' file

  • absoluteStartTime: Date time of start time
  • varStartYears: if this value is non-empty the years component of start time will be dynamic (example: -1)
  • varStartMonths: if this value is non-empty the months component of start time will be dynamic (example: -1)
  • varStartDays: if this value is non-empty the days component of start time will be dynamic (example: -1)
  • varStartHours: if this value is non-empty the hours component of start time will be dynamic (example: -1)
  • varStartMinutes: if this value is non-empty the minutes component of start time will be dynamic (example: -1)
  • varStartSeconds: if this value is non-empty the seconds component of start time will be dynamic (example: -1)
  • absoluteEndTime: dt.datetime
  • varEndYears: if this value is non-empty the years component of end time will be dynamic (example: -1)
  • varEndMonths: if this value is non-empty the months component of end time will be dynamic (example: -1)
  • varEndDays: if this value is non-empty the days component of end time will be dynamic (example: -1)
  • varEndHours: if this value is non-empty the hours component of end time will be dynamic (example: -1)
  • varEndMinutes: if this value is non-empty the minutes component of end time will be dynamic (example: -1)
  • varEndSeconds: if this value is non-empty the seconds component of end time will be dynamic (example: -1)

data resampling configuration

This configuration is defined in the 'config' sheet of 'config.xlsx' file

Data from API contains 25 samples in 1 second duration. We can resample data using the following configuration

  • resampleFrequency: any one of the below options can be used
    • 's' - data resolution will be 1 second
    • 'm' - data resolution will be 1 minute
    • 'b' - data resolution will be 1 time block (15 mins)
    • 'h' - data resolution will be 1 hour
    • 'd' - data resolution will be 1 day
    • If none of the above option is mentioned, no resampling will be performed
  • sampleAggregationStrategy: any one of the below options can be used
    • 'raw' - no resampling will be performed
    • 'snap' - first valid sample of the resampling window will be taken for data aggregation
    • 'average' - average of valid samples of the resampling window will be taken for data aggregation

fetch window configuration

This configuration is defined in the 'config' sheet of 'config.xlsx' file

You can fetch data in time windows using the below configuration

  • fetchWindowDays: (example: 1)
  • fetchWindowHours: (example: 1)
  • fetchWindowMinutes: (example: 1)
  • fetchWindowSeconds: (example: 1) If fetch window is 0, or more than (endTime-startTime), then data will not be fetched in time windows

Notable features of this script

  • If data of some signals / all signals is completely absent / intermittent, the script will not crash, instead missing samples will be dumped as empty cells in the output report. Hence the data of all signals is time aligned even if data is completely / partially unavailable
  • Only 'GOOD' quality data is dumped in the report. Other quality data is dumped as blank cells in the output report
  • The dynamic start time and end time configuration provides peridic data dumping capability to this script

Snapshot of a sample output

snapshot of sample output

Snapshot of a points configuration sheet

points configuration sheet

pmu_report_generator's People

Contributors

nagasudhirpulla avatar

Watchers

 avatar  avatar

pmu_report_generator's Issues

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.