Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPLE_OpenFailedError: '/kaggle/working/firedpy-main/output/rasters/land_cover/2001/MCD12Q1.A2001001.h26v04.061.2022146141446.hdf' not recognized as being in a supported file format. #96

Open
NPriyankaDS opened this issue Feb 7, 2025 · 0 comments

Comments

@NPriyankaDS
Copy link

Hi Team,

I am trying to generate the daily files for India for the Modis tiles h26v04 (for Uttarakhand in India) using the kaggle notebook.
The code is as below: However I am getting the error as pasted below the code. Kindly help to resolve the issue. Is there anything I am missing? Thank you !

Code:
!wget https://github.com/earthlab/firedpy/archive/refs/heads/main.zip
!unzip main.zip
! pip install rasterio netCDF4 paramiko h5py gdal xarray rioxarray --q

Import dependencies

import sys
sys.path.append('firedpy-main/bin')
import firedpy
from firedpy import *

Run the main function with our arguments

main()

Error:
CPLE_OpenFailedError: '/kaggle/working/firedpy-main/output/rasters/land_cover/2001/MCD12Q1.A2001001.h26v04.061.2022146141446.hdf' not recognized as being in a supported file format.
During handling of the above exception, another exception occurred:

RasterioIOError Traceback (most recent call last)
in <cell line: 2>()
1 # Run the main function with our arguments
----> 2 main()

/kaggle/working/firedpy-main/bin/firedpy.py in main()
207 print('Retrieving landcover...')
208 land_cover = LandCover(out_dir, n_cores=n_cores, username=username, password=password)
--> 209 land_cover.get_land_cover(tiles, land_cover_type)
210
211 eco_region_data = EcoRegion(out_dir)

/kaggle/working/firedpy-main/src/data_classes.py in get_land_cover(self, tiles, land_cover_type)
695 download_requests = self._create_requests([year_path], tiles)
696 self._download_files(download_requests)
--> 697 self._create_annual_mosaic(year, land_cover_type)
698
699 print("Mosaicking/remosaicking land cover tiles...")

/kaggle/working/firedpy-main/src/data_classes.py in _create_annual_mosaic(self, year, land_cover_type)
642 datasets = []
643 for lc_file_path in lc_files:
--> 644 with rasterio.open(lc_file_path) as lc_file:
645 datasets.append([sd for sd in lc_file.subdatasets if str(land_cover_type.value) in sd.lower()][0])
646

/usr/local/lib/python3.10/dist-packages/rasterio/env.py in wrapper(*args, **kwds)
461
462 with env_ctor(session=session):
--> 463 return f(*args, **kwds)
464
465 return wrapper

/usr/local/lib/python3.10/dist-packages/rasterio/init.py in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, opener, **kwargs)
354
355 if mode == "r":
--> 356 dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
357 elif mode == "r+":
358 dataset = get_writer_for_path(path, driver=driver)(

rasterio/_base.pyx in rasterio._base.DatasetBase.init()

RasterioIOError: '/kaggle/working/firedpy-main/output/rasters/land_cover/2001/MCD12Q1.A2001001.h26v04.061.2022146141446.hdf' not recognized as being in a supported file format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant