Package multidrizzle :: Module mdrizpars :: Class MDrizPars
[hide private]
[frames] | no frames]

Class MDrizPars

source code


This class defines the default values for all MultiDrizzle parameters, and provides the mechanisms for updating them from any of the available interfaces: EPAR, MDRIZTAB, or directly from the Python interface.

It defines a dictionary containing all the input parameters for MultiDrizzle. The MultiDrizzle class inputs all but the three required parameters as a variable-length argument dictionary. The input parameter dictionary from MultiDrizzle then gets used to initialize this class which then updates the default values it already knows about with the values passed in upon initialization. It can perform parameter name checking in case of typos upon input, recognize the use of an MDRIZTAB and pull the values from that table, then update the master dictionary. This master dictionary would then serve as the primary attribute which would be used to set the desired attributes in the MultiDrizzle class.

A method supports resetting these values based on new inputs, such as from MDRIZTAB.

Another method supports resetting ProcStep settings, as they need to be handled differently from regular MultiDrizzle attributes since they rely on another class.

Instance Methods [hide private]
 
__init__(self, input, output, dict=None, files=None)
The input parameter 'dict' needs to be a Python dictionary of attributes whose values need to be updated.
source code
 
verifyPar(self, kw, value) source code
 
updateMasterPars(self) source code
 
updatePars(self, dict) source code
 
verifyInput(self, dict)
Verifies that all entries provided in the input dictionary correspond to keys in the master dictionary.
source code
 
setProcSteps(self, **switches)
Update the master parameter list with the step settings given in 'switches', then update the ProcStep instance 'self.steps' appropriately.
source code
 
getDrizPars(self, prefix='driz_sep', keylist=None)
Returns a dictionary of values used for the drizzle processing steps.
source code
 
getParList(self, keylist, prefix=None)
Returns a dictionary of values used for setting the parameters listed in keylist.
source code
 
_handleMdriztab(self, rec)
Collect task parameters from the MDRIZTAB record and update the master parameters list with those values
source code

Inherited from pydrizzle.traits102.traits.HasTraits: __call__, __delattr__, __getattr__, __setattr__, add_trait, clone_traits, configure_traits, defer_trait_change, edit_traits, editable_traits, get_trait, on_trait_change, reset_traits, set, sync_trait, traits

Inherited from pydrizzle.traits102.traits.HasTraits (private): _base_trait, _class_notifier, _event_notifier_for, _inherit, _init_class_list, _notifier_for, _object_notifier, _reset_trait_value, _set_event_value, _set_trait_value, _trait, _trait_names

