Giter Club home page Giter Club logo

atms597-project2-groupa's Introduction

ATMS597-Project2-GroupA

Repository for Group A's submission for Project 2.

Group members: Carolina Bieri, Arka Mitra, Jesse Loveridge

(1) Downloading the data:

This is done with the stripes_inputs function. This function download daily minimum and maximum temperature data for the specified period.

The stripes_inputs function and associated helper function are adapted from Stefanie Moline: https://github.com/stefmolin/Hands-On-Data-Analysis-with-Pandas/

Example: Specify the GHCND Station ID ('stationid'), user-specific token ('token), and desired start and end years ('start' and 'end').

e.g.,

startyear = 1910

endyear = 2019

token = 'xxxxexampletokenxxxx'

data = stripes_inputs(stationid = 'CITY:US360019', token = token, start = starttime, end = endtime)

(2) Processing the data/filling missing values:

This is done with the make_dataframe function. This function does a few things:

  • Create a DataFrame using the input data, which should be a list of dictionaries returned from stripes_inputs.

  • Use the 'date' column of the dataframe (which comes from the list of dictionaries) to define a DateTime index for the DataFrame.

  • Resample the data using pandas.DataFrame.resample() to fill missing values with NaNs.

Example call:

df = make_dataframe(data)

(3) Plotting the Climate Stripes/Time-Series:

This is done with the plot_stripes function. This program plots Climate Stripes following the procedure created by Ed Hawkins at the University of Reading: https://showyourstripes.info/

This function can be used to plot data at yearly, monthly, or weekly frequency. The frequency can be specified using the flag 'tunit'. Additionally, the user can opt to plot a time series with axis labels over the Climate Stripes by using the 'plot_tseries' flag.

The function first resamples the data to yearly, monthly, or weekly means. Next, a baseline average using data from 1970 to 2000 is calculated. Standardized anomalies are obtained by calculating temperature anomalies using this baseline average and dividing by the standard deviation for the available data corresponding to all years before 2000.

Because of the nature of these calculations, these functions are best suited to data with a long-term temporal record (at least 1970 onwards).

Example Climate Stripes plots for two stations (one in Utah and one in New York) are included with the functions to demonstrate functionality.

atms597-project2-groupa's People

Contributors

bieri2 avatar mitraarka27 avatar

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.