FunctionTime

class nexus.FunctionTime(FunctionTime self, std::string const id)

Abstract class for FunctionTime. Do not use this class directly. A FunctionTime implementation must be derived from this class in Python the following way.

Added in version 1.0.4.

# definition of the derived class
class FunctionTimeDefinedInPython(nx.FunctionTime):
    def __init__(self, id = "my function of time implementation", ...):
        super().__init__(id)
        ...

    # implementation of the actual function of time
    def FunctionTimeFunction(self, time):      # time in ns
        ...
        dependent_variable = f(time)
        return dependent_variable


    # since version 2.0.0
    def HyperfineTime(self, hyperfine, time):  # time in ns
        # Copy if you want to keep the input hyperfine parameters unchanged, otherwise work with the input directly
                                        hyperfine_time = hyperfine.Copy()
        ...
                                        return hyperfine # or hyperfine_time
Parameters:

id (string) – User identifier.

id

User identifier.

Type:

string

fit_variables

List of nx.Var objects.

Type:

list

CreateDetuning(max_detuning, num_points)

Compute a detuning grid needed for energy based calculations. The detuning grid is created almost symmetrically in the range

\[-max\_detuning, -max\_detuning + step, ..., max\_detuning - step\]

where \(step = 2 \frac{max\_detuning}{num\_points}\).

Parameters:
  • float – maximum detuning in units of \(\Gamma\).

  • int – number of points, must be even.

Returns:

The detuning grid in units of \(\Gamma\).

Return type:

ndarray

Function(time)

Call the function implementation.

This function is intended to return a value depending on a time.

The actual implementation is done in a derived class in python. This function is used for sample motions along the beam direction.

Args:

time (float): time in nanoseconds.

Returns:

float: Dependent variable.

HyperfineTime(hyperfine, time)

Call the function implementation for time-dependent hyperfine parameters.

Warning

The function is only allowed to alter isomer, magnetic and quadrupole parameters, but not the weight, texture, Lamb-Moessbauer factor or broadening parameters. These parameters will not be taken into account.

Warning

The isotropic and texture parameter is not used in time dependent calculations. Always a directed hyperfine site is assumed.

Added in version 2.0.0.

Args:
hyperfine (BareHyperfine): BareHyperfine object to be changed or used as initial parameters without change of the object.

There several ways to define the time dependence of the hyperfine parameters and the behavior of the input hyperfine object:

The returned hyperfine parameters can be dependent on the input hyperfine parameters or not.
  1. The returned hyperfine parameters are explicitly set at the time points by a function. This will not work for parameters where you have set a distribution because they will all collapse to the same value.

  2. The returned hyperfine parameters are calculated by relative changes to the input parameters. This is the preferred way for time dependent parameters of a distribution.

When you want to use this function from Python use hyperfine.Copy() as the input.

time (float): time in nanoseconds.

Returns:

BareHyperfine: BareHyperfine object at the given time.

property fit_variables

std::vector<(p.Var,std::allocator<(p.Var)>)>

Type:

fit_variables

property id

std::string

Type:

id

Examples can be found in the Tutorial section.