Snappy RuntimeError: Unparseable date in Enhanced-Spectral-Diversity

Hi, I am here because you can find a lot of useful information about SNAP and implementation of various solutions. I am encountering a problem while creating a process for calculating DInSAR deformation maps when using the Enhanced-Spectral-Diversity module using the snappy library:

Code of Enhanced-Spectral-Diversity function:

def EnhancedSpectralDiversity(data):
parameters = HashMap()
parameters.put("Registration Window Width", 512)
parameters.put("Registration Window Height", 512)
parameters.put("Search Window Accuracy in Azimuth Direction", 16)
parameters.put("Search Window Accuracy in Range Direction", 16)
parameters.put("Window oversampling factor", 128)
parameters.put("Cross-Correlation Threshold", 0.1)
parameters.put("cohThreshold", 0.3)
parameters.put("numBlocksPerOverlap", 10)
parameters.put("esdEstimator", 'Periodogram')
parameters.put("weightFunc", 'Inv Quadratic')
parameters.put("temporalBaselineType", 'Number of images')
parameters.put("maxTemporalBaseline", 4)
parameters.put("integrationMethod", 'L1 and L2')
parameters.put("doNotWriteTargetBands", False)
parameters.put("useSuppliedRangeShift", False)
parameters.put("overallRangeShift", 0.0)
parameters.put("useSuppliedAzimuthShift",False)
parameters.put("overallAzimuthShift",0.0)

return GPF.createProduct('Enhanced-Spectral-Diversity', parameters, data)

Error:
RuntimeError : org.esa.snap.core.gpf.OperatorException: Unparseable date: “12Aug2022”

Here a screenshot:


The process I wanted to implement by snappy:

For this purpose, I use two images of Sentinel-1:
S1A_IW_SLC__1SDV_20220731T163536_20220731T163603_044347_054ADD_1C54
S1A_IW_SLC__1SDV_20220812T163536_20220812T163603_044522_055029_FE05

I am also using SNAP 9.0.0 and Anaconda with an environment enabling configuration where python=3.6

Thanks in advance for any help!

Hi,
what is the language setting and the locale of your system?
Do you use English? If not, try to set it to English.
I guess when the operator parses the date, your system setting is used instead of the English locale.
This has been asked before Unparseable date: “03Mar2016” - s1tbx / Problem Reports - STEP Forum (esa.int). Unfortunately, without a solution.

@lveci @jun_lu
Can you check this? I think in mapIndicesOfSortedImages and computeTemporalBaselineInDays
The instances of SimpleDateFormat need to be created with Locale.ENGLISH as parameter.

Changing the system language from local to English solved the problem. Thank you very much for your help!

Thanks for the feedback.
I’ve created an issue for this:
[SITBX-930] Unparseable date exception Enhanced-Spectral-Diversity - JIRA (atlassian.net)

2 Likes