maskboxlev - def maskboxlev(data, halfwidth=2., lowlev=2,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
def maskboxlev(data, halfwidth=2., lowlev=2, highlev=4, boost=None, retsmooth=False, retdisc=False): ''' SYNTAX: result = maskboxlev(data, inheader, halfwidth, lowlev, highlev, boost) PURPOSE: Makes a mask of outlier pixels in data using a boxcar-average comparison. INPUTS: data: The 2D array of values to test. halfwidth: Size parameter for boxcar filter. Box will be 2*halfwidth+1 elements wide and high (default: 2). lowlev: Lower boundary of good data below discriminator (default: 2). highlev: Upper boundary of good data above discriminator (default: 4). boost: Value to add to both data and smoothed data before division (default: 3.*stddev(data)). retsmooth: Return the smoothed version of the data in a tuple. retdisc: Return the discriminator image in a tuple. OUTPUTS: This function returns the outlier mask. If specified, it also returns the smoothed and/or discriminator images in a tuple, in that order. RESTRICTIONS: The edges are (necessarily) not well filtered. PROCEDURE: The function boxcar-smooths data and divides the original data by the smooth version, with a constant boost added to both data and the smoothed data (this prevents frequent division by small numbers in the background of an image). This discriminator image is thus: (data + boost) / (imsmooth + boost) Pixels higher in the discriminator than highlev or lower than -lowlev are outliers. The pixels in the returned mask image that correspond to the outliers are set to zero. A mask is a byte array the same shape as data, with values 1=good pixel and 0=bad pixel. EXAMPLE:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2009 for the course AST 4762 taught by Professor Harrington during the Fall '09 term at University of Central Florida.

Page1 / 4

maskboxlev - def maskboxlev(data, halfwidth=2., lowlev=2,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online