Package nictools :: Module saaclean
[hide private]
[frames] | no frames]

Module saaclean

source code


saaclean: Module for estimating and removing persistent CR signal due to a prior
          SAA passage.

Usage:    Normally used via the STSDAS task saaclean in the nicmos package.
          To use as pure python, create a params object to override any of
          the default parameters if desired, then invoke clean:
          >>> mypars=saaclean.params(thresh=0.23)
          >>> saaclean.clean('inputfile.fits','outputfile.fits',pars=mypars)

For more information:
          Additional user information, including parameter definitions and more
          examples, can be found in the help file for the STSDAS saaclean task,
          located in nicmos$doc/saaclean.hlp.

          The algorithm and IDL prototype are described in the NICMOS
          ISR 2003-009, by Bergeron and Dickinson, available through the NICMOS
          webpage.
          
Dependencies:
          numpy 1.0.2.dev3534 or higher
          pyfits v1.1b4 or higher
          imagestats v1.3 or higher


Version: 1.3

Classes [hide private]
  params
  Domain
Stores a list of pixels for a (typically high or low) signal domain
  Exposure
Stores a collection of keywords and the image data for an exposure.
  NoPersistError
  BadThreshError
  NegScaleError
  InsuffImprovement
  AlreadyDone
Functions [hide private]
 
osfn(filename)
Return a filename with iraf syntax and os environment names substituted out
source code
 
writeimage(image, filename, comment=None, clobber=False) source code
 
median(a) source code
 
parabola_model(coeffs, t) source code
 
parabola_min(thedata, startguess) source code
 
gausspoly_eval(coeffs, t) source code
 
gausspoly_model(coeffs, t) source code
 
gausspoly_fit(thedata, guesscoeff) source code
 
thresh_from_gausspoly_fit(saa, parbinwidth=0.5, nclip=3, diagfile=None, clobber=False)
Some massaging of the SAApersistence image histogram is performed in order to obtain an optimal fit.
source code
 
get_postsaa_darks(imgfile)
Return the filenames containing the post-saa dark exposures, if present.
source code
 
getdark(camera, tdkfile, darkpath)
Get the right dark file for a given NICMOS camera.
source code
 
make_saaper(im1, im2, dark, pars, crthresh=1) source code
 
get_dark_data(imgfile, darkpath) source code
 
flat_saaper(saaper, img) source code
 
smartopen(fname, mode, clobber=True)
Allows specifying a clobber behavior
source code
 
clean(usr_calcfile, usr_targfile, usr_outfile, pars=None) source code
Variables [hide private]
  __vdate__ = '2009-12-14'
  __package__ = 'nictools'

Imports: numerixenv, os, exceptions, N, pyfits, imagestats, imstat, histogram1d, LeastSquares, LinAlgError


Function Details [hide private]

thresh_from_gausspoly_fit(saa, parbinwidth=0.5, nclip=3, diagfile=None, clobber=False)

source code 

Some massaging of the SAApersistence image histogram is performed in order to obtain an optimal fit. Unfortunately this involves some magic numbers taken from the IDL code.

get_postsaa_darks(imgfile)

source code 

Return the filenames containing the post-saa dark exposures, if present. Otherwise raise an exception and exit.

getdark(camera, tdkfile, darkpath)

source code 

Get the right dark file for a given NICMOS camera. This is definitely not the right way to do this.