etomps
April 20, 2020, 12:44pm
#1
I have sen2cor downloaded as a standalone product (using windows).
I’ve added it to path and when I call it from within the virtual env I set up/command line it works fine.
But I need to add it into a python script, and I tired to do this with the following:
os.system("L2A_process --resolution 10 " + path_to_SAFE_folder)
and I get this error:
"Product version cannot be read.
14.5 will be used by default, but warnings during validation might occur.
Sen2Cor 2.8.0: Product version cannot be read."
I also tried using subprocess instead of os and I get an error saying:
“TypeError: ‘module’ object is not callable”
Should I be calling this another way or is there a direct python sen2cor library I’m not aware of?
ABraun
April 20, 2020, 1:40pm
#2
I don’t know if this changes anything, but as you want the highest resolution anyways, you can leave out the --resolution 10 in the command and simply call the batch and the folder.
Maybe worth a try.
etomps
April 20, 2020, 2:33pm
#3
Tried that but getting the same error
Product version cannot be read.
14.5 will be used by default, but warnings during validation might occur.
Sen2Cor 2.8.0: Product version cannot be read.
ABraun
April 20, 2020, 2:58pm
#4
hm, just based on other topics I found on this error: Are the images stored in folders with very long path?
etomps
April 20, 2020, 3:09pm
#5
oh yes, to map to the .SAFE file it’s 198 chars. will try a shorter path and see what happens