Class Variables [hide private]
  true_boolean = Trait('true', TraitComplex(TraitPrefixMap({'tru...
  bit_editor = TraitEditorBoolean()
  enum_stat = Trait('median', TraitPrefixMap({'median': 'median'...
  enum_kernel = Trait('square', TraitPrefixMap({'square': 'squar...
  enum_wht = Trait('', TraitPrefixMap({'ERR': 'ERR', 'IVM': 'IVM...
  enum_combine = Trait('minmed', TraitPrefixMap({'median': 'medi...
  enum_interp = Trait('poly5', TraitPrefixMap({'nearest': 'neare...
  enum_finalunits = Trait('cps', TraitPrefixMap({'cps': 'cps', '...
  enum_procunit = Trait('native', TraitPrefixMap({'native': 'nat...
  text_editor = TraitEditorText()
  __traits__ = {'input': Trait('flt.fits', TraitString()), 'outp...
  __editable_traits__ = TraitGroup(TraitGroup(TraitGroup('input'...
  input_list = ['input', 'output']
  switches_list = ['static', 'skysub', 'driz_separate', 'median'...
  master_list = ['mdriztab', 'refimage', 'runfile', 'workinplace...
  clean_string_list = ['output', 'group', 'shiftfile', 'staticfi...
  attribute_list = ['switches', 'input', '_set_trait_value', '_s...
Method Details [hide private]

__init__(self, input, output, dict=None, files=None)
(Constructor)

source code 

The input parameter 'dict' needs to be a Python dictionary of attributes whose values need to be updated.

Overrides: pydrizzle.traits102.traits.HasTraits.__init__

verifyInput(self, dict)

source code 

Verifies that all entries provided in the input dictionary correspond to keys in the master dictionary.

If there are mismatches, then it will report those errant keywords and raise an Exception. This comparison will be case-insensitive, for simplicity.

getDrizPars(self, prefix='driz_sep', keylist=None)

source code 

Returns a dictionary of values used for the drizzle processing steps. The prefix defines which set of keywords from the master parameter list needs to be returned.

The member names in the output dictionary, though, will not include the specified prefix as required by PyDrizzle.

Additional keywords used for this dictionary are listed in the module parameter 'driz_keys'.

getParList(self, keylist, prefix=None)

source code 

Returns a dictionary of values used for setting the parameters listed in keylist.

If a prefix is specified, then remove that prefix from the master parameter name when creating the output dictionary.

_handleMdriztab(self, rec)

source code 

Collect task parameters from the MDRIZTAB record and update the master parameters list with those values

Note that parameters read from the MDRIZTAB record must be cleaned up in a similar way that parameters read from the user interface are.


Class Variable Details [hide private]

true_boolean

Value:
Trait('true', TraitComplex(TraitPrefixMap({'true': 1, 'yes': 1, 'false\
': 0, 'no': 0}), TraitMap({1: True, 0: False})))

enum_stat

Value:
Trait('median', TraitPrefixMap({'median': 'median', 'mode': 'mode', 'm\
ean': 'mean',}))

enum_kernel

Value:
Trait('square', TraitPrefixMap({'square': 'square', 'point': 'point', \
'gaussian': 'gaussian', 'turbo': 'turbo', 'tophat': 'tophat', 'lanczos\
3': 'lanczos3'}))

enum_wht

Value:
Trait('', TraitPrefixMap({'ERR': 'ERR', 'IVM': 'IVM', 'EXP': 'EXP'}))

enum_combine

Value:
Trait('minmed', TraitPrefixMap({'median': 'median', 'sum': 'sum', 'min\
med': 'minmed', 'minimum': 'minimum'}))

enum_interp

Value:
Trait('poly5', TraitPrefixMap({'nearest': 'nearest', 'linear': 'linear\
', 'poly3': 'poly3', 'poly5': 'poly5', 'sinc': 'sinc'}))

enum_finalunits

Value:
Trait('cps', TraitPrefixMap({'cps': 'cps', 'counts': 'counts'}))

enum_procunit

Value:
Trait('native', TraitPrefixMap({'native': 'native', 'electrons': 'elec\
trons'}))

__traits__

Value:
{'input': Trait('flt.fits', TraitString()), 'output': Trait('', TraitS\
tring()), 'mdriztab': Trait(False, true_boolean, editor= bit_editor), \
'refimage': Trait('', AnyValue), 'runfile': Trait('multidrizzle.run', \
TraitString()), 'workinplace': Trait(False, true_boolean, editor= bit_\
editor), 'updatewcs': Trait(True, true_boolean, editor= bit_editor), '\
proc_unit': Trait('native', enum_procunit, editor= text_editor), 'cont\
ext': Trait(True, true_boolean, editor= bit_editor), 'clean': Trait(Fa\
lse, true_boolean, editor= bit_editor), 'group': Trait('', AnyValue), \
...

__editable_traits__

Value:
TraitGroup(TraitGroup(TraitGroup('input', 'output', 'mdriztab', 'refim\
age', 'runfile', 'workinplace', 'context', 'clean', 'group', 'updatewc\
s', 'proc_unit', 'ra', 'dec', 'coeffs', 'build', 'shiftfile', 'staticf\
ile', 'timing', label= 'Init'), TraitGroup('static', 'static_sig', lab\
el= 'Static Mask'), TraitGroup('skysub', 'skywidth', 'skystat', 'skylo\
wer', 'skyupper', 'skyclip', 'skylsigma', 'skyusigma', 'skyuser', labe\
l= 'Sky')), TraitGroup(TraitGroup('driz_separate', 'driz_sep_outnx', '\
driz_sep_outny', 'driz_sep_kernel', 'driz_sep_wt_scl', 'driz_sep_pixfr\
...

switches_list

Value:
['static',
 'skysub',
 'driz_separate',
 'median',
 'blot',
 'driz_cr',
 'driz_combine',
 'timing']

master_list

Value:
['mdriztab',
 'refimage',
 'runfile',
 'workinplace',
 'updatewcs',
 'proc_unit',
 'context',
 'clean',
...

clean_string_list

Value:
['output',
 'group',
 'shiftfile',
 'staticfile',
 'ra',
 'dec',
 'coeffs',
 'combine_lthresh',
...

attribute_list

Value:
['switches',
 'input',
 '_set_trait_value',
 '_set_event_value',
 'steps',
 'output',
 'master_pars']