Changeset 3015
- Timestamp:
- Aug 18, 2017 9:14:43 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIscriptable.py
r3012 r3015 937 937 938 938 def do_refinements(self, refinements, histogram='all', phase='all', 939 outputnames=None): 940 """Conducts a series of refinements. 939 outputnames=None, makeBack=False): 940 """Conducts a series of refinements. Wrapper around iter_refinements 941 942 :param list refinements: A list of dictionaries defining refinements 943 :param str histogram: Name of histogram for refinements to be applied 944 to, or 'all' 945 :param str phase: Name of phase for refinements to be applied to, or 946 'all' 947 """ 948 for proj in self.iter_refinements(refinements, histogram, phase, 949 outputnames, makeBack): 950 pass 951 return self 952 953 def iter_refinements(self, refinements, histogram='all', phase='all', 954 outputnames=None, makeBack=False): 955 """Conducts a series of refinements, iteratively. Stops after every 956 refinement and yields this project, to allow error checking or 957 logging of intermediate results. 958 959 >>> def checked_refinements(proj): 960 ... for p in proj.iter_refinements(refs): 961 ... # Track intermediate results 962 ... log(p.histogram('0').residuals) 963 ... log(p.phase('0').get_cell()) 964 ... # Check if parameter diverged, nonsense answer, or whatever 965 ... if is_something_wrong(p): 966 ... raise Exception("I need a human!") 941 967 942 968 :param list refinements: A list of dictionaries defining refinements … … 964 990 self.save(output) 965 991 966 self.refine() # newFile=output) 992 self.refine(makeBack=makeBack) 993 yield self 967 994 968 995 # Handle 'once' args - refinements that are disabled after this … … 1239 1266 for key in ['R', 'Rb', 'wR', 'wRb', 'wRmin']} 1240 1267 1268 # TODO Figure out G2obj.HistRanIdLookup reload 1241 1269 @property 1242 1270 def id(self):
Note: See TracChangeset
for help on using the changeset viewer.