Reflection List
The ex::ReflectionList class encapsulates a list of reflections; each reflection is defined by a unique reflection index, and contains an arbitrary amount of (floating point) properties. These properties are defined on the level of the reflection list; as such, a reflection list can be conceptualized as a table, where the rows contain the individual reflections, and the columns the properties.
Access to the entries in the reflection list is only possible by means of a reflection proxyter, which is obtained upon iterating over an existing list. The reflections are returned in a strict order, based on their index.
A reflection list contains a lattice and a unit cell. The former is usually in (fractional) pixel dimensions, referring to the image the reflections were originally extracted from. The latter represents the unit cell of the dataset. Neither of these two is mandatory, however, the conversion from reciprocal z values (the third component in the index) to fractional l stored in the mtz file during Export uses the thickness of the spatial unit cell!
Reflection lists can be saved to disk as mtz files, see the ReflectionIO entry for more information.
Interface
Construction
- ReflectionList()
- Creates an empty reflection list with a default lattice and unit cell.
- ReflectionList(Lattice lat)
- Creates an empty reflection list with the given lattice and a default unit cell
- ReflectionList(SpatialUnitCell uc)
- Creates an empty reflection list with the given unit cell and a default lattice
- ReflectionList(Lattice lat, SpatialUnitCell uc)
- Creates an empty reflection list with the given lattice and unit cell
- ReflectionList(SpatialUnitCell uc,Lattice lat)
- see above
- ReflectionList(ReflectionList& rl, bool full_copy=True)
- Creates a new reflection list based on the given one; if the (optional) full_copy flag is False, only the skeleton will be copied, meaning the lattice, the unit cell, and the properties. The complete set of reflections will only be copied if the full_copy flag is True.
Properties
- CopyProperties(ReflectionList rl)
- Clears the list of reflections and all properties; it then creates a new set of properties from the given reflection list.
- AddProperty(string prop, PropertyType type=PT_REAL)
- Adds a new property by the name prop to the reflection list. All existing reflections will have a value of zero for this property. The second optional parameters allows a type to be assigned to the property, which mirrors the types as defined for the mtz format.
- PT_REAL
- PT_INDEX
- PT_INTENSITY
- PT_AMPLITUDE
- PT_ANOMALOUS_DIFFERENCE
- PT_STDDEV
- PT_AMPLITUDE2
- PT_STDDEVA2
- PT_INTENSITY2
- PT_STDDEVI2
- PT_NORM_AMPLITUDE
- PT_PHASE
- PT_WEIGHT
- PT_PHASE_PROB
- PT_BATCH
- PT_MISYM
- PT_INTEGER
- bool HasPropertyType(PropertyType ptype)
- Returns true if the reflection list has at least one property of the given type
- string GetPropertyNameByType(PropertyType ptype)
- Returns the name of the first property of the given type
- bool HasProperty(string prop)
- Returns true if the reflection list has a property of the given name
- RenameProperty(string from, string& to)
- Renames a property
- SetPropertyType(string prop, PropertyType type)
- Sets the property identified by its name to the given type
- PropertyType GetPropertyType(string prop)
- Returns the type of a property identified by its name
- int GetPropertyCount()
- Returns number of properties in reflection list
- int GetPropertyIndex(string name)
- Returns the internal index of the property identified by its name
- string GetPropertyName(int n)
- Returns the name of the property identified by its internal index
- PropertyType GetPropertyType(int n)
- Returns the type of the property identified by its internal index
- stringlist GetPropertyList()
- Returns all properties as a list of strings
Proxyters
Setters/Getters
Reflection Algorithms
Others
Examples
This code snippet creates the following reflection list:
| index | amp | sigamp |
| (1,3,0.132) | 23.45 | 4.54 |
| (4,7,0.237) | 17.33 | 6.13 |
import ex # create new list and add two properties rlist=ex.ReflectionList() rlist.AddProperty("amp") rlist.AddProperty("sigamp") # add reflections by means of reflection proxyters rp=rlist.AddReflection(ex.ReflectionList(2,3,0.132)) rp.Set("amp",23.45) rp.Set("sigamp",4.54) rp=rlist.AddReflection(ex.ReflectionList(4,7,0.237)) rp.Set("amp",17.33) rp.Set("sigamp",6.13) # iterate over list, again accessing the reflections via the proxyters for rp in rlist: print rp.GetIndex(),rp.Get("amp"),rp.Get("sigamp")
back to the ex module overview
