View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

APFLATTEN: How is cleanning done?

Frank Valdes wrote on Sep 21, 1998

Q:  Hello.  I have a question about the clean parameter in apflatten.  It claims
that it detects and replaces bad pixels.  Does it do this just when determining
the profile in the spatial direction?  What does it replace bad pixels with?
I often have a group of pixels that (because of dust or something) have
lower QE.  If I run apflatten on my flats, the low values drag the profile
down, so the surrounding pixels, which are perfectly normal, show up as having
extremely good QE.  Setting clean to "yes" apparently solves this problem,
but since this is a flatfield, I don't want any real "cleaning", I just
want the profile-fitter to ignore deviant pixels so it finds the correct
profile and doesn't mistake bad pixels for a warped profile.  Thanks
very much,


A:  APFLATTEN models the profiles and then divides the model into the data
to remove the spectrum profiles and leave only the pixel response.  The
data that is divided by the model is not altered by cleaning.  The
cleaning only applies to the model.  The modeling consists of two
steps, determining the normalized profile (the amplitude of the profile
is constant after dividing by the spectral pattern).  Where cleaning
comes in is when determining the 1D spectrum to multiply into the
normalized profile to get the final model spectrum for dividing into
the data.  The pixels identified as deviant are excluded when summing
across the profile with the profile used as weights and the profile
weights correct for the missing point.  A mathematically equivalent
statment is that the normalized profile at a particular wavelength
point is fit to the data excluding statistically deviant points and the
final 1D spectrum value is the integral of the profile fit to the data.

Last post on Sep 21, 1998