Skip to content

Simple utility for retrieving and plotting ThreadEx station data

License

Notifications You must be signed in to change notification settings

tomerburg/pythreadex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pythreadex

Pythreadex is a simple Python utility to fetch long-term station data for the United States from ThreadEx, courtesy of ACIS (https://www.rcc-acis.org/). This utility includes a few plotting and climatology functions, as well as converting data to CSV format.

Installation

Pip

Installation is available via pip:

pip install pythreadex

From source

pythreadex can also be installed from source by cloning the GitHub repository:

git clone https://github.com/tomerburg/pythreadex
cd pythreadex
python setup.py install

Dependencies

  • matplotlib >= 2.2.2
  • numpy >= 1.14.3
  • scipy >= 1.1.0
  • pandas >= 1.3.0

Sample Usage

This sample code shows how to search through a dataset, retrieve station data, make a plot and convert the data to CSV format:

from pythreadex import Dataset
import matplotlib.pyplot as plt
            
# Create an instance of Dataset
dataset = Dataset()

# Retrieve all stations in New Jersey
print(stations.search_by_state('NJ'))

# Search for Newark, NJ's station ID
station_id = dataset.search_by_name('Newark, NJ')

# Create an instance of a Station object with this station ID
station = dataset.get_station(station_id)

# Make a plot of 2023 maximum temperatures, from January to May
station.plot_temp_time_series('max', year=2023, date_range=('1/1','5/31'))

# Convert data to a CSV file
station.to_csv('newark.csv')

About

Simple utility for retrieving and plotting ThreadEx station data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages