GERSL / Fmask

The software called Fmask (Function of mask) is used for automated clouds, cloud shadows, and snow masking for Landsats 4-8 and Sentinel 2 images.
MIT License
168 stars 57 forks source link

Error in using fmask4.6 linux version #31

Closed sqwev closed 7 months ago

sqwev commented 1 year ago

I'm a student studying remote sensing in estimating crop yield. Recently I want to using Fmask to remove clouds and shadow in Sentinel2 images.

I carefully install Fmask4.6 following the guide. 1.Install version 9.10 (R2021a) of the MATLAB Runtime 2.Run Fmask_4_6_Linux_mcr.install

with the issue#22 in Github, I modify the eval "\"${exe_dir}/Fmask_4_6\"" $args to eval "\"${exe_dir}/Fmask_4_6\"" "${exe_dir}/AuxiData" $args

However, when I try to run Fmask, mycommad is

(base) shenzhou@shenzhou-CN15S:~/S2A_MSIL2A_20210721T021611_N0301_R003_T52TFT_20210721T050130.SAFE/GRANULE/L2A_T52TFT_A031746_20210721T022210$ /home/shenzhou/GERS/Fmask_4_6/application/Fmask_4_6 
Fmask 4.6 start ...
Cloud/cloud shadow/snow dilated by 3/3/0 pixels.
Cloud probability threshold of 20.00%.
Load or calculate TOA reflectances.
Error using xmlread (line 116)
Java exception occurred: 
org.xml.sax.SAXParseException; systemId: file:/home/shenzhou/S2A_MSIL2A_20210721T021611_N0301_R003_T52TFT_20210721T050130.SAFE/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)

Error in xml2struct (line 53)

Error in ReadS2RadiometricOffset (line 10)

Error in LoadData (line 52)

Error in autoFmask (line 122)

Error in Fmask_4_6 (line 44)

MATLAB:Java:GenericException

Could you please help me fix it?

hastaluegoph commented 1 year ago

I have similar problem when run fmask 4.3 in linux

j08lue commented 1 year ago

Have you considered using a container, e.g. https://github.com/DHI-GRAS/fmaskilicious? Currently for Fmask 4.5 and there is a PR for 4.6 https://github.com/DHI-GRAS/fmaskilicious/pull/12