Errors in ExamineSnap
See original GitHub issueThe last commit has introduced some errors (Linux environment) when calling pyroSAR.snap.geocode:
Traceback (most recent call last):
File "/usr/local/bin/geocode.py", line 13, in <module>
from pyroSAR.snap import geocode
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/__init__.py", line 4, in <module>
snap_config = ExamineSnap()
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/auxil.py", line 250, in __init__
self.__get_etc()
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/auxil.py", line 262, in __get_etc
except WindowsError:
NameError: global name 'WindowsError' is not defined
If I adjust this manually to OSError than the following error occurs:
Traceback (most recent call last):
File "/usr/local/bin/geocode.py", line 13, in <module>
from pyroSAR.snap import geocode
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/__init__.py", line 4, in <module>
snap_config = ExamineSnap()
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/auxil.py", line 250, in __init__
self.__get_etc()
File "/usr/local/lib/python2.7/dist-packages/pyroSAR/snap/auxil.py", line 260, in __get_etc
self.config_path = os.path.join(self.etc, [s for s in self.auxdata if "snap.auxdata.properties" in s][0])
IndexError: list index out of range
I also do not understand why the “etc” directory is related to the path of the executable (self.path), see line 258 of pyroSAR/snap/auxil.py:
self.etc = os.path.join(os.path.dirname(os.path.dirname(self.path)), 'etc')
On my system I have an “etc” directory within HOME/.snap with configuration files.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Source code for pyroSAR.snap.auxil
... import ExamineSnap from pyroSAR.ancillary import windows_fileprefix, ... which can easily be removed from the workflow pattern = r"Error: \[NodeId: ...
Read more >No such field org.esa.snap.core.gpf.graph.Node.file - python
I am using Snap2stamps and I have this error with coreg_ifg_topsar.py : Error: No such field org.esa.snap.core.gpf.graph.
Read more >SNAP and Misreporting
Researchers often rely on survey datasets to examine SNAP; Several studies have ... Find evidence of severe errors in changes in reported SNAP...
Read more >Feasibility of Revising the SNAP Quality Control Review Process
track and measure errors in eligibility and benefit determination for the ... First, a study FNS contracted to examine SNAP QC completion rates...
Read more >How Tight Are the Strands of the Recessionary Safety Net?
partnered with several research organizations, some of which examine SNAP and UI ... errors using the replicate weights and the methodology of Balanced ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In this case I use SNAP 5. The path variable (self.path) is set to /usr/local/bin/snap, which is a link:
lrwxrwxrwx 1 root staff 18 Mar 31 14:13 /usr/local/bin/snap -> /opt/snap/bin/snap
The etc variable (https://github.com/johntruckenbrodt/pyroSAR/blob/master/pyroSAR/snap/auxil.py#L258) is then /usr/local/etc but it should be /opt/snap/etc. So it seems that the link generates the error.
The config files are indeed located in /opt/snap/etc.
Edit: You could use
os.path.islink(path)
to check for symlinks andos.path.realpath(path)
to resolve the symlinks:Roger that! I delete the comma. Exactly as you said the comma convert the
dict
into atuple
. I will push the changes in to my forked repository and delete this issue here. If you find any other bugs we can generate a new issue.Thanks again for your message, advices and suggestions.