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

parsemodis error with MCD43A3 #114

Open
arthurelmes opened this issue Sep 19, 2018 · 2 comments
Open

parsemodis error with MCD43A3 #114

arthurelmes opened this issue Sep 19, 2018 · 2 comments

Comments

@arthurelmes
Copy link

arthurelmes commented Sep 19, 2018

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 "", line 13, in
mosaic.run(output_tif)

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

@arthurelmes
Copy link
Author

As a note, I have also tried this using the command line interface, with the same result.

@ajvershov-alt
Copy link

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.

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

2 participants