Code Monkey home page Code Monkey logo

helios's Introduction

DSSD is collaborating with Helios to create an Analytics page for the solar arrays on UW-Madison's campus. Data is collected by the solar arrays and by a solar irradiance meter on top of the engineering building.

Project Management

To contribute to the project, assign an issue to yourself and create a new branch off of main and implement the feature/fix/improvement, making commits after completing each subsection of the work. Push your code and create a pull request (PR) into main linked to the issue it addresses.

PRs will be reviewed by at least one project member before merging.

Development

To install dependencies, run:

npm run i-recur

This will install the dependencies for both the frontend and function directories.

You'll also have to login to firebase with:

firebase login

To serve the Firebase emulator suite and the frontend (connected to the emulators), run:

npm run dev

The dev server will refresh each time you save new changes to project files.

Deployment

The frontend will automatically deploy on merge into main.

Backend:

To deploy the Firebase functions, change directory into functions and run:

npm run deploy

To deploy the firestore rules or storage rules, run the following commands respectively from the root directory:

npm run deploy-firestore
npm run deploy-storage

helios's People

Contributors

jackblake-zkq avatar maxmaeder avatar r1se23 avatar sarthyparty avatar d-pande avatar

Stargazers

 avatar  avatar

helios's Issues

Frontend - handle outliers

If a day has NaN as its irradiance value:

  • omit it from the % efficiency graph and the correlation graph
  • omit just the irradiance from the gross efficiency graph

Note omitted days at the bottom of the page

Update language on admin page

Replace all instances of "panel" with "array"

Replace variable names with their meaning:

  • beta = Panel slope angle
  • gamma = Surface azimuth angle (0° for south-facing panels)
  • rho_g = Reflectance (normally 0.2)
  • Array area = Same label, but maybe add units of area (we use m2)

Frontend - 3 main graphs

  1. Line plot with lines for Irradiance, Output, and Typical Efficiency Output (Irradiance * 0.14)
  2. Line plot of Output / Irradiance i.e. percentage efficiency
  3. Correlation plot of percentage efficiency vs. precipitation (expected negative correlation)
  • Can implement correlation plot by sorting percentage efficiency in ascending order, then sorting the precipitation by percentage efficiency (e.g. the precipitation and % efficiency values at any index correspond to the same date). Use the precipitation values as the x coords, and the % efficiency values as the y coords

Translate MatLab code into Javascript function

Takes input: beta, gamma, rho_g, array area, and list of date-strings in the format that the csv files use
Returns: list of irradiance values, each entry is the irradiance for the day of the date-string at the same index.

Write in its own module and export this function

To fetch the data, make http requests to https://gml.noaa.gov/aftp/data/radiation/solrad/msn/2023/msn[YEAR][DAY-NUMBER].dat

e.g. https://gml.noaa.gov/aftp/data/radiation/solrad/msn/2023/msn23002.dat

Graph descriptions

Have descriptions under each graph, configurable through a js or json file

calcSolarValues function - handle outliers

For a given day, set it's irradiance to NaN if:

  • At least one of the two files does not exist
  • At least one of the two files is under 250kB
  • The irradiance is greater than the solar constant times the area

Files that are messed up:

  • March 30th 2022 is missing
  • June 14th 2022 is only 151kB
  • May 10th 2019 is only 151kB
  • December 23 2022 > solar constat

Security Rules for Storage and Firestore

Store a user collection in Firestore. Each user gets a document when they create their account, the document's id is the user's uid. The document stores the user's email, and a field isAdmin.

The user collection can only be read/written to by admins

The solar arrays collection can be read by anyone, but can only be written to by admins.

Backend - date timezones are messed up

Easy Fix - switch to using date string everywhere on the backend, instead of Date objects & timestamps. That way, we don't have to deal with the complexity of getting all the timezone logic right. We can just use date string in CST. Keys in firestore can be some kind of formatted string. Make sure to update the frontend to utilize the new key format.

Cloud Function for What if

Callable cloud function named getIrradianceDataForPrevYear

Client calls the function s.t. data object has properties: area, beta, gamma, rho_g

Utilize the calcSolarValues function defined in solarCalc.js.

Return the total irradiance for the whole year previous to current year given the parameters

Make sure to enforce App Check on the function. Check out this page to see how.

Dashboard - Highlights banner at top of page

As shown in Mockup

Sum output of all arrays

Use average cost of electricity (hardcoded or from some API) in Madison to display $ saved to date

Use average energy/barrel of oil (hardcoded or from some API) to display Oil Barrels avoided to date

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.