comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: REGRESS and sky background

REGRESS and sky background
type: item
description: Hi all, I'm baffled with how one of my programs is acting, and would love some insight, if there is any to be had. The routine is designed to fit the sky background image (in my case, a 128x128 subdivision of a larger astronomical image) to a plane (Ax+By +C) using REGRESS. My subdivisions are small enough that I think a plane is a pretty good approximation; the idea is to do a 3.5-sigma mean clip to remove sources, then regress the sky pixels to a plane and subtract the plane, and iterate until the fitted plane reaches 0. The problem is that it seems the slope of the background increases with increasing iterations, which it theoretically should not do. Here's my general algorithm; I actually use a different mean clipping routine, but astrolib's MEANCLIP gives the same (unwanted) results. Take a look and tell me what you think. Thanks! --Gray FUNCTION find_skybg, image, sigma img = image s = size(img,/dim) lx = rebin(indgen(s[0]),s[0],s[1]) ;x and y coordinates ly = rebin(indgen(1,s[1]),s[0],s[1]) ;to construct bg plane abc = fltarr(3) iter = 0 repeat begin meanclip, img, m, subs=clips, clipsig=3.5 ;don't care about mean, just clips xy = array_indices(s,clips,/dim) ab = reform(regress(xy,img[clips],const=c)) sigma = stddev(img[clips]) abc += [ab,c] bg = ab[0]*lx+ab[1]*ly+c img -= bg iter++ endrep until (iter ge 10 or total([ab,c]/abc le 0.02) eq 3) background = abc[0]*lx+abc[1]*ly+abc[2] return, background endfor
creator: Gray
date: 2010-07-06T00:06:55-00:00