error to run POLYMER v4.11

lzoffoli
Posts: 7
Joined: Fri Jul 12, 2019 9:51 am
company / institution: Universite de Nantes
Location: Nantes

error to run POLYMER v4.11

Post by lzoffoli »

Hello!
I'm new using POLYMER. I just installed the version 4.11. But, when I try to run it I got this error:

---- Running ----
Starting processing at 2019-07-23 12:35:03.887831
Traceback (most recent call last):
File "/home/laura/polymer-v4.11/polymer_cli.py", line 35, in <module>
Level2(filename=args.output_file, fmt=args.fmt))
File "/home/laura/polymer-v4.11/polymer/main.py", line 496, in run_atm_corr
with level2 as l2, level1 as l1:
File "/home/laura/polymer-v4.11/polymer/level1.py", line 106, in __enter__
self.level1 = L1(self.filename, **self.kwargs)
File "/home/laura/polymer-v4.11/polymer/level1_msi.py", line 106, in __init__
self.ancillary = Ancillary_NASA()
File "/home/laura/polymer-v4.11/polymer/ancillary.py", line 160, in __init__
assert isdir(directory), 'Directory {} does not exist. Please create it, by default it will be automatically populated with ancillary data. Please see help for class Ancillary_NASA for more details.'.format(directory)
AssertionError: Directory ANCILLARY/METEO/ does not exist. Please create it, by default it will be automatically populated with ancillary data. Please see help for class Ancillary_NASA for more details.
---- Finished ----


The directory /home/laura/polymer-v4.11/ANCILLARY/METEO/ exists.
I really appreciate any help. Let me know if you need additional information about my system

Many thanks!
Laura
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error to run POLYMER v4.11

Post by fsteinmetz »

Dear Laura,

What is your current working directory when you launch polymer_cli.py ?
It should be /home/laura/polymer-v4.11/, because the directory in ancillary.py is relative to the current working directory.
Otherwise, you can also specify the absolute directory to Ancillary_NASA :
Ancillary_NASA(directory='/home/laura/polymer-v4.11/ANCILLARY/METEO/')

Kind regards,
François
lzoffoli
Posts: 7
Joined: Fri Jul 12, 2019 9:51 am
company / institution: Universite de Nantes
Location: Nantes

Re: error to run POLYMER v4.11

Post by lzoffoli »

Dear Francois,
Thank you very much for your reply
I run polymer using the command line: python /home/laura/polymer-v4.11/polymer_cli.py /home/laura/Desktop/Glenan/Glenan2019/S2A_MSIL1C_20190711T110631_N0208_R137_T30TVT_20190711T113600.SAFE/GRANULE/L1C_T30TVT_A021155_20190711T111454/ /home/laura/Desktop/Glenan/Glenan2019/POLYMER/msi_l2_20190711_30TVT_.POLY.nc -fmt='netcdf4'

the error now has changed. I got something related to the projection as follow:

