pyhrs:docs

ccd_process

pyhrs.ccd_process(ccd, oscan=None, trim=None, error=False, masterbias=None, bad_pixel_mask=None, gain=None, rdnoise=None, oscan_median=True, oscan_model=None)[source] [edit on github]

Perform basic processing on ccd data.

The following steps can be included:
  • overscan correction
  • trimming of the image
  • create edeviation frame
  • gain correction
  • add a mask to the data
  • subtraction of master bias

The task returns a processed ccdproc.CCDData object.

Parameters:

ccd: `ccdproc.CCDData`

Frame to be reduced

oscan: None, str, or, `~ccdproc.ccddata.CCDData`

For no overscan correction, set to None. Otherwise proivde a region of ccd from which the overscan is extracted, using the FITS conventions for index order and index start, or a slice from ccd that contains the overscan.

trim: None or str

For no trim correction, set to None. Otherwise proivde a region of ccd from which the image should be trimmed, using the FITS conventions for index order and index start.

error: boolean

If True, create an uncertainty array for ccd

masterbias: None, `~numpy.ndarray`, or `~ccdproc.CCDData`

A materbias frame to be subtracted from ccd.

bad_pixel_mask: None or `~numpy.ndarray`

A bad pixel mask for the data. The bad pixel mask should be in given such that bad pixels havea value of 1 and good pixels a value of 0.

gain: None or `~astropy.Quantity`

Gain value to multiple the image by to convert to electrons

rdnoise: None or `~astropy.Quantity`

Read noise for the observations. The read noise should be in electron

oscan_median : bool, optional

If true, takes the median of each line. Otherwise, uses the mean

oscan_model : Model, optional

Model to fit to the data. If None, returns the values calculated by the median or the mean.

Returns:

ccd: ccdproc.CCDData

Reduded ccd

Examples

  1. To overscan, trim, and gain correct a data set:
>>> import numpy as np
>>> from astropy import units as u
>>> from hrsprocess import ccd_process
>>> ccd = CCDData(np.ones([100, 100]), unit=u.adu)
>>> nccd = ccd_process(ccd, oscan='[1:10,1:100]', trim='[10:100, 1,100]',
                       error=False, gain=2.0*u.electron/u.adu)

Page Contents