spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
557 stars 164 forks source link

Improve asn_make_pool commandline interface #6923

Open Jerry-Ma opened 2 years ago

Jerry-Ma commented 2 years ago

It turns out that the asn_make_pool commandline interface is very easily to be misused so that image files are clobbered silently, because both the pool file and image files are position arguments:

asn_make_pool <pool_file> <image_file1> [image_file2] ...

When mistakenly run commands like asn_make_pool *.fits, the first image file is clobbered with the content of the output pool table file.

Possible solutions:

  1. Add check of first file to make sure it does not clobber when exists unless a flag like --overwrite is specified.

  2. Make the pool file non-positional, such as asn_make_pool --output pool_file *.fits

stscieisenhamer commented 2 years ago

Thank you for the report!

There is enough information to reproduce locally. This issue will be updated when work has been started/completed.