Reflection List
The 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
Reflection IO 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
-
class iplt.ReflectionList((object)arg1)
-
AddBatch((ReflectionList)self, (int)batch_id, (Lattice)lattice) → None
-
AddProperty((ReflectionList)self, (str)prop[, (PropertyType)type=iplt._iplt_base.PropertyType.PT_REAL[, (float)default_value=0]]) → int
-
AddProxyter((ReflectionList)self, (ReflectionProxyter)rp) → ReflectionProxyter
-
AddReflection((ReflectionList)self, (ReflectionIndex)idx[, (int)batch_id=iplt._iplt_base.BATCH_ID.BATCH_ID_DEFAULT]) → ReflectionProxyter
AddReflection( (ReflectionList)self, (ReflectionIndex)idx, (ReflectionProxyter)rp) -> ReflectionProxyter
-
Apply((ReflectionList)self, (ReflectionNonModAlgorithm)alg) → None
Apply( (ReflectionList)self, (ReflectionModIPAlgorithm)alg) -> ReflectionList
Apply( (ReflectionList)self, (ReflectionConstModIPAlgorithm)alg) -> ReflectionList
Apply( (ReflectionList)self, (ReflectionModOPAlgorithm)alg) -> ReflectionList
Apply( (ReflectionList)self, (ReflectionConstModOPAlgorithm)alg) -> ReflectionList
-
ApplyIP((ReflectionList)self, (ReflectionNonModAlgorithm)alg) → None
ApplyIP( (ReflectionList)self, (ReflectionModIPAlgorithm)alg) -> None
ApplyIP( (ReflectionList)self, (ReflectionConstModIPAlgorithm)alg) -> None
ApplyIP( (ReflectionList)self, (ReflectionModOPAlgorithm)alg) -> None
ApplyIP( (ReflectionList)self, (ReflectionConstModOPAlgorithm)alg) -> None
-
Begin((ReflectionList)self) → ReflectionProxyter
-
ClearReflections((ReflectionList)self) → None
-
CopyProperties((ReflectionList)self, (ReflectionList)rlist) → None
-
CopyProxyter((ReflectionList)self, (ReflectionProxyter)rp) → ReflectionProxyter
-
DeleteProperty((ReflectionList)self, (str)prop) → None
-
Dump((ReflectionList)self) → str
-
DumpFormatted((ReflectionList)self) → str
-
Find((ReflectionList)self, (ReflectionIndex)idx) → ReflectionProxyter
-
FindFirst((ReflectionList)self, (Point)hk) → ReflectionProxyter
-
GetBatchIds((ReflectionList)self) → IntList
-
GetLattice((ReflectionList)self[, (int)batch_id=iplt._iplt_base.BATCH_ID.BATCH_ID_DEFAULT]) → Lattice
-
GetNumBatches((ReflectionList)self) → int
-
GetPropertyCount((ReflectionList)self) → int
-
GetPropertyIndex((ReflectionList)self, (str)prop) → int
-
GetPropertyName((ReflectionList)self, (int)idx) → str
-
GetPropertyNameByType((ReflectionList)self, (PropertyType)type) → str
-
GetPropertyType((ReflectionList)self, (str)prop) → PropertyType
GetPropertyType( (ReflectionList)self, (int)idx) -> PropertyType
-
GetResolution((ReflectionList)self, (ReflectionIndex)idx) → float
-
GetSymmetry((ReflectionList)self) → Symmetry
-
GetUnitCell((ReflectionList)self) → SpatialUnitCell
-
HasProperty((ReflectionList)self, (str)prop) → bool
-
HasPropertyType((ReflectionList)self, (PropertyType)type) → bool
-
Merge((ReflectionList)self, (ReflectionList)rlist) → None
-
NumReflections((ReflectionList)self) → int
-
RemoveBatch((ReflectionList)self, (int)batch_id) → None
-
RenameProperty((ReflectionList)self, (str)from, (str)to) → None
-
SetActiveBatch((ReflectionList)self, (int)batch_id) → int
-
SetLattice((ReflectionList)self, (Lattice)lattice[, (int)batch_id=iplt._iplt_base.BATCH_ID.BATCH_ID_DEFAULT]) → None
-
SetPropertyType((ReflectionList)self, (str)prop, (PropertyType)type) → None
-
SetSymmetry((ReflectionList)self, (str)sym) → None
SetSymmetry( (ReflectionList)self, (Symmetry)sym) -> None
-
SetUnitCell((ReflectionList)self, (SpatialUnitCell)unitcell) → None
-
__init__((object)arg1) → None
__init__( (object)self, (ReflectionList)rlist [, (bool)copy=True]) -> None
__init__( (object)self, (int)batch_id, (Lattice)lattice) -> None
__init__( (object)self, (SpatialUnitCell)spatial_unitcell) -> None
__init__( (object)self, (SpatialUnitCell)spatial_unitcell, (int)batch_id, (Lattice)lattice) -> None
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")