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

Module nic_rem_persist

source code


Version: 1.6 (2009 Mar 26)

Classes [hide private]
  NicRemPersist
Remove bright earth persistence persistence from CAL file of NICMOS data (on which pedsub has been run) using a medianed persistence model, based on correction calculated from PED file.
Functions [hide private]
 
check_py_pars(self, calcfile, targfile, persist_lo, used_lo, persist_model, persist_mask)
When run under python, check validity of input parameters.
source code
float, float
check_cl_pars(calcfile, targfile, persist_lo, used_lo)
When run from linux command line, verify that each parameter is valid.
source code
 
make_footprint(rin, rout)
Make an annular mask footprint for use in ndimage.median_filter to create a ring median image.
source code
 
iterstatc(clip, d)
version of nicmos iterstat: calculate sigma-clipped mean and standart deviation
source code
float
median(y, mask)
Return the median of the array y, ignoring masked elements.
source code
Variables [hide private]
  _success = 0
  _none = 1
  _error = 2
  _abort = 3
  ERROR_RETURN = -2
  CLIP = 4
  __package__ = 'nictools'

Imports: pyfits, N, sys, time, opusutil, persutil, string, ndimage


Function Details [hide private]

check_py_pars(self, calcfile, targfile, persist_lo, used_lo, persist_model, persist_mask)

source code 
When run under python, check validity of input parameters. For unspecified *_lo parameters, the
    user will be given the option of typing in a value or accepting the default value. For an unspecified
    model(mask) file, will try to get file name from PMODFILE(PMSKFILE) from input file header, otherwise
    will get default value from persutil.           

@param calcfile: name of PED file
@type calcfile: string
@param targfile: name of CAL file
@type targfile: string
@param persist_lo: minimum allowed value of the persistence 
@type persist_lo: Float32
@param used_lo: minimum allowed value of the fraction of pixels used 
@type used_lo: Float32
@param persist_model: filename containing persistence frame (ring median of)
@type persist_model:  string
@param persist_mask: filename containing pixel mask 
@type persist_mask:  string

@return: persist_lo, used_lo, persist_model, persist_mask
@rtype: float, float, string, string

check_cl_pars(calcfile, targfile, persist_lo, used_lo)

source code 

When run from linux command line, verify that each parameter is valid.

Parameters:
  • calcfile (string) - name of ped file
  • targfile (string) - name of cal file
  • persist_lo (Float32) - minimum allowed value of the persistence
  • used_lo (Float32) - minimum allowed value of the fraction of pixels used
Returns: float, float
persist_lo, used_lo

make_footprint(rin, rout)

source code 
Make an annular mask footprint for use in ndimage.median_filter to create a ring median image.
    Sets all pixels between rin and rout to 1.

@param rin: inner radius
@type rin: integer
@param rout: outer radius
@type rout: integer

@return: mask
@rtype: ndarray

iterstatc(clip, d)

source code 
version of nicmos iterstat: calculate sigma-clipped mean
     and standart deviation

@param clip: number of std to use in sigma clipping  
@type clip:  Float32
@param d: array of values to sigma clip
@type clip:  Float32

@return:  clipped mean, clipped std
@rtype:  float, float    

median(y, mask)

source code 

Return the median of the array y, ignoring masked elements.

Parameters:
  • y (Float32) - array of values [2d]
  • mask (Int32) - array of ones or zeros (0 indicates a good value) [2d]
Returns: float
median of y, ignoring masked elements