dwkim78 / ASTRiDE

AUTOMATED STREAK DETECTION FOR ASTRONOMICAL IMAGES
MIT License
49 stars 23 forks source link

file name parsing doesn't use directory name #4

Closed teuben closed 6 years ago

teuben commented 6 years ago

if I use Streak('abc/x1.fits') it will dump the products in a local directory named 'x1', instead of the desired 'abc/x1', which I believe is an unexpected result. Alternatively one can do Streak('abc/x1.fits',output_path='abc') but I'm arguing the default behavior of output_path=None is unexpected.

teuben commented 6 years ago

correction: the last example I gave overwrites and keeps the streaks in the directory...

teuben commented 6 years ago

Streak(ff,output_path=ff[:ff.rfind('.')])

is the desired default.

dwkim78 commented 6 years ago

That is actually a desired result since the original comment for the output_path of Streak class is: ''' output_path: str, optional Path to save figures and output files. If None, the base filename is used as the folder name. '''

Nevertheless, I agree that your suggestion makes more sense than the original code. I'll implement this in the next release.

teuben commented 6 years ago

good idea. Imagine is somebody was using x1 also for the directory name, i.e. x1/x1.fits, x1/x2.fits.... that might get confusing.