lucadelu / pyModis

python library to work with MODIS data
http://www.pymodis.org/
Other
166 stars 86 forks source link

modis_convert.py error: XML or text declaration not at start of entity #108

Open Ghonex opened 6 years ago

Ghonex commented 6 years ago

Hi everyone!!!

I am currently working on MOD11A1 (https://e4ftl01.cr.usgs.gov/MOLT/MOD11A1). I have successfully executed modis_mosaic.py but I am having trouble executing modis_convert.py. it gave me this error

xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 1, column 166

I turned into one of the XML files generated by modis_mosaic.py and made the following change:

from

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE GranuleMetaDataFile SYSTEM "http://ecsinfo.gsfc.nasa.gov/ECSInfo/ecsmetadata/dtds/DPL/ECS/ScienceGranuleMetadata.dtd"><?xml version="1.0" ?>.......

to

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE GranuleMetaDataFile SYSTEM "http://ecsinfo.gsfc.nasa.gov/ECSInfo/ecsmetadata/dtds/DPL/ECS/ScienceGranuleMetadata.dtd">........

After making this change, modis_convert.py runs successfully. But I am dealing with 18 years of daily data. Is there another way to deal with this problem aside from editing every xml file generated by modis_mosaic.py? That was 6500+ xml files.

Any help would be appreciated.

lucadelu commented 6 years ago

Hi @Ghonex ,

sorry for the delay in the answer, I cannot see what do you modify in the XML file. Could you also attach your full procedure?

Thanks Luca