james-m-osborn / astrosat

18 stars 2 forks source link

tries to find bright star catalogue file using absolute path #2

Open ojdf opened 2 years ago

ojdf commented 2 years ago

The line

with open("astroSat/data/bsc.dat",'r') as f:

gives

FileNotFoundError: [Errno 2] No such file or directory: 'astroSat/data/bsc.dat'

when running scripts anywhere other than the astrosat directory. The fix is to change this line to

with open(os.path.dirname(__file__)+"/data/bsc.dat",'r') as f:

ojdf commented 2 years ago

I've fixed it here, probably needs to be pushed to PyPI @matthewtownson ?

matthewtownson commented 2 years ago

Yes, I will push that through next week.