Closed sentinel3 closed 2 years ago
Hi Chui Zeng
Thanks for your message! The data directory is indeed a relative path in the config file, and was initiated as an absolute path in ac.config during the import if the relative path could not be found: https://github.com/acolite/acolite/blob/14532fa71e230e129bc7578ece593811130bd3f4/acolite/__init__.py
This did work for several years, and for many users on different platforms. I now think the issue occurs when you are launching acolite from another location that also has a "data" directory. The import then assumes you want to use that data directory instead of the one in acolite/data. This is quite a common directory name, so I am amused that it did not come up before! Maybe people are running acolite mostly from its own directory! :-)
As I do want people to be able to move their data directory, in the last commit I changed the import strategy, only using the paths from the config file if they are provided as absolute, otherwise it is assumed they are relative paths in the default acolite location.
Does this latest fix work for you?
Quinten
Thank you Quinten for the quick response! It currently works with the absolute path I assigned it and our student is frequently using acolite remotely now, so I will test in our next update for this issue. thank you! Chui,
Hi Chui
I believe the last commit https://github.com/acolite/acolite/commit/ff54641945f5f3f1c3654533b8691448c2e44515 would fully resolve this issue.
Feel free to reopen the issue if the problem persists!
Quinten
Hello Vanhellemont, great effort to make this popular AC module open source! we tried it recently, and our student encountered an issue with error message:
FileNotFoundError: [Errno 2] No such file or directory: 'data/RSR/S3A_OLCI.txt'
After tracing back the issue, I notice it is because in the
config/config.txt
, it default sets:data_dir=data
, which is a relative path. when the program runs outside the installation folder, this relativedata
path cannot be found even if I manually update and add theacolite
installation path toPYTHONPATH
.To solve this issue, I temporarily set
data_dir=/absolute/path/to/data
, which worksFor a more permanent solution, I think it would be better to convert the relative paths to absolute paths in the scripts. For instance: sentinel3/l1_convert.py:59:
rsr_file = ac.config['data_dir']+'/RSR/'+sensor+'.txt'
, modified to something like:or even better, directly update the
ac.config['data_dir']
during initiation such as inacolite_run.py
?hope this is helpful,
Chui Zeng Environment and Climate Change Canada