esa / tetra3

A fast lost-in-space plate solver for star trackers.
https://tetra3.readthedocs.io/en/latest/
Apache License 2.0
91 stars 22 forks source link

Modify example script so it is doesn't depend on a specific CWD #16

Closed cgobat closed 9 months ago

cgobat commented 9 months ago

Currently, running test_tetra3.py relies on the current working directory (CWD) being tetra3/examples/, and if it is run from anywhere else (including just tetra3/), it fails. This is easily fixed (e.g. so that python examples/test_tetra3.py from the top-level directory works) by making the paths relative to the absolute path of the script file itself, which can be accessed using the __file__ special variable.

This is a very minor change and should be entirely transparent to users, with the old method of cd examples ; python test_tetra3.py working just as it always has.