This relates to #2. There should be pytests to check the proper removal of cosmics. Maybe the easiest approach is to use some test data and do a regression test.