[AstroPy] Image combination with sigma clipping

Lisa Alborghetti lisi.alborghetti at gmail.com
Tue Feb 6 10:25:00 EST 2024


Hi Matt, 
Yes, once I have imported the FITS file, I can access each image data by indexing the CCDData object with the extension number.  (ccd[0].data, ccd[16].data etc.)
Thanks, 

Lisa

> On 6 Feb 2024, at 16:15, Craig, Matthew W via AstroPy <astropy at python.org> wrote:
> 
> Hi Lisa,
> 
> Just to make sure I understand, are the 50 images in different extensions in the same FITS file?
> 
> Thanks,
> 
> Matt Craig
> Schedule: http://physics.mnstate.edu/craig
> ---
> Professor, Department of Physics and Astronomy 
> MSUM
> 
> From: AstroPy <astropy-bounces+mcraig=mnstate.edu at python.org <mailto:astropy-bounces+mcraig=mnstate.edu at python.org>> on behalf of Lisa Alborghetti <lisi.alborghetti at gmail.com <mailto:lisi.alborghetti at gmail.com>>
> Sent: Tuesday, February 6, 2024 9:06 AM
> To: astropy at python.org <mailto:astropy at python.org> <astropy at python.org <mailto:astropy at python.org>>
> Subject: [AstroPy] Image combination with sigma clipping
>  
> CAUTION: This e-mail originated from outside the Minnesota State System. Only click links or open attachments from trusted sources. Please report suspicious messages using the "Report Message Button". 
> Hi everybody,
> I’m new to AstroPy, and I have what I believe to be a very simple question: I have a .fits file, containing a series of 50 images that I want to combine to create a dark image of my CCD. Before averaging, I would like to perform a sigma_clipping using mad_std. 
> I was trying with something like this:
> 
> from astropy import units as u
> from astropy.nddata import CCDData
> from ccdproc import Combiner
> import numpy as np
> 
> ccd = CCDData.read('Dark Current/minus_10/5_sec/Background_fits.fits', unit="adu")
> 
> combiner = Combiner(ccd)
> 
> combiner_clipped = combiner.sigma_clipping(low_thresh=2, high_thresh=5, func='median', dev_func='mad_std')
> 
> combined_average = combiner_clipped.average_combine()  
> 
> 
> But it doesn’t seem to be the right way to do it. In fact, I get:
> 
> 
> ---> 12
>  combined_average =
> combiner_clipped.average_combine()
> AttributeError:
>  'NoneType' object has no attribute ‘average_combine’
> 
> Can someone help me with this, please?
> Thank you!
> 
> Lisa
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org <mailto:AstroPy at python.org>
> https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20240206/f9877f07/attachment-0001.html>


More information about the AstroPy mailing list