| Module: proposer | strategy/proposer.py | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Scan proposers for strategy generation. Introduction to the strategy modulesThere are three functions of a data collection strategy that can be clearly separated.
For all three a class-hierarchy is present in the library. To make a complete data collection strategy, one target object, one limit object and one proposition object must be combined. For non-data collection strategies currently a different concept is being used, consisting of only one class hierarchy of "strategies". This might change any moment. However, these classes are not so important for further development, because they are only present for GUI use and normal scripting applications will do fine without them. Usage ExampleThis is a piece of code from the strategy code in the "Collect" GUI: # Build limiter from strategy import limit lim=limit.CompositeLimit() lim.Add(limit.HardwareLimit(self.experiment.hardware)) if self.experiment.efficlimit: lim.Add(limit.EfficiencyLimit(thetamax=self.experiment.dataset.ThetaMax())) if self.experiment.lowtemplimit: lim.Add(limit.CoolerLimit()) if self.experiment.longaxislimit: vec=self.experiment.cell.ShortestReciprocalLatticeVector() lim.Add(limit.VectorAvoid(vec)) # Build target function from strategy import target if self.experiment.redundancy<1.0: tar=target.RedundantTarget(dataset=self.experiment.dataset, completeness=self.experiment.completeness, limiter=lim,redundancy=self.experiment.redundancy) else: tar=target.OnceTarget(dataset=self.experiment.dataset, completeness=self.experiment.completeness, limiter=lim) # pro=self.experiment.strategytype( target=tar, hardware=self.experiment.hardware, cell=self.experiment.cell, dx=self.experiment.dx) pro.Calculate() return pro.ScanSet() Variables defined by the proposer module. a single variable For this purpose, each proposer class has a 1-line doc-string that uniquely describes its functionality.
|