FirstGeneration

class ompy.FirstGeneration[source]

Bases: object

First generation method from Guttormsen et al. (NIM 1987).

Note

Attributes need to be set only if the respective method (statistical / total) multiplicity estimation is used.

Variables:
  • num_iterations (int) – Number of iterations the first generations method is applied. Defaults to 10.

  • multiplicity_estimation (str) – Selects which method should be used for the multiplicity estimation. Can be either “statistical”, or “total”. Default is “statistical”.

  • statistical_upper (float) – Threshold for upper limit in statistical multiplicity estimation. Defaults to 430 keV.

  • statistical_lower (float) – Threshold for lower limit in statistical multiplicity estimation. Defaults to 200 keV.

  • statistical_ratio (float) – Ratio in statistical multiplicity estimation. Defaults to 0.3.

  • Ex_entry_shift (float) – Shift applied to the energy in statistical multiplicity estimation. Defaults to 200 keV. TODO: Unknown how to pick. Magne described a manual method by looking at the known low energy states.

  • Ex_entry_statistical (float) – Average entry point in ground band for statistical multiplicity in statistical multiplicity estimation. Defaults to 300 keV.

  • Ex_entry_total (float) – Average entry point in ground band for total multiplicity estimation. Defaults to 0 keV.

  • valley_correction (Vector) – See step method. Default: None.

  • use_slide (bool) – Use sliding Ex ratio (?). Default: False.

  • action (Action) – Placeholder if an Action should be applied. This cut for example be a “cut” of the Ex bins to consider.

Todo

  • Clean up where attributes are set for the respective methods.

Attributes Summary

multiplicity_estimation

Methods Summary

__call__(matrix)

Wrapper for self.apply()

allgen_from_primary(fg[, xs])

Create all generation matrix from first generations matrix

apply(unfolded)

Apply the first generation method to a matrix

cut_valley_correction(matrix)

Cut valley correction Ex axis if neccessary.

multiplicity(matrix)

Dispatch method returning statistical or total multiplicity

multiplicity_normalization(matrix)

Generate multiplicity normalization

multiplicity_statistical(matrix)

Finds the multiplicties using Ex above yrast

multiplicity_total(matrix)

Finds the multiplicties using all of Ex

remove_negative(matrix)

Wrapper for Matrix.remove_negative()

row_normalized(matrix)

Set up a diagonal array with constant Ex rows

setup(matrix)

Set up initial first generation matrix with normalized Ex rows

step(iteration, H_old, W_old, N, matrix[, ...])

An iteration step in the first generation method

Attributes Documentation

multiplicity_estimation: str

Methods Documentation

__call__(matrix)[source]

Wrapper for self.apply()

Return type:

Matrix

static allgen_from_primary(fg, xs=None)[source]

Create all generation matrix from first generations matrix

AG(Ex, Eg) = FG(Ex, Eg)
             + ∑ σ[Ex] weight(Ex->Ex') AG(Ex', Eg) / σ[Ex'],

where the sum runs over all excitation energies Ex’ < Ex.

Parameters:
  • fg (Matrix) – First generations matrix

  • xs (np.ndarray, optional) – Population cross-section for each Ex bin in #times populated, not mb. Default is the same population as the fg_matrix.

Returns:

All generations matrix

Return type:

ag (Matrix)

apply(unfolded)[source]

Apply the first generation method to a matrix

Parameters:

unfolded (Matrix) – An unfolded matrix to apply the first generation method to.

Return type:

Matrix

Returns:

The first generation matrix

cut_valley_correction(matrix)[source]

Cut valley correction Ex axis if neccessary.

Ensures valley correction has the same Ex axis as the matrix it will be used with.

Parameters:

matrix (Matrix) – Matrix that the valley correction will be used with.

Returns:

None if

self.valley_correction is None. Otherwise a np.ndarray with the same length as matrix.Ex.

Return type:

valley_correction (None or np.ndarray)

multiplicity(matrix)[source]

Dispatch method returning statistical or total multiplicity

Parameters:

matrix (Matrix) – The matrix to get multiplicities from

Return type:

ndarray

Returns:

The multiplicities in a row matrix of same dimension as matrix.Ex

multiplicity_normalization(matrix)[source]

Generate multiplicity normalization

Parameters:

matrix (Matrix) – The matrix to find the multiplicty normalization of.

Return type:

ndarray

Returns:

A square matrix of the normalization

multiplicity_statistical(matrix)[source]

Finds the multiplicties using Ex above yrast

Parameters:

matrix (Matrix) – The matrix to get the multiplicites from

Return type:

ndarray

Returns:

The multiplicities in a row matrix of same dimension as matrix.Ex

multiplicity_total(matrix)[source]

Finds the multiplicties using all of Ex

Parameters:

matrix (Matrix) – The matrix to get the multiplicites from

Return type:

ndarray

Returns:

The multiplicities in a row matrix of same dimension as matrix.Ex

remove_negative(matrix)[source]

Wrapper for Matrix.remove_negative()

Put in as an extra method to facilitate replacing this by eg. fill_and_remove_negatve

Parameters:

matrix (Matrix) – Input matrix

row_normalized(matrix)[source]

Set up a diagonal array with constant Ex rows

Parameters:

matrix (Matrix) – Input matrix

Return type:

ndarray

Returns:

Array where each Ex-row has constant value given as 1/γ where γ is the length of the row from 0 Eγ to the diagonal.

setup(matrix)[source]

Set up initial first generation matrix with normalized Ex rows

Return type:

Tuple[Matrix, Matrix, Matrix]

step(iteration, H_old, W_old, N, matrix, valley_correction=None)[source]

An iteration step in the first generation method

The most interesting part of the first generation method. Implementation of a single step in the first generation method.

Parameters:
  • iteration (int) – the current iteration step

  • H_old (ndarray) – The previous H matrix

  • W_old (ndarray) – The previous weights

  • N (ndarray) – The normalization

  • matrix (Matrix) – The matrix the method is applied to

  • valley_correction (np.ndarray, optional) – Array of weight factors for each Ex bin that can be used to manually “turn off” /decrease the influence of very large peaks in the method.

Return type:

Tuple[ndarray, ndarray]