You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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 !
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/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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: