Skipping blank hdu names
Add exposure time argument
Split out conditionals into new function