IntegratedEnergyTimeSpectrum

class nexus.IntegratedEnergyTimeSpectrum(Measurement self, Experiment experiment, std::string const id="")
class nexus.IntegratedEnergyTimeSpectrum(Measurement self, Experiment experiment, DoubleVector detuning, std::string const id="") → Measurement

Bases: FitMeasurement

Constructor for the IntegratedEnergyTimeSpectrum class. Class to calculate the energy and time-integrated [integration_start, integration_stop] resonant intensity of the experiment. One sample has to have a drive detuning.

Parameters:
  • id (string) – User identifier.

  • experiment (Experiment) – Experiment.

  • time_length (float) – Length of the calculation (nanoseconds).

  • time_step (float) – Step size of the calculation (nanoseconds).

  • integration_start (float) – Start time of the integration (nanosecond).

  • integration_stop (float) – Stop time of the integration (nanosecond).

  • mode (string) –

    Identifier for the calculation mode.

    • i - Interpolate detuning values. Fast mode.

    • f - Full calculation via change of the isomer shift. Slow mode.

  • electronic (bool) – If True electronic scattering is also included.

  • time_data (list or ndarray) – Time data for fitting.

  • intensity_data (list or ndarray) – Time integrated intensity data for fitting.

  • scaling (float or Var or string) – Intensity scaling factor for fitting. Default is auto.

  • background (float or Var or string) – Background for fitting. Default is 0.

  • energy_resolution (float or Var) –

    Energy resolution value for convolution. The energy resolution is not the energy resolution of the drive sample (e.g. an analyzer foil). This intrinsic resolution is given by the energy spectrum of drive sample. The energy resolution specified here is an additional energy resolution due to the experimental conditions, like an in proper drive motion itself.

    Removed in version 2.0.0.

  • time_resolution (float or Var) –

    Time resolution value for convolution.

    Removed in version 2.0.0.

  • distribution_points (int) – Number of points for roughness distributions in forward geometry

  • fit_weight (float) – Relative weight for the cost function in multi measurement fitting.

  • instrument (Instrument) –

    Instrument object. The InstrumentFunction2D must be implemented in python to perform the convolution in energy and time. Default is ‘’None’’.

    Added in version 2.0.0.

  • residual (Residual) – Implementation of the residual calculation used for fitting.

id

User identifier.

Type:

string

experiment

Experiment

Type:

Experiment

time_length

Length of the calculation (nanoseconds).

Type:

float

time_step

Step size of the calculation (nanoseconds).

Type:

float

integration_start

Start time of the integration (nanosecond).

Type:

float

integration_stop

Stop time of the integration (nanosecond).

Type:

float

electronic

If True electronic scattering is also included.

Type:

bool

mode

Identifier for the calculation mode.

  • i - Interpolate detuning values. Fast mode.

  • f - Full calculation via change of the isomer shift. Slow mode.

Type:

string

time_data

Time data for fitting.

Type:

list

intensity_data

Time integrated intensity data for fitting.

Type:

list or ndarray

data_size

Number of data points of experimental data.

Type:

int

scaling

Intensity scaling factor for fitting.

Type:

Var

background

Background for fitting.

Type:

Var

energy_resolution

Energy resolution value for convolution. The energy resolution is not the energy resolution of the drive sample (e.g. an analyzer foil). This intrinsic resolution is given by the energy spectrum of drive sample. The energy resolution specified here is an additional energy resolution due to the experimental conditions, like an in proper drive motion itself.

Removed in version 2.0.0.

Type:

Var

time_resolution

Time resolution value for convolution.

Removed in version 2.0.0.

Type:

Var

resolution_kernel

Weight of 2D Gaussian resolution. Same step size as detuning.

Removed in version 2.0.0.

Type:

array

distribution_points

Number of points for roughness distributions in forward geometry

Type:

int

fit_weight

Relative weight for the cost function in multi measurement fitting.

Type:

float

instrument

