Astronomical FITS Image calibration: Indexing issue using ccdproc

Viewed 561

I seem to be having an issue with some basic astronomical image processing/calibration using the python package ccdproc.

I'm currently compiling 30 bias frames into a single image average of the component frames. Before going through the combination I iterate over each image in order to subtract the overscan region using subtract_overscan() and then select the image dimensions I want to retain using trim_image().

I suppose my indexing is correct but when I get to the combination, it takes extremely long (more than a couple of hours). I'm not sure that this is normal. I suspect something might be being misinterpreted by my computer. I've created the averaged image before without any of the other processing and it didn't take long (5-10 mins or so) which is why I'm thinking it might be an issue with my indexing.

If anyone can verify that my code is correct and/or comment on what might be the issue it'd be a lot of help.

Image dimensions: NAXIS1 = 3128 , NAXIS2 = 3080 and allfiles is a ccdproc.ImageFileCollection.

from astropy.io import fits
import ccdproc as cp

biasImages = []
for filename in allfiles.files_filtered(NAXIS1=3128,NAXIS2=3080,OBSTYPE = 'BIAS'):
    ccd = fits.getdata(allfiles.location + filename)
    # print(ccd)
    ccd = cp.CCDData(ccd, unit = u.adu)
    # print(ccd)
    ccd = cp.subtract_overscan(ccd,overscan_axis = 1, fits_section = '[3099:3124,:]')
    # print(ccd)
    ccd = cp.trim_image(ccd,fits_section = '[27:3095,3:3078]')
    # print(ccd)
    biasImages.append(ccd)

master_bias = cp.combine(biasImages,output_file = path + 'mbias_avg.fits', method='average')
2 Answers
Related