Table of Contents

Class: Operation goniometer/operations.py

Top-class for all non-scan operations.

All operations define a number of common methods that are used to "perform" the operation without knowing what it is. Some of these have a default implementation in the "Operator" superclass.

Some other methods must be implemented in each subclass:

Constructor

The arguments are very dependent of the actual operation, but most will need a "hardware" object on which the operation is to be performed.

Perform(scanparams)

Actually performs the operation.

Widget(master)

Will create an "editor" widget such that the user can change the parameters of the operation in a GUI.

Storable()

Returns a dictionary of all settings of the operation. This will be used to save the operation to disk, so it should be possible to recognize the type of operation from this dictionary. The original operation can be reconstructed by passing the result of this method call as the second argument of the OperationFromStorage(hardware,s) function.

__repr__()

Returns a simple (one-line?) string describing what the operation will do.

Methods   
ExpectedRunTime
ImageTime
NumImages
ScanImages
ScanLength
copy
  ExpectedRunTime 
ExpectedRunTime ( self,  scanparams )

Returns the time this operation is expected to take.

Returns 2 time values, giving the expected time the operation will take to be performed.

  • The first value is the number of seconds that will be taken irrespective of the "frame time" given in the scan parameters * if there is a frametime in the scanparams, the second value is the number of seconds the operation will take for each second of "frame time", i.e. the equivalent number of frames taken. * if there is a degreetime in the scanparams, the second value is the number of seconds the operation will take for each second of degreetime, i.e. the equivalent number of degrees scan length.

The default implementation will return 3,0 if self.NumImages() is zero, and some reasonable guess otherwise.

  ImageTime 
ImageTime ( self,  scanparams )

Returns the time per image based on the scanparams.

Default implementation returns 0.

  NumImages 
NumImages ( self,  scanparams )

Returns the number of images in the operation.

The default implementation returns the same as ScanImages()

  ScanImages 
ScanImages ( self,  scanparams )

Returns the number of scan-images in the operation.

  ScanLength 
ScanLength ( self,  scanparams=None )

Returns the total length of the scan in radians.

Since operations do not normally make any scan at all, this default implementation returns 0.

  copy 
copy ( self )

Returns a copy of the operation.


Table of Contents

This document was automatically generated on Fri Jul 3 09:28:36 2009 by HappyDoc version WORKING