Top class for all classes representing a scan.
|
Methods
|
|
|
|
|
AutoDark
|
AutoDark (
self,
scanparams,
outsink=None,
)
Perform the auto-dark images.
This will not re-determine the image if it exists with identical
hardware settings.
Internal use.
parameters:
- scanparams
an object of the ScanParams class, used
to determine frame width and frame time
to be used.
- outsink
file-like object where communication with the
hardware is to be logged.
|
|
|
ExpectedRunTime
|
ExpectedRunTime ( self, scanparams )
Part of the Operation() protocol. How long will this take? |
|
|
FindPositions
|
FindPositions ( self, dataset )
Find the angles of the scan at which the reflections given would be in diffraction.
This routine can be used to find the images of axes in the
diffraction image. Preventing the visibility of axes in the
initial phi-scan is one of the efficiency measures in the
strategy determination.
parameters:
- dataset
a Dataset() of pseudo-reflections (indices are
float <<1)
Return value: an array of positions at which a reflection from the
dataset was found to go through the Ewald sphere. |
|
|
ImageTime
|
ImageTime ( self, scanparams )
Return the time that will be used for a single image. |
|
|
MakeScan
|
MakeScan (
self,
scanparams,
outsink=None,
)
Perform the scan itself.
This will not re-determine images at the beginning of the scan if
they exist with identical hardware settings.
Internal use.
parameters:
- scanparams
an object of the ScanParams class, used
to determine frame width and frame time
to be used.
- outsink
file-like object where communication with the
hardware is to be logged.
|
|
|
NumImages
|
NumImages ( self, scanparams )
Return the total number of images that will be made by this scan.
That includes the dark image (if any). |
|
|
Perform
|
Perform (
self,
scanparams,
outsink=None,
)
Perform the scan and any autodark images on the hardware.
parameters:
- scanparams
an object of the ScanParams class, used
to determine frame width and frame time
to be used.
- outsink
file-like object where communication with the
hardware is to be logged.
|
|
|
RedundantSimulate
|
RedundantSimulate ( self, dataset )
Simulate scan on unique dataset, counting how often each reflection is measured.
parameters:
- dataset
a dataset of unique reflections to be found
Return value: a unique RedundantDataSet object containing those
reflections from the input set that were visible on the detector
during the scan. Symmetry of the dataset is taken into account. |
|
|
ScanImages
|
ScanImages ( self, scanparams )
Return the numbrt of images in the scan.
This does not include any dark image. |
|
|
ScanLength
|
ScanLength ( self )
Part of the Operation() protocol.
Calculate the length of the scan (in radians) |
|
|
Simulate
|
Simulate ( self, dataset )
Simulate scan on unique dataset.
parameters:
- dataset
a Dataset() of unique reflections to be found
return value: a unique DataSet object containing those reflections
from the input set that were visible on the detector during the
scan. Symmetry of the dataset is taken into account.
This top-class version can handle any kind of scan using the
Ewald construction, but it is not very accurate except when using
very small steps. Sub-classes overwrite this method to make it
more accurate and faster but more specialized. |
|
|
Simulate_Expanded
|
Simulate_Expanded ( self, dataset )
Simulate scan on unique dataset.
parameters:
- dataset
an complete dataset of reflections to be found without applying
symmetry of the diffraction pattern.
Return value: a bit-vector with the length of the input dataset. In
this bit vector, a "1" means that the reflection is visible in the
scan, "0" means not visible. |
|
|
Storable
|
Storable ( self )
Return the scan in a form that can be pickled.
Returns a dictionary that contains all necessary information
to reconstruct the scan, except for the non-picklable hardware
reference. |
|
|
Widget
|
Widget ( self, parent )
Return an editor window.
Allow the user to edit all parameters associated with the scan.
parameters:
- parent
the parent Tk widget.
|
|
|
With
|
With ( self, **kw )
Return a modified copy of the scan.
The original stays intact as if it were an immutable.
possible arguments:
- p0
set the starting position.
- p1
set the ending position.
- frametime
set a new frame time (a modifyvariable!)
- frameangle
set a new frame angle (a modifyvariable!)
|
|
|
__getitem__
|
__getitem__ ( self, i )
Return the position corresponding to the i-th simulation step. |
|
|
__init__
|
__init__ (
self,
p0,
p1,
anglemargin=config.anglemargin * projtls.degrees,
detectorsizemargin=config.detectorsizemargin,
step=None,
forcenframes=None,
frameangle=None,
frametime=None,
)
Constructor.
parameters:
- p0
starting position of the scan
p1 -- ending position of the scan
optional parameters:
- anglemargin
simulation uses the range start+anglemargin through
end-anglemargin to predict data. This is to account
for reflection size (prevent incomplete partials).
Suggested value: 1--3 degrees.
- detectorsizemargin
Simulation makes detector smaller by
detectorsizemargin to prevent reflections from
falling of the edge
step -- step size for simulation. If omitted it will be set
to a value close to 10 degrees that fills up the
complete scan range. This is only used if the scan
is not a rotation that can be predicted using
AJMD Impact() calculations.
forcenframes -- Force the number of frames of the hardware
SCAN Default is to follow the scan parameters
coming in, possibly modified by a local
scanangle. Specifying forcenframes overwrites
all those.
frameangle -- A modifyvariable for the frame angle specified
in the scan parameters. Can have three forms::
None (default) : just follow the scanparams
(replace,value) : replace scanparams by
different value.
(multiply,value) : multiply scanparams by
specified value.
frametime -- A modifyvariable for the frame time specified
in the scan parameters.
|
Exceptions
|
|
error( "Cannot use forcenframes for still image" ) error( "Cannot use forcenframes if frameangle specified" ) error( "Wrong scan parameters" )
|
|
|
|
__repr__
|
__repr__ ( self )
A total string representation of the scan. |
|
|
allowed
|
allowed ( self )
Check whether the scan can be performed on the hardware. |
|
|
copy
|
copy ( self )
Make a copy of the scan. |
|
|
frameanglerepr
|
frameanglerepr ( self )
A zero or one-line string showing the frameangle modifier |
|
|
frametimerepr
|
frametimerepr ( self )
A zero or one-line string showing the frametime modifier |
|
|
modrepr
|
modrepr ( self )
A string representing the variable modifiers |
|
|
realstartposition
|
realstartposition ( self, offset=0.0 )
Return a position that corresponds to the start of the scan
optional parameters:
- offset
the rotational offset (in radians) along the
fastest rotating axis.
|