Starting processing at 2019-08-19 15:26:31.551914
Initialize MSI projection EPSG:32630
Traceback (most recent call last):
File "/home/laura/anaconda3/lib/python3.6/site-packages/pyproj/datadir.py", line 99, in get_data_dir
"Valid PROJ data directory not found."
pyproj.exceptions.DataDirError: Valid PROJ data directory not found.Either set the path using the environmental variable PROJ_LIB or with `pyproj.datadir.set_data_dir`.
Exception ignored in: 'pyproj._datadir.get_pyproj_context'
Traceback (most recent call last):
File "/home/laura/anaconda3/lib/python3.6/site-packages/pyproj/datadir.py", line 99, in get_data_dir
"Valid PROJ data directory not found."
pyproj.exceptions.DataDirError: Valid PROJ data directory not found.Either set the path using the environmental variable PROJ_LIB or with `pyproj.datadir.set_data_dir`.
proj_create: Cannot find proj.db
proj_create: init=epsg:/init=IGNF: syntax not supported in non-PROJ4 emulation mode
Traceback (most recent call last):
File "/home/laura/polymer-v4.11/polymer_cli.py", line 35, in <module>
Level2(filename=args.output_file, fmt=args.fmt))
File "/home/laura/polymer-v4.11/polymer/main.py", line 496, in run_atm_corr
with level2 as l2, level1 as l1:
File "/home/laura/polymer-v4.11/polymer/level1.py", line 106, in __enter__
self.level1 = L1(self.filename, **self.kwargs)
File "/home/laura/polymer-v4.11/polymer/level1_msi.py", line 149, in __init__
self.init_latlon()
File "/home/laura/polymer-v4.11/polymer/level1_msi.py", line 191, in init_latlon
proj = pyproj.Proj('+init={}'.format(code))
File "/home/laura/anaconda3/lib/python3.6/site-packages/pyproj/proj.py", line 147, in __init__
self.crs = CRS.from_user_input(projparams if projparams is not None else kwargs)
File "/home/laura/anaconda3/lib/python3.6/site-packages/pyproj/crs.py", line 429, in from_user_input
return cls(value)
File "/home/laura/anaconda3/lib/python3.6/site-packages/pyproj/crs.py", line 298, in __init__
super(CRS, self).__init__(projstring)
File "pyproj/_crs.pyx", line 1292, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection: +init=epsg:32630 +type=crs

thanks a lot in advance for your help,
Best regards
Laura
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error to run POLYMER v4.11

Post by fsteinmetz »

Hello Laura,

There seems to be a problem with your installation of proj.4, seeminlgy related with this issue.
Is the variable PROJ_LIB set by your environment ? (see here).
Cheers,
François
lzoffoli
Posts: 7
Joined: Fri Jul 12, 2019 9:51 am
company / institution: Universite de Nantes
Location: Nantes

Re: error to run POLYMER v4.11

Post by lzoffoli »

Hello Francois,
the variable PROJ_LIB is associated to SEADAS (see below)

$ env | grep PROJ
PROJ_LIB=/home/laura/seadas-7.5.3/ocssw/opt/share/proj

there is something that I can do to link it to POLYMER?
thanks a lot!
Laura
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error to run POLYMER v4.11

Post by fsteinmetz »

This PROJ_LIB environment variable should be set by your anaconda environment for use by pyproj.
There is maybe a conflict with this seadas-related variable.
Is it set in your .bashrc ? If so, could you try to remove it from your .bashrc, restart your anaconda environment and see if that helps ?
lzoffoli
Posts: 7
Joined: Fri Jul 12, 2019 9:51 am
company / institution: Universite de Nantes
Location: Nantes

Re: error to run POLYMER v4.11

Post by lzoffoli »

Hello Francois,
thanks again for your reply

I can see that pyproj is installed also in the directory /home/laura/anaconda3/lib/python3.6/site-packages (2.2.1)
but as I told you before, it seems that polymer calls the PROJ_LIB installed in /home/laura/seadas-7.5.3/ocssw/opt/share/proj

As I don't have enough computing knowledge, I'm afraid of making some changes that makes seadas cannot work properly after. So, could you indicate me, please, how can I do to check if PROJ_LIB is set in my .bashrc and how to remove it?

thanks!
Laura
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error to run POLYMER v4.11

Post by fsteinmetz »

Please edit your file /home/laura/.bashrc, and see if the variable PROJ_LIB is set in this file. If this is the case, please comment out this line, restart your terminal and see if it works.
lzoffoli
Posts: 7
Joined: Fri Jul 12, 2019 9:51 am
company / institution: Universite de Nantes
Location: Nantes

Re: error to run POLYMER v4.11

Post by lzoffoli »

I checked in my .bashrc file and the variable PROJ_LIB didn't exist. Just in case, I added a line PROJ_LIB=/home/laura/anaconda3/lib/python3.6/site-packages/pyproj, but the error still persists

thanks for your help!
Laura
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: error to run POLYMER v4.11

Post by fsteinmetz »

Can you show the seadas-related lines in your .bashrc?
Post Reply