This is a small project in progress. pycdr provides an API for accessing climate data records from the National Centers for Environmental Information (NCEI) hosted datasets. With pycdr, you can easily query datasets, retrieve dataset URLs, and access dataset information.
This is a MVP that provides some dataset to retrieve:
- AVHRR and VIIRS Normalized Difference Vegetation Index (NDVI)
- AVHRR and VIIRS Leaf Area Index & Fraction of Absorbed Photosynthetically Active Radiation (LAI FAPAR)
- AVHRR and VIIRS Surface Reflectance.
- AVHRR Daily and Monthly Aerosol Optical Thickness (AOT)
- Pecipitation - PERSIANN CDR
- GRIDSAT-B1 Geostationary IR Channel Brightness Temperature
- Sea Surface Temperature - WHOI, Version 2
- Ocean Heat Fluxes; SeaFlux OSB CDR: Heat Fluxes, Version 2
- Sea Ice Concentration
- Add more dataset (Incomplete)
pycdr will be installed using pip
from pycdr.cdr import CDRApi
from pycdr.datasets import Datasets
# Create an instance of CDRApi
api = CDRApi(start_date='2022-01-01', end_date='2022-01-10', dataset=Datasets.AVHRR_VIIRS_NDVI_V5)
# Query data and retrieve URLs
api.query(return_urls=False)
# Display the saved dataset URLs
print("Dataset URLs:")
for url in api.dataset_urls:
print(url)
# Retrieve dataset information
infos = api.info(return_info=True)
infos
# Check if a specific URL is available
url_to_check = 'https://www.ncei.noaa.gov/thredds/dodsC/cdr/ndvi/2022/VIIRS-Land_v001-preliminary_NPP13C1_S-NPP_20220101_c20220419212429.nc'
if api.is_available(url_to_check):
print(f"{url_to_check} is available.")
else:
print(f"{url_to_check} is not available.")
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the National Centers for Environmental Information (NCEI) for hosting the datasets used by this API.