Ignore:
Timestamp:
Sep 28, 2020 1:23:10 PM (13 months ago)
Author:
toby
Message:

docs for freezing parameters started + docs cleanup; start scriptable for freezing params; record initial chi2; Show more post refinement info; noted but unfixed bkg GUI bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIscriptable.py

    r4551 r4578  
    33603360            raise Exception('{} is an invalid control value'.format(control))
    33613361       
    3362     def set_Controls(self, control, value):
     3362    def set_Controls(self, control, value, variable=None):
    33633363        '''Set project controls
    33643364
    33653365        :param str control: the item to be set. See below for allowed values.
    33663366        :param value: the value to be set.
     3367        :param str variable: used only with control set to "parmMin" or "parmMax"
    33673368
    33683369        Allowed values for parameter control:
     
    33783379            * Reverse Seq: when True, sequential refinement is performed on the
    33793380              reversed list of histograms.
     3381            * parmMin & parmMax: set a maximum or minimum value for a refined
     3382              parameter. Note that variable will be a GSAS-II variable name,
     3383              optionally with * specified for a histogram or atom number and
     3384              value must be a float.
     3385              (See :ref:`Parameter Limits<ParameterLimits>` description.)
    33803386
    33813387        .. seealso::
    33823388            :meth:`get_Controls`
    33833389        '''
     3390        if control.startswith('parmM'):
     3391            if not variable:
     3392                raise Exception('set_Controls requires a value for variable for control=parmMin or parmMax')
     3393            for key in ('parmMinDict','parmMaxDict','parmFrozen'):
     3394                if key not in self.data['Controls']['data']: self.data['Controls']['data'][key] = {}
    33843395        if control == 'cycles':
    33853396            self.data['Controls']['data']['max cyc'] = int(value)
     
    33983409                                        .format(i,j))
    33993410            self.data['Controls']['data']['Seq Data'] = histlist
     3411        elif control == 'parmMin' or control == 'parmMax':
     3412            self.data['Controls']['data'][control+'Dict'][variable] = float(value)
    34003413        else:
    34013414            raise Exception('{} is an invalid control value'.format(control))
Note: See TracChangeset for help on using the changeset viewer.