Hello, in my code, I would like to do a bands subset on multiple .SEN3 files. When I manually set the file to be for example
file = '/home/lubomir/Desktop/Sentinel3_OLCI/raw_data/S3A_OL_1_EFR____20180722T081656_20180722T081956_20180722T102419_0179_033_349_2160_MAR_O_NR_002.SEN3'
everything works just fine. However, if I try to parse through all .SEN3 files in directory: /home/lubomir/Desktop/Sentinel3_OLCI/raw_data
I get the following error:
Reading 1st file
WARNING: org.esa.s3tbx.dataio.s3.AbstractProductFactory: /home/lubomir/Desktop/Sentinel3_OLCI/scripts_snappy/S3A_OL_1_EFR____20180820T090533_20180820T090833_20180820T111458_0179_034_378_2160_MAR_O_NR_002.SEN3/./Oa01_radiance.nc (No such file or directory)
WARNING: org.esa.s3tbx.dataio.s3.AbstractProductFactory: Could not find './Oa01_radiance.nc'.
and so on .........
Seems like problems with defined path. This is my code:
os.chdir("/home/lubomir/Desktop/Sentinel3_OLCI/raw_data")
for file in glob.glob("*.SEN3"):
print ("Reading " + str(poradie) + "st file")
product = ProductIO.readProduct(file)
name = product.getName()
band_names = product.getBandNames()
cas = product.getStartTime()
casParsnuty = datetime.strptime(str(cas),'%d-%b-%Y %H:%M:%S.%f')
subset = '/home/lubomir/Desktop/Sentinel3_OLCI/band_subset/subset_' +
casParsnuty.strftime("%Y%m%d_%H%M")
Any suggestions ? Thanks for your help and time.