Package: climatePy
climatePyDescriptionA Python 📦 for getting point and gridded climate data by AOI.climatePyis the Python version of theclimateRR package, providing all of the same functionality but in Python.As its stated in theclimateR README:
climatePy simplifies the steps needed to get climate data into Python. At its core it provides three main things:A climate catalog of over 100,000k datasets from over 2,000 data providers/archives. See (data_catalog())A general toolkit for accessing remote and local gridded data files bounded by space, time, and variable constraints (dap(),dap_crop(),read_dap_file())A set of shortcuts that implement these methods for a core set of selected catalog elementsLinksclimatePy (Lynker intel)climatePy PyPIclimateR/climatePy slideshowTable of ContentsInstallationUsageCreditsLicenseHow to ContributeInstallationclimatePycan be downloaded from PyPI viapiplike so:pip install climatePyNote:climatePy is still indevelopmentUsageLoading climate catalogimportclimatePyimportgeopandasasgpdimportmatplotlib.pyplotasplt# load climate catalogcatalog=climatePy.data_catalog()# load example AOI dataAOI=gpd.read_file('src/data/san_luis_obispo_county.gpkg')Usingclimatepy_filter():Theclimatepy_filter()is one of the core functions ofclimatePyand is used to do the first round of filtering on the base climate catalog.Here we filter down our climate catalog to TerraClim precipitation data for San Luis Obispo County, CA.# collect raw meta dataraw=climatePy.climatepy_filter(id="terraclim",AOI=AOI,varname="ppt")idassetvarnamegridmetagg_terraclimate_ppt_1958_CurrentYear_GLOBEpptAOIGetting climate data in AOINow lets use thegetTerraClim()function fromclimatePyto get precipitation data for January 1st, 2018 in San Luis Obispo County, CA.# collect raw meta dataprcp=climatePy.getTerraClim(AOI=AOI,varname="ppt",startDate="2018-01-01",endDate="2018-01-01")Get data within a date rangeWe can also get data within a date range. we'll usegetTerraClim()to get monthly precipitation data for all of 2018 in San Luis Obispo County, CA.# collect raw meta dataprcp=climatePy.getTerraClim(AOI=AOI,varname="ppt",startDate="2018-01-01",endDate="2018-12-01")Data from known bounding coordinatesclimatePyoffers support forshapelybounding boxes. Here we are requesting wind velocity data for the four corners region of the USA by bounding coordinates.fromshapely.geometryimportboxbbox=box(-112,34,-105,39)bbox=gpd.GeoDataFrame(geometry=[bbox],crs='EPSG:4326')vs=climatePy.getGridMET(AOI=bbox,varname="vs",startDate="2018-09-01")CreditsCredit toMike J Johnsonand the other contributors to the originalclimateRpackage listed below:Justin SinghMax JosephEric R. ScottJames TsakalosLicenseGNU General Public License v3.0climatePy: Find, subset and retrieve climate and geospatial data by AOI in Python.
Copyright (C) 2023 Angus Watters, Mike J. JohnsonThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, seehttps://www.gnu.org/licenses/.How to ContributeIf you would like to contribute, submit a PR and we will get to as soon as we can!
If you have any issues please open an issue on GitHub. For any questions, feel free to ask@anguswg-ucsbor@mikejohnson51, or simply create an issue on GitHub.