Instrument object. The InstrumentFunction2D must be implemented in python to perform the convolution in energy and time.

Added in version 2.0.0.

Type:

Instrument

residual

Implementation of the residual calculation used for fitting.

Type:

Residual

result

List of intensity values in units of (\(\Gamma\)).

Type:

ndarray

drive_sample

Sample object with drive detuning.

Added in version 1.0.3.

Changed in version 2.0.0: changed from old Sample class to BasicSample.

Type:

BasicSample

Calculate()

Calculates the class method. Also callable via operator ().

Returns:

array of intensities.

Return type:

ndarray

Cost()

Get the cost function of the measurement

\[cost = \frac{1}{n} \sum_i r(y_i, \hat{y}_i)\]

Added in version 2.0.0.

Returns:

cost function value.

Return type:

float

MeanSquaredError()

Get the mean squared error (MSE) of the measurement

\[cost = \frac{1}{n} \sum_i (y_i - \hat{y}_i)^2\]

Added in version 2.0.0.

Returns:

MSE value.

Return type:

float

Plot()

Plot the IntegratedEnergyTimeSpectrum.

Added in version 1.0.3.

PopulateFitHandler(FitMeasurement self, OptimizerHandler fit_handler)
PopulateOptimizerHandler(Measurement self, OptimizerHandler optimizer_handler)
Residuals(IntegratedEnergyTimeSpectrum self) → double
SetCeresFitParameterPointers(FitMeasurement self, double const *const * parameters)
SetFitEqualities(FitMeasurement self)
SetNLoptFitParameterPointers(FitMeasurement self)
SetPagmoFitParameterPointers(FitMeasurement self, DoubleVector inputs)
Update(Measurement self)
Velocity()

Returns the velocity detuning of the measurement in units of mm/s.

Returns:

Velocity detuning (mm/s).

Return type:

ndarray

property background

p.Var

Type:

background

property bare_residuals

std::vector<(double,std::allocator<(double)>)>

Type:

bare_residuals

property bootstrap_fit_result

std::vector<(double,std::allocator<(double)>)>

Type:

bootstrap_fit_result

property bootstrap_residuals

std::vector<(double,std::allocator<(double)>)>

Type:

bootstrap_residuals

property bunch_spacing

double

Type:

bunch_spacing

property coherence

bool

Type:

coherence

property data_size

size_t

Type:

data_size

property detuning

std::vector<(double,std::allocator<(double)>)>

Type:

detuning

property distribution_points

unsigned int

Type:

distribution_points

property drive_sample

p.BasicSample

Type:

drive_sample

property electronic

bool

Type:

electronic

property experiment

p.Experiment

Type:

experiment

property fit_equalities

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

Type:

fit_equalities

property fit_parameter_pointers

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

Type:

fit_parameter_pointers

property fit_residuals

std::vector<(double,std::allocator<(double)>)>

Type:

fit_residuals

property fit_weight

double

Type:

fit_weight

property id

std::string

Type:

id

property inequality

p.Inequality

Type:

inequality

property input_intensity_data

std::vector<(double,std::allocator<(double)>)>

Type:

input_intensity_data

property instrument

p.Instrument

Type:

instrument

property integration_start

double

Type:

integration_start

property integration_stop

double

Type:

integration_stop

property intensity_data

std::vector<(double,std::allocator<(double)>)>

Type:

intensity_data

property mode

std::string

Type:

mode

property nlopt_fit_parameters_ptr

p.double

Type:

nlopt_fit_parameters_ptr

property offset

p.Var

Type:

offset

property residual

p.Residual

Type:

residual

property result

std::vector<(double,std::allocator<(double)>)>

Type:

result

property scaling

p.Var

Type:

scaling

property sum_user_residuals

double

Type:

sum_user_residuals

property time

std::vector<(double,std::allocator<(double)>)>

Type:

time

property time_length

double

Type:

time_length

property time_step

double

Type:

time_step