Running l2gen on OLCI through cmd line
Posted: Thu Oct 10, 2024 2:32 pm America/New_York
Hello,
I am having difficulty with running l2gen on an S3A OLCI scene due to errors with locating the parameter files.
I've set the OCDATAROOT and OCVARROOT with the following: And I am using subprocess to run the following command:
The default installation of ocssw put the common folder inside share, but regardless of what I put for the param_file_path, I get this error:
I have confirmed that msl12_defaults.par exists in the common folder. I also currently have the olci folder, which has its own msl12_defaults.par, into the /ocssw folder.
Interestingly, I can sometimes get the code to work when I shuffle the folders around mid-run (i.e. If I put both olci and common folders in the ocssw folder, change the param_file_path accordingly, then run the code, it gets frozen. If I move the common folder back into share folder while the run is frozen, it will un-freeze and work. But this is the only way I have gotten it to work - the folder must be manually moved mid-run.)
Best,
Sami
I am having difficulty with running l2gen on an S3A OLCI scene due to errors with locating the parameter files.
I've set the OCDATAROOT and OCVARROOT with the following:
Code: Select all
os.environ['OCDATAROOT'] = '/.../l2gen/ocssw'
os.environ['OCVARROOT'] = '/.../l2gen/ocssw/var'
Code: Select all
cmd = f'{l2gen_path} ifile={input_radiance_file_path} ofile={output_file_path} par={param_file_path}'
result = subprocess.run(cmd, shell=True, encoding='ascii', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print("l2gen output:\n", result.stdout)
The default installation of ocssw put the common folder inside share, but regardless of what I put for the param_file_path, I get this error:
Code: Select all
-E- clo_readFile: Can't open parameter file - /.../l2gen/ocssw/common/msl12_defaults.par
Interestingly, I can sometimes get the code to work when I shuffle the folders around mid-run (i.e. If I put both olci and common folders in the ocssw folder, change the param_file_path accordingly, then run the code, it gets frozen. If I move the common folder back into share folder while the run is frozen, it will un-freeze and work. But this is the only way I have gotten it to work - the folder must be manually moved mid-run.)
Best,
Sami