Skip to main content

A Python tool for sorting and analyzing ASOS weather data

Project description

README.md

ASOS Analysis

ASOS Analysis is a Python library designed to streamline the sorting, cleaning, and analysis of ASOS (Automated Surface Observing System) weather data. It provides tools for sorting data by time, stations, and variables, detecting and standardizing date-time formats, and removing duplicate entries.


Features

  • Sorting:

    • Group and save data by time (hourly intervals).
    • Group and save data by station.
    • Extract data for specific variables and save them in individual files.
  • Cleaning:

    • Remove duplicate entries from datasets.
  • Date-Time Management:

    • Detect unique date-time formats used in data files.
    • Standardize all date-time values into a consistent format.
  • Flexible and Modular Design:

    • Customizable options for handling ASOS datasets with ease.

Installation

ASOS Analysis is available via both pip and conda.

Using pip:

pip install asos_analysis

Using conda:

conda install -c sauravshuvo asos_analysis

Usage

Here's how to use ASOS Analysis for various tasks. Import the required functions and call them with your dataset paths.

Sorting Data by Time

Sort data into hourly intervals and save each interval into a separate file:

from asos_analysis.sorting import sort_by_time

input_file = "path/to/ND_feb12.csv"
output_dir = "path/to/Hourly_Files"

sort_by_time(input_file, output_dir)

Sorting Data by Stations

Organize data by stations and save each station's data into a separate file:

from asos_analysis.sorting import sort_by_station

input_file = "path/to/ND_feb12.csv"
output_dir = "path/to/Station_Files"

sort_by_station(input_file, output_dir)

Sorting Data by Variables

Extract data for specific variables:

from asos_analysis.sorting import sort_by_variable

input_file = "path/to/ND_feb12.csv"
variables = ['tmpf', 'dwpf', 'relh']
base_columns = ['station', 'valid', 'lon', 'lat', 'elevation']
output_dir = "path/to/Variables_Files"

sort_by_variable(input_file, variables, base_columns, output_dir)

Removing Duplicate Entries

Clean your datasets by removing duplicate rows:

from asos_analysis.cleaning import remove_duplicates

input_folder = "path/to/data_folder"
remove_duplicates(input_folder)

Listing Unique Date-Time Formats

Analyze your datasets to find all unique date-time formats in the valid column:

from asos_analysis.formats import list_unique_formats

input_folder = "path/to/data_folder"
unique_formats = list_unique_formats(input_folder)

print("Unique date-time formats detected:")
for fmt in unique_formats:
    print(fmt)

Standardizing Date-Time Format

Ensure all date-time values in the valid column conform to a standard format:

from asos_analysis.reformat import standardize_datetime

input_folder = "path/to/data_folder"
standardize_datetime(input_folder)

Contributing

Contributions are welcome! Feel free to fork the repository, create a branch, and submit pull requests. You can also report issues or feature requests on the GitHub repository.


License

This project is licensed under the MIT License. See the [LICENSE] file for more details.




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asos_analysis-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asos_analysis-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file asos_analysis-1.0.0.tar.gz.

File metadata

  • Download URL: asos_analysis-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for asos_analysis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cbc87d699417fe501cd9427dad55d28575391d8d3cc45fca77436584f7eeb5f5
MD5 ec0638b7d76f6db769b37d2b6b818bbb
BLAKE2b-256 2e375c9ca4be5a17d99770473bd02fd6f9675d928c0345b67843a9b1cfe98f95

See more details on using hashes here.

File details

Details for the file asos_analysis-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: asos_analysis-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for asos_analysis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a02e9c85bcf9920884281930eea40876c163dede91e63ea10b55403b8d15c81
MD5 69f1df8edaf73d2adc3e9361f0708715
BLAKE2b-256 2dd40508035f8c8fb40aee0b815023c297136fdb0299592dd5e2f031b062174f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page