question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors in ExamineSnap

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonas-eberlecommented, Mar 31, 2018

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 and os.path.realpath(path) to resolve the symlinks:

>>> os.path.realpath('/usr/local/bin/snap')
'/opt/snap/bin/snap'
0reactions
ibariscommented, Mar 31, 2018

Roger that! I delete the comma. Exactly as you said the comma convert the dict into a tuple. 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found