pyModis
pyModis copied to clipboard
parsemodis error with MCD43A3
Hello, Thanks for making this great package! I am able to download the data I need, but I am not able to parse the HDF files, and therefore createMosaicGDAL() also does not work, as it appears to call parsemodis.py. I receive the following error, while working with MCD43A3 data (albedo product: https://e4ftl01.cr.usgs.gov/MOTA/MCD43A3.006/2018.01.06/ Files: MCD43A3.A2018006.h16v01.006.2018015032314.hdf MCD43A3.A2018006.h17v01.006.2018015032230.hdf
I have the data all downloaded already, so below is code after that part, and after all relevant imports.
When I run the following code, I receive an error (after code):
` subset = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] output_prefix = os.path.join(dest_folder, 'MCD43A3.A2018006.mosaic') output_tif = os.path.join(dest_folder, 'MCD43A3.A2018006.mosaic.tif')
mosaic_file_list = glob.glob(os.path.join(dest_folder,'MCD43A3.A2018006*.hdf')) mosaic = createMosaicGDAL(mosaic_file_list, subset, 'GTiff') mosaic.run(output_tif) mosaic.write_vrt(output_prefix)`
The error:
`Traceback (most recent call last):
File "
File "/home/aelmes/anaconda3/lib/python3.6/site-packages/pymodis/convertmodis_gdal.py", line 613, in run self.write_mosaic_xml(output)
File "/home/aelmes/anaconda3/lib/python3.6/site-packages/pymodis/convertmodis_gdal.py", line 585, in write_mosaic_xml pmm.writexml("%s.xml" % prefix)
File "/home/aelmes/anaconda3/lib/python3.6/site-packages/pymodis/parsemodis.py", line 982, in writexml self.valMeasuredParameter(mpc)
File "/home/aelmes/anaconda3/lib/python3.6/site-packages/pymodis/parsemodis.py", line 821, in valMeasuredParameter for val in i.retMeasure().values():
File "/home/aelmes/anaconda3/lib/python3.6/site-packages/pymodis/parsemodis.py", line 208, in retMeasure for i in meStat.getiterator():
AttributeError: 'NoneType' object has no attribute 'getiterator'`
I don't get this error when using the LST data shown in the examples, but I cannot figure out why the two products behave differently, other than the number of layers, which I accounted for by changing the subset variable.
Any help would be very appreciated!
Thanks
As a note, I have also tried this using the command line interface, with the same result.
Hi @arthurelmes, were you ever able to figure this out? I have what I believe is a similar issue which I've posted as #161.