def __init__(self, detector, t_range, num_intervals, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Factory function to provide to _init_core def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Set up the initial state and parameter list dat = self._init_core(detector, parameter_type) self._d_at_t = matrix.sqr(detector[0].get_d_matrix()) # set up the base class ScanVaryingModelParameterisation.__init__( self, detector, dat["istate"], dat["p_list"], smoother, experiment_ids=experiment_ids, ) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan-varying unit cell parameterisation is the # reciprocal space orthogonalisation matrix '[B](t)', expressed as a # function of image number 't' in a sequential scan. # Other comments from CrystalUnitCellParameterisation are relevant here # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state istate = None self._B_at_t = crystal.get_B() # Factory function to provide to _build_p_list def parameter_type(value, name): return ScanVaryingParameterSet(value, nv, name=name) # Build the parameter list p_list = self._build_p_list(crystal, parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan-varying unit cell parameterisation is the # reciprocal space orthogonalisation matrix '[B](t)', expressed as a # function of image number 't' in a sequential scan. # Other comments from CrystalUnitCellParameterisation are relevant here # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state istate = None self._B_at_t = crystal.get_B() # Factory function to provide to _build_p_list def parameter_type(value, name): return ScanVaryingParameterSet(value, nv, name=name) # Build the parameter list p_list = self._build_p_list(crystal, parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids ) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=[0]): # The state of a scan-varying unit cell parameterisation is the # reciprocal space orthogonalisation matrix '[B](t)', expressed as a # function of image number 't' in a sequential scan. # Other comments from CrystalUnitCellParameterisation are relevant here # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() ### Set up the initial state istate = None ### Set up symmetrizing object self._S = symmetrize_reduce_enlarge(crystal.get_space_group()) self._S.set_orientation(orientation=crystal.get_B()) X = self._S.forward_independent_parameters() dB_dp = self._S.forward_gradients() B = self._S.backward_orientation(independent=X).reciprocal_matrix() ### Set up the independent parameters, with a change of scale p_list = [ScanVaryingParameterSet(e * 1.e5, nv, name = "g_param_%d" % i) \ for i, e in enumerate(X)] # Set up the base class ScanVaryingModelParameterisation.__init__(self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, beam, t_range, num_intervals, goniometer=None, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan varying beam parameterisation is a vector # '[s0](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the beam unit direction # at the point of initialisation '[s0dir]', which is independent of # image number. # # Future states are composed by rotations around axes orthogonal to the # initial direction and scaling by the wavenumber. # # [s0](t) = nu(t) * [Mu2](t)[Mu1](t)[s0dir] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state s0 = matrix.col(beam.get_s0()) s0dir = matrix.col(beam.get_unit_s0()) istate = s0dir self._s0_at_t = s0 # Factory function to provide to _build_p_list def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Build the parameter list p_list = self._build_p_list(s0, goniometer, parameter_type=parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, beam, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, goniometer, t_range, num_intervals, beam=None, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan varying goniometer parameterisation is a matrix # '[S](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the setting matrix # at the point of initialisation '[S0]', which is independent of # image number. # # Future states are composed by rotations around two axes orthogonal to the # initial spindle axis direction. # # [S](t) = [G2](t)[G1](t)[S0] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state e_lab = matrix.col(goniometer.get_rotation_axis()) istate = matrix.sqr(goniometer.get_setting_rotation()) self._S_at_t = istate # Factory function to provide to _build_p_list def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Build the parameter list p_list = self._build_p_list(e_lab, beam, parameter_type=parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, goniometer, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan varying crystal orientation parameterisation # is an orientation # matrix '[U](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the crystal orientation # at the point of initialisation '[U0]', which is independent of # image number. # # Future states are composed by # rotations around axes of the phi-axis frame by Tait-Bryan angles. # # [U](t) = [Phi3](t)[Phi2](t)[Phi1](t)[U0] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state istate = matrix.sqr(crystal.get_U()) self._U_at_t = istate # Factory function to provide to _build_p_list def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Build the parameter list p_list = self._build_p_list(parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, beam, t_range, num_intervals, goniometer=None, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan varying beam parameterisation is a vector # '[s0](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the beam unit direction # at the point of initialisation '[s0dir]', which is independent of # image number. # # Future states are composed by rotations around axes orthogonal to the # initial direction and scaling by the wavenumber. # # [s0](t) = nu(t) * [Mu2](t)[Mu1](t)[s0dir] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state s0 = matrix.col(beam.get_s0()) s0dir = matrix.col(beam.get_unit_s0()) istate = s0dir self._s0_at_t = s0 # Factory function to provide to _build_p_list def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Build the parameter list p_list = self._build_p_list(s0, goniometer, parameter_type=parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__(self, beam, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=[0]): # The state of a scan varying crystal orientation parameterisation # is an orientation # matrix '[U](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the crystal orientation # at the point of initialisation '[U0]', which is independent of # image number. # # Future states are composed by # rotations around axes of the phi-axis frame by Tait-Bryan angles. # # [U](t) = [Phi3](t)[Phi2](t)[Phi1](t)[U0] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state istate = crystal.get_U() # Set up the parameters phi1 = ScanVaryingParameterSet(0.0, nv, matrix.col((1., 0., 0.)), 'angle (mrad)', 'Phi1') phi2 = ScanVaryingParameterSet(0.0, nv, matrix.col((0., 1., 0.)), 'angle (mrad)', 'Phi2') phi3 = ScanVaryingParameterSet(0.0, nv, matrix.col((0., 0., 1.)), 'angle (mrad)', 'Phi3') # Build the list of parameter sets in a specific, maintained order p_list = [phi1, phi2, phi3] # Set up the base class ScanVaryingModelParameterisation.__init__(self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids) return
def __init__(self, crystal, t_range, num_intervals, experiment_ids=None): if experiment_ids is None: experiment_ids = [0] # The state of a scan varying crystal orientation parameterisation # is an orientation # matrix '[U](t)', expressed as a function of image number 't' # in a sequential scan. # # The initial state is a snapshot of the crystal orientation # at the point of initialisation '[U0]', which is independent of # image number. # # Future states are composed by # rotations around axes of the phi-axis frame by Tait-Bryan angles. # # [U](t) = [Phi3](t)[Phi2](t)[Phi1](t)[U0] # Set up the smoother smoother = GaussianSmoother(t_range, num_intervals) nv = smoother.num_values() # Set up the initial state istate = crystal.get_U() self._U_at_t = istate # Factory function to provide to _build_p_list def parameter_type(value, axis, ptype, name): return ScanVaryingParameterSet(value, nv, axis, ptype, name) # Build the parameter list p_list = self._build_p_list(parameter_type) # Set up the base class ScanVaryingModelParameterisation.__init__( self, crystal, istate, p_list, smoother, experiment_ids=experiment_ids ) return