chinarjoshi / meteorological-query-tool

Query climate data from the NCDC's meteorological database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Meteorological Query Tool

Query climate data from the NCDC's meteorological database
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

example-image

Inspiration

I noticed that it was difficult to find an API to query meteorological data for a specific region on a specific day, so I created a minimalist web API that allows the user to query climate data from 30 years ago to today from numerous meteorological stations across the United States. The targeted audiences are researchers who would like to obtain very specific data that is difficult to find in other places.

What it does

The tool queries the National Climate Data Center's meteorological database and returns the data specified by the user in the form of a table. The queries are conducted in log(n) time due to the use of SQL indices, thus the application is very responsive.

How I built it

This application is built using Flask with Python, jQuery with JavaScript to asyncronously update the website, and the Bootstrap framework to rapidly develop the CSS. The NCDC's meteorological database was used and installed in the form of a csv. The back-end stack is needed to make SQL queries to the included database.

Challenges I ran into

This project was also developed for learning purposes as I was dipping my toes into web development, so it was challenging to build a cohesive product while simutaneously learninig what languages and technologies I needed to make it happen. However, in the end I learned about the various web framworks for Python and JavaScript, development stacks, and how to develop a web application.

Built With

Getting Started

No API key is needed to access the tool, so the application may be locally run through the python file.

Prerequisites

The Flask framework and SQLite3 RDBMS must be installed as a prerequisite.

  • pip
    pip install requirements.txt

Installation

Compile Source

  1. Clone the repo
    git clone https://github.com/chinarjoshi/meteorological-query-tool
  2. Install prerequisites
    pip install requirements.txt
  3. Initialize a flask development server
    flask run

Docker

  1. TODO

Usage

This tool can be used for research purposes to find the meteorological data from a specified date and region.

  1. Select the station from the dropdown menu
  2. Input the date into the corresponding fields
  3. Select which datatypes to query from the database

For more examples, please refer to the Documentation

Roadmap

Features

The following features will be implemented in the future.

  1. Add additional visualizations of the data using Matplotlib

    • Temperature vs Time graph
    • Bar graph of selected datatypes
  2. Dark theme

See the open issues for a list of proposed features (and known issues).

Source

  • Manipulate the DOM using jQuery and AJAX calls. When the submit button is pressed, make a GET request to the server using the input fields.
    • PROBLEM: When the HTML form is submitted, the corresponding JS event listener doesnot reccognize the event, likely due to syntax error because of confusion between element vs id JS syntax. Figure out how to properly select DOM elements.
  • Allow a range of dates to be selected on the HTML file and render coordinate plot using the database response. Use this instead of table.
  • Change the padding and color of the Bootstrap classes in styles.css to center the input fields and change background color.

Contributing

Any contributions to extend features are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/newFeature)
  3. Commit your Changes (git commit -m 'Add NewFeature')
  4. Push to the Branch (git push origin feature/newFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Chinar Joshi - chinarjoshi7@gmail.com - Linkedin

Project Link: Github

Acknowledgements

About

Query climate data from the NCDC's meteorological database

License:MIT License


Languages

Language:Python 44.6%Language:HTML 36.2%Language:JavaScript 17.7%Language:CSS 1.5%