SEN2COR writes files in the installation folder at runtime

Hello!

We’ve installed SEN2COR as root on Linux and we ran into the message:

IOError: [Errno 13] Permission denied: ‘/opt/anaconda/lib/python2.7/site-packages/sen2cor/cfg/.estimation’

We believe this is not a good approach and the file .estimation should be in the user space instead.

For instance this limits submitting two concurrent L2A_Process.

We could patch the software but for sure the best approach would be to escalate this to the developers (which have removed the “issues” feature of the GitHub repo (https://github.com/umwilm/SEN2COR)

Any help on how to do this is appreciated

cheers

1 Like

Hi,

we patched the sen2cor 2.0.6 for the Permission denied issue for the .estimation file. Here’s the patch:

`
@@ -39,7 +39,7 @@
self._tEst20 = 500.0
self._tEst10 = 1500.0
self._processingStatusFn = self._logDir + ‘.progress’

  •        self._processingEstimationFn = self._configDir + '.estimation'
    
  •        self._processingEstimationFn = self._home + 'cfg/.estimation'
           if os.path.isfile(self._processingEstimationFn) == False:
           # init processing estimation file:
            config = ConfigParser.RawConfigParser()
    

`

It allows also the parallel execution of the code on the same machine if the SENCOR_HOME variable is defined per process.

We packaged this version as an Anaconda package, available at https://anaconda.org/Terradue/sen2cor/. Here’s the installation and usage procedure:

 conda install -c terradue sen2cor=2.0.6

 # set the sen2cor environment
 export PATH=/opt/anaconda/bin/:$PATH
 export GDAL_DATA=/opt/anaconda/share/gdal
 export SEN2COR_BIN=/opt/anaconda/lib/python2.7/site-packages/sen2cor/
 export SEN2COR_HOME=<your preferred folder>/sen2cor

 # create the sen2cor configuration folder
 mkdir -p ${SEN2COR_HOME}/cfg
 cp ${SEN2COR_BIN}/cfg/L2A_GIPP.xml ${SEN2COR_HOME}/cfg/`

Cheers,
Cesare Rossi
Terradue S.r.l.

2 Likes

agreed, will place it to the user space.

the new version will have this file under the log directory in the user space. This is the place SEN2COR_HOME points to.

@umwilm besides the correction for the user space, would this conda recipe simplify the installation procedure?
We’d be happy to share what we have done to ease future installations on SEN2COR

This sounds interesting. Unfortunately the new release just crossed this info. But I will have a look at it for the upcoming release. Will you be at the LPS next week? Maybe we can talk about.