This app displays interesting statistical weather records and trends which can be used in climate related research including study of global warming.

Overview

CIRRUS Weather App

Climate Information, Research, and Records of the US

Video Demo: https://www.youtube.com/watch?v=k09VdqbKnMo

Description:

I have developed this app called CIRRUS (Climate Information, Research, and Records of the US). The app displays interesting statistical weather records and trends which can be used in climate related research including study of global warming.

This app was submitted for the 2021 Congressional App Challenge. I just wanted to share in case anyone finds it interesting.

Languages Used:

  • Python (Flask, Beautiful Soup, urllib/requests)
  • SQL
  • HTML
  • CSS
  • JavaScript
  • Jinja2 templating

Additional Tools used and API accesses done:

  • Zip Codes To Go (for collecting all zip codes of the USA)
  • Visual Crossing Weather API (for collecting statistical weather summary data)
  • Google Maps JavaScript API (for rendering the map with the output data)
  • Google Geocoding API (for converting zip code to map location latitude/longitude)

Data Collection:

  1. The program collects all the zip codes for each state (from the website https://www.zipcodestogo.com/) and stores them in a database along with city and state information. Since the data is in html format, Python BeautifulSoup library is used to extract information.

  2. Next the program fetches weather data from https://www.visualcrossing.com/weather-api. This data is collected from 1975 to September 2021 and the data is in CSV format, so Python CSV module is used for processing. [NOTE: A subscription needs to be purchased for this.]

For each zip code, the following monthly summary data is collected: Max Temperature, Min Temperature, Average Temperature, Wind Chill, Heat Index, Precipitation, Snow Depth, Wind Speed, Wind Gust, Visibility, Cloud Cover, and Relative Humidity.

Data collection is a one-time activity and once done, it can be skipped for subsequent runs.

Data Processing and Visualization:

Data is presented on the web page based on user query. There are two query options:

  1. Min-Max records for various weather parameters: The user can select a month from a drop-down menu, enter a year, and click the Get Weather Data button. The program then searches the database, finds locations for parameters such as highest temperature, max rainfall, etc. for that year and month across the entire country, and displays them all in one map. For more information, the user can hover over the marker, which will display a label with the city, state, and zip code of that marker, as well as the parameter and the value.

  2. Historical chart for any specific parameter: For this query option, select a specific parameter, such as "Average Temperature", from the drop-down menu, and click the Get Historical Chart button. We now get the US average temperature chart. Ignoring 2021 (since we don't have data for the entire year), we can see an increasing trend in temperature from 54.8°F in 1975 to 56.6°F in 2020.

File Descriptions:

README.md: The README file.

app.py: The main python file of the application (contains all the functions and Flask routes).

datalib.py: Supplemental data (constants, variables, literals) all in one file.

bs4/: If Beautiful Soup module is not installed, then the package can be downloaded and unarchived in order to use the library.

styles.css: Stylesheet for the HTML files.

chart.html: HTML file for displaying chart results.

index.html: App home page.

layout.html: Common HTML constructs kept in one file to avoid clutter due to repetition and keep all other HTML files clean.

results.html: HTML file for processing and visualization of query results.

weatherdb.sqlite: The database that stores all the database tables. This database is not included (too large to upload).

zipcount.json: Contains the zip code count for each state. Used to determine whether all zip codes for the current state have been collected or not.

Here is the file/directory tree of all files.

CIRRUS:~$tree
├── README.md
├── app.py
├── datalib.py
├── static
│ └── styles.css
├── templates
│ ├── chart.html
│ ├── index.html
│ ├── layout.html
│ └── results.html
├── weatherdb.sqlite
└── zipcount.json

In order to run the program, first export the API keys as below.

For Linux/Mac operating systems:

$ export API_KEY_GEO=
   
    
$ export API_KEY_WEA=
    

    
   

For Windows operating systems:

PS C:\> $Env:API_KEY_GEO = 
   
    
PS C:\> $Env:API_KEY_WEA = 
    

    
   

Also, be sure to have a Maps API key to see the map on the results page. Insert it into the below line of code (in the program, there's already a key there, but that one will not work):

">

Then run flask. Access the website by clicking on the given URL.

In MacOS/Linux:

(Press CTRL+C to quit) * Restarting with stat">
$ flask run
* Serving Flask app "app.py" (lazy loading)
* Environment: development
* Debug mode: off
* Running on 
   
     (Press CTRL+C to quit)
* Restarting with stat

   

In Windows:

PS C:\> flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
(date/time) - * Running on 
   
     (Press CTRL+C to quit)

   

Screenshots:

App Homepage:

App Homepage

Get Weather Data Query Results:

Get Weather Data Query Results

Get Historical Chart Query Results (Avg Temperature):

Get Historical Chart Query Results (Avg Temperature)

Get Historical Chart Query Results (Precipitation):

Get Historical Chart Query Results (Precipitation)

NOTES:

  1. Since there are many locations displayed and they can be spread across all over the country, the map is centered at the center of the USA (latitude: 39.50, longitude: -98.35) so all markers can fit on the screen properly.
  2. For displaying the markers, zip codes cannot be used for locations. Therefore, the Google Geocoding API is used to fetch latitude/longitude information for the zip codes.
  3. For a more comprehensive study on global warming, we have to take the entire world’s data into consideration and more precise and extensive data mining is needed. However, even with limited data, we can clearly see the gradient of rise in temperature.
  4. Not just for temperature and global warming, this app can also be used to study all other parameters mentioned earlier such as precipitation, snow depth, etc.
  5. I noticed sometimes the data returned by Visual Crossing website had values that did not seem right. Also, some of the weather parameters for some months may be missing sometimes. So please be aware of this in case some data doesn’t make sense or is missing. However, with a large dataset, any such anomalies average out and do not have much impact on the overall results.
List of Land Cover datasets in the GEE Catalog

List of Land Cover datasets in the GEE Catalog A list of all the Land Cover (or discrete) datasets in Google Earth Engine. Values, Colors and Descript

David Montero Loaiza 5 Aug 24, 2022
Get-countries-info - A python code that fetches data of any country

Country-info A python code getting countries information including country's map

CODE 2 Feb 21, 2022
A ninja python package that unifies the Google Earth Engine ecosystem.

A Python package that unifies the Google Earth Engine ecosystem. EarthEngine.jl | rgee | rgee+ | eemont GitHub: https://github.com/r-earthengine/ee_ex

47 Dec 27, 2022
a Geolocator made in python

Geolocator A Geolocator made in python ✨ Features locates ur location using ur ip thats it! 💁‍♀️ How to use first download the locator.py file instal

Portgas D Ace 1 Oct 27, 2021
A service to auto provision devices in Aruba Central based on the Geo-IP location

Location Based Provisioning Service for Aruba Central A service to auto provision devices in Aruba Central based on the Geo-IP location Geo-IP auto pr

Will Smith 3 Mar 22, 2022
This GUI app was created to show the detailed information about the weather in any city selected by user

WeatherApp Content Brief description Tools Features Hotkeys How it works Screenshots Ways to improve the project Installation Brief description This G

TheBugYouCantFix 5 Dec 30, 2022
A package to fetch sentinel 2 Satellite data from Google.

Sentinel 2 Data Fetcher Installation Create a Virtual Environment and activate it. python3 -m venv venv . venv/bin/activate Install the Package via pi

1 Nov 18, 2021
PySAL: Python Spatial Analysis Library Meta-Package

Python Spatial Analysis Library PySAL, the Python spatial analysis library, is an open source cross-platform library for geospatial data science with

Python Spatial Analysis Library 1.1k Dec 18, 2022
A GUI widget for Linux to show current time in different timezones.

A GUI widget to show current time in different timezones (under development). To use this widget: Run scripts/startup.py Select a country. A list of t

B.Jothin kumar 11 Nov 10, 2022
Stitch image tiles into larger composite TIFs

untiler Utility to take a directory of {z}/{x}/{y}.(jpg|png) tiles, and stitch into a scenetiff (tif w/ exact merc tile bounds). Future versions will

Mapbox 38 Dec 16, 2022
A NASA MEaSUREs project to provide automated, low latency, global glacier flow and elevation change datasets

Notebooks A NASA MEaSUREs project to provide automated, low latency, global glacier flow and elevation change datasets This repository provides tools

NASA Jet Propulsion Laboratory 27 Oct 25, 2022
Pure python WMS

Ogcserver Python WMS implementation using Mapnik. Depends Mapnik = 0.7.0 (and python bindings) Pillow PasteScript WebOb You will need to install Map

Mapnik 130 Dec 28, 2022
Summary statistics of geospatial raster datasets based on vector geometries.

rasterstats rasterstats is a Python module for summarizing geospatial raster datasets based on vector geometries. It includes functions for zonal stat

Matthew Perry 437 Dec 23, 2022
Pandas Network Analysis: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:

Pandana Pandana is a Python library for network analysis that uses contraction hierarchies to calculate super-fast travel accessibility metrics and sh

Urban Data Science Toolkit 321 Jan 05, 2023
User friendly Rasterio plugin to read raster datasets.

rio-tiler User friendly Rasterio plugin to read raster datasets. Documentation: https://cogeotiff.github.io/rio-tiler/ Source Code: https://github.com

372 Dec 23, 2022
Python 台灣行政區地圖 (2021)

Python 台灣行政區地圖 (2021) 以 python 讀取政府開放平台的 ShapeFile 地圖資訊。歡迎引用或是協作 另有縣市資訊、村里資訊與各種行政地圖資訊 例如: 直轄市、縣市界線(TWD97經緯度) 鄉鎮市區界線(TWD97經緯度) | 政府資料開放平臺: https://data

WeselyOng 12 Sep 27, 2022
A part of HyRiver software stack for handling geospatial data manipulations

Package Description Status PyNHD Navigate and subset NHDPlus (MR and HR) using web services Py3DEP Access topographic data through National Map's 3DEP

Taher Chegini 5 Dec 14, 2022
Client library for interfacing with USGS datasets

USGS API USGS is a python module for interfacing with the US Geological Survey's API. It provides submodules to interact with various endpoints, and c

Amit Kapadia 104 Dec 30, 2022
Script that allows to download data with satellite's orbit height and create CSV with their change in time.

Satellite orbit height ◾ Requirements Python = 3.8 Packages listen in reuirements.txt (run pip install -r requirements.txt) Account on Space Track ◾

Alicja Musiał 2 Jan 17, 2022
Blender addons to make the bridge between Blender and geographic data

Blender GIS Blender minimal version : 2.8 Mac users warning : currently the addon does not work on Mac with Blender 2.80 to 2.82. Please do not report

5.9k Jan 02, 2023