Giter Site home page Giter Site logo

sisbatteries's Introduction

SISBatteries

Get battery info from SIS; make a KML and some plots to help with maintenance planning.

battery2kml.py creates the output file kml/N4_battery_age.kml and kml/legend.png.

For operational use: Users should download kml/N4BatteryAge_link.kml and open it in Google Earth. kml/N4_battery_age.kml should be hosted on a server that can run a cron job to update it periodically (probably every night). The link KML will sync with the updated file on a specified interval.

Running the code requires a SIS login and a Python environment with fastkml installed. I like to use conda for this.

The file sisutils.py contains a few simple functions that log a user into SIS, create an API query, and parse the returned text. These are in a separate file primarily to keep the other scripts focused on generating KMLs or plots.

To supply your SIS login credentials: Create a copy of config.ini.example named config.ini. Enter your SIS username and password. This file will be read by the loginSIS function in sisutils.py.

battery2kml.py obtains battery info from SIS and adds it to a pre-existing KML to produce an interactive map: screenshot from Google Earth showing battery status KML

battplot.py uses the same sisutils functions to query SIS. It makes a few plots, including a histogram showing the most recent battery swap at each station. histogram of year N4 batteries were installed

Old way of obtaining CSV file - obsolete now that the API request is working:

To get data:

  • search Current Equipment in SIS,
  • Equipment Category: Battery
  • Is Currently Installed: Yes
  • in columns to display: add Epoch On Date
  • sort by Epoch On Date
  • download CSV file

SIS equipment search for N4 batteries, sorted by install date

another older link I had been using

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.