I also tried to use another method, you can see this post, C2RCC for Sentinel 3 OLCI in pytthon - s3tbx - STEP Forum (esa.int)in python. At first I only print variables such as rrs _ 1 found to be 0 or null, but I print out all variables, found that not all are null, but the variables related to reflectivity are null. Does this mean that there is a problem with my method ? But python and cmd methods have problems, what should I do ?
Thanks so much.
Let’s start form the beginning: have you run an image using the GUI and results look ok? If so, how many images you have to process? How do you intend to use gpt? Command line? I see a .bat fike in your screenshot but it is not used in the right way. I am sorry but I am not able to understand what you are doing and the error you obtained.
Please, try with the SNAP GUI first. Select one image and run it with the Graph Builder and the Batch Processing tools. That will help to understand the .xml file a bit better. After that, try the same process using the command line with only one image. The next step is to run the process on several images. If you have some Python background, I could help to do the batch processing with a Python script later on.
Dear Ana,
Thank you for your reply.
I want to invert the chla of clean lake. I first clipped ROI in batches to reduce the workload, and then do C2RCC. However, I use the following code to get rhown and rrs but so many 0, I think it is a parameter setting problem, I use the default parameters, how to modify the parameters in python? Like in SNAP (shown below)? Whether SNAP can do batch C2RCC?
import os
import time
import datetime
from subprocess import call
filepath1=‘H:/Data/’ #Original data downloaded from website
outputdir=‘H:/C2RCC/’ #C2RCC atmospheric corrected data
filelist1=os.listdir(filepath1)
inputlist=[]
outputlist=[]
for fl1 in filelist1:
outfile1=outputdir+fl1+‘_C2RCC.nc’
if os.path.exists(outfile1):
continue
else:
outputlist.append(outfile1)
filepath2=filepath1+fl1
filelist2=os.listdir(filepath2)
filepath3=filepath2+‘/’+filelist2[0]
filelist3=os.listdir(filepath3)
for fl3 in filelist3:
fl3l=fl3.split(‘.’)
if fl3l[-1]==‘xml’:
filepath4=filepath3+‘/’+fl3
inputlist.append(filepath4)
else:
continue
for inputfile,outputfile in zip(inputlist,outputlist):
try:
print(‘Start processing-----------’+str(datetime.datetime.now()))
print(inputfile)
cmdline=‘gpt c2rcc.olci -SsourceProduct=“’+inputfile+‘” -PoutputAsRrs=“true” -t “’+outputfile+‘” -f “NetCDF4-BEAM”’
call(cmdline)
print(‘End of processing-----------’+str(datetime.datetime.now()))
print(‘\n\n’)
except:
print(inputfile+‘Processing failed’)
continue