fudge.legacy.endl package

Submodules

fudge.legacy.endl.bdfls module

This module contains classes for dealing with a bdfls file and its contents.

class fudge.legacy.endl.bdfls.bdfls(name=None, template=None)[source]

This class reads in a bdfls file.

addFlux(EF_ls, id, label='', overwrite=0)[source]

Adds the flux with id to self’s list of fluxes. EF_ls is a python list with the following structure:

[
[ [E0, f0], [E1, f1], … ], # for l = 0 [ [E0, f0], [E1, f1], … ], # for l = 1 …

]

and label is the flux’s label (see class bdfls_flux). If overwrite is false, a raise is triggered if self already contains group with id, else the old one is overwritten.

addGroup(ebs, id, label='', overwrite=0)[source]

Adds the group with id to self’s list of groups. ebs is a python list of numbers and label is the groups label (see class bdfls_group). If overwrite is false, a raise is triggered if self already contains group with id, else the old one is overwritten.

addZA(za, mass, halflife, warning=1)[source]

Calls addZAHalflife with halflife and addZAMass with mass.

addZAHalflife(za, halflife, warning=1)[source]

Adds or changes the halflife for ZA. If warning is true and ZA is already in self’s halflife list, then a warning message is printed.

addZAMass(za, mass, warning=1)[source]

Adds or changes the mass for ZA. If warning is true and ZA is already in self’s mass list, then a warning message is printed.

constant(i)[source]

Returns the (i+1)^th constant from self’s constant list.

flux(id)[source]

Returns the flux that matches id.

group(id)[source]

Returns the group that matches id.

halflife(za)[source]

Returns the halflife of the za if in database, else returns None.

isSubGroup(sid_, id_, eps=0.0)[source]

Returns true if sid is a sub-group of id, false otherwise.

mass(za)[source]

Returns the mass of the za if in database, else returns None (the mass of a za is for a neutral atom, not the nucleus).

printza(za, im=0, ih=0)[source]

Prints the za, mass and halflife for za.

read(name)[source]

Reads in the bdfls file given by name. For internal use only.

save(fileName=None)[source]

Saves the contents of self to fileName.

setZAHalflife(za, halflife)[source]

Changes the halflife for ZA. A raise is triggered is za in not in self’s halflife list.

setZAMass(za, mass)[source]

Changes the mass for ZA. A raise is triggered is za in not in self’s mass list.

subGroups(id)[source]

Returns the sub-group ids for group id.

za(za, im=0, ih=0)[source]

Returns the tuple ( za, mass, halflife ) for za.

zas(ZAMin, ZAMax=None)[source]

Print za, mass and halflife for all za between ZAMin and ZAMax inclusive.

class fudge.legacy.endl.bdfls.bdfls_constant(f)[source]

A class that contains a single constant datum.

read(f)[source]

Reads in the next constand datum from the bdfls file. Sets self’s value to None if at end of constant data.

class fudge.legacy.endl.bdfls.bdfls_flux(f)[source]

A class that contains a single flux.

plot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None, style='lines')[source]

Plots the fluxes

xylog meanings::
xylog plot-type
0 linear-linear 1 log-linear 2 linear-log 3 log-log
read(f)[source]

Reads in the next flux from a bdfls file. Sets self’s id to None if no more fluxes to read in.

class fudge.legacy.endl.bdfls.bdfls_group(f)[source]

A class that contains a single group.

plot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None, style='lines')[source]

Plots the group boundaries.

xylog meanings::
xylog plot-type
0 linear-linear 1 log-linear 2 linear-log 3 log-log
read(f)[source]

Reads in the next group from a bdfls file. Sets self’s id to None if not more groups to read in.

class fudge.legacy.endl.bdfls.bdfls_halflife(f_or_za, halflife=None)[source]

A class that contains a single za and halflife datum.

read(f)[source]

Reads in the next halflife datum from the bdfls file. Set za and halflife to None if at end of halflife data.

class fudge.legacy.endl.bdfls.bdfls_mass(f_or_za, mass=None, format='old')[source]

A class that contains a single za and mass datum.

read(f)[source]

Reads in the next mass datum from the bdfls file. Returns the tuple (za, mass) or (None, None) if at end of mass data.

fudge.legacy.endl.bdfls.bdfls_read_int_float(f, callingRoutine, Str)[source]
fudge.legacy.endl.bdfls.bdfls_read_int_label(f, allowEOD, callingRoutine, Str1, Str2)[source]
class fudge.legacy.endl.bdfls.bdfls_subshell(f)[source]

A class that contains the subshell data.

read(f)[source]

Reads in the subshell data from the bdfls file. Set self’s line to None if at end of subshell data.

class fudge.legacy.endl.bdfls.bdfls_temperature(f)[source]

A class that contains a temperaure datum.

read(f)[source]

Reads in the next temperature datum from the bdfls file. Set self’s id to None if at end of temerature data.

fudge.legacy.endl.bdfls.getBdflsFile(name=None)[source]
fudge.legacy.endl.bdfls.getDefaultBdfls(name=None, template=None)[source]
fudge.legacy.endl.bdfls.targetToZA(za)[source]

This routine converts an integer or string into a ZA (e.g., “FissionProductENDL99120” to 99120).

fudge.legacy.endl.endl1dmathClasses module

This module contains the endl1dmath class. Also see the supporting module endl1dmathmisc.py.

class fudge.legacy.endl.endl1dmathClasses.endl1dmath(data=None, checkDataType=False, yLabel=None, label='unknown', toFloat=0)[source]

Bases: object

This class is designed to support operations on a list of numbers (e.g., [ number, number, …, number ]) that may be useful to scientists. A number is an integer or a float.

Members

data        | A python list of numbers.
columns     | This is always 1 as this is 1d data.
yLabel      | Labelled used as the y-Label when plotting.

Some examples are,

>>> my1d = endl1dmath( [ 1, 2, 3 ] )
>>> print my1d
 1.0000000e+00
 2.0000000e+00
 3.0000000e+00
>>> new1d = 2. * my1d + 3.14
>>> print new1d
 5.1400000e+00
 7.1400000e+00
 9.1400000e+00
>>> f1d = new1d.mapFunction( "math.exp(x)" )
>>> print f1d
 1.7071577e+02
 1.2614284e+03
 9.3207651e+03
check()[source]

Check that self’s data is a list of numbers.

copyData()[source]

Returns an endl1dmath object that is a copy, and not a reference, of self.

getDimensions()[source]

Returns the dimensions (1 for endl1dmath) for this type of data.

mapFunction(function)[source]

Maps ‘function’ onto every point of self’s data. ‘Function’ must be a string of the form ‘f(x)’ where f(x) evaluates to a number (e.g. ‘math.sin(x)’). That is, self.data[i] = f( self.data[i] ). For example, to exponentiate the points of instance my1d enter

>>> my1d.mapFunction( 'exp(x)' )
plot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None)[source]

This routine is like qplot (quick plot) except it spawns an interactive plot. qplot is faster while plot is more flexible.

xylog plot-type
0 linear-linear
1 log-linear
2 linear-log
3 log-log
qplot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None)[source]

Also see plot( ).

xylog plot-type
0 linear-linear
1 log-linear
2 linear-log
3 log-log
set(other, duplicate=0, checkDataType=1)[source]

Sets self.data = other.data. If duplicate is true (i.e., not 0) than a copy of other’s data is made so that other’s and self’s data can be modified independently.

toFloat()[source]

Converts every point of self to a float.

toString(format=None)[source]

Returns the string returned by the endl1dmath’s __repr__ function.

toStringWithPrefixSuffix(Prefix='', Suffix='')[source]

Returns a printable string of the points in self. Each point is a separate line surrounded by Prefix and Suffix.

fudge.legacy.endl.endl1dmathmisc module

This module contains miscellaneous routines for supporting the endl1dmath class from module endl1dmathClasses.

Module’s global variables:

endl1d_repr_xFormat : Default format string used for converting an element of the data of
                      an endl1dmath object to a string.
fudge.legacy.endl.endl1dmathmisc.check1dData(data)[source]

Checks that data is a python list of numbers. Triggers a raise if it is not. Data may be a python list or an instance that is a subclass of endl1dmath.

fudge.legacy.endl.endl1dmathmisc.get1dmathData(object, callingRoutine, msg)[source]

If object is a python list, then it is returned. Else, if object is a sub-class of endl1dmath its data is return otherwise a raise is executed.

fudge.legacy.endl.endl1dmathmisc.valid1dClassType(object, callingRoutine='', msg='')[source]

Returns the first argument, object, if it is a subclass of the endl1dmath class; else, triggers a raise.

fudge.legacy.endl.endl2 module

This module contains miscellaneous functions.

fudge.legacy.endl.endl2.AFromZA(ZA)[source]

Returns A from ZA designator ( ZA = 1000 * Z + A ). ZA must be a python integer.

fudge.legacy.endl.endl2.CInfo(w=4)[source]

Prints a list of C and brief description for supported C-values.

fudge.legacy.endl.endl2.IInfo()[source]

Prints a list of I, number of columns and brief description for supported I-values.

fudge.legacy.endl.endl2.ZAToYo(ZA)[source]

Returns yo designator for ZA. This mapping is not one-to-one as example ZA = 1001 could be yo = 2 or 12. The smaller yo values is returned.

fudge.legacy.endl.endl2.ZFromZA(ZA)[source]

Returns Z from ZA designator ( ZA = 1000 * Z + A ). ZA must be a python integer.

fudge.legacy.endl.endl2.ZInfo(w=2)[source]

Prints a list of Z, symbol and name for most elements.

fudge.legacy.endl.endl2.ZandAFromZA(ZA)[source]

Returns the tuple ( Z, A ) from a ZA designator. ZA must be a python integer.

fudge.legacy.endl.endl2.endlToGNDSName(yoOrZA)[source]
fudge.legacy.endl.endl2.fileInfo(yi, ZA, fileName)[source]

Obtains yo, C, I and S from fileName and calls reactionInfo.

fudge.legacy.endl.endl2.gndsNameToEndlZ_A_Suffix(name)[source]

Returns the tuple (Z, A, suffix, ZA) for a gnds isotope name (e.g., gnds name = ‘Am242_m1’ returns ( 95, 242, ‘m1’, 95242 ).

fudge.legacy.endl.endl2.nameForYoOrZA(yoOrZA, NameASeperator='', ZAOnly=0, AddNatural=1, m_to_m1=False, suffixSeperator=None)[source]

If ZAOnly == 0 and yoOrZA is a yo type particle then the name for its yo is returned; otherwise, the name for ZA is returned. If AddNatural is true, then natural ZAs (i.e., those with A = 000 like 12000) have the string ‘natural’ append to the name for the Z, otherwise, natural targets only contain the name. If m_to_m1 is True then when Suffix = ‘m’ it is changed to ‘m1’.

fudge.legacy.endl.endl2.possibleReactions(projectile, target, energy_MeV, maxProducts=4, bdflsFile=None)[source]

This function returns a list of all reactions for the projectile with kinetic energy energy_MeV hitting the stationary target that are allowed by the amount of energy_MeV available in the center-of-mass and a reaction’s Q. Reactions considered will only contain products of n_1, H_1, H_2, H_3, He_3, He_4 and a residual. The reactions considered are also limited to the number of outgoing products, not including the residual, being no greater than maxProducts.

fudge.legacy.endl.endl2.reactionEquations(yi_, ZA_, C, level=None, specialCases=1, printQWarning=True, NameASeperator='', bdflsFile=None)[source]

Given the incident particle yi, target ZA and reaction type C, this routine returns a list of three string for the reaction’s equation. The first string is of the form ‘yi + ZA -> products + residual + Q’ and the second is of the form ZA(yi,products)residual. The third string is of the form (yi,products). For example, reactionEquations( 1, 94239, 13 ) returns the list [ ‘n + Pu239n -> 3n + Pu237 + -12.64503 MeV’, ‘Pu239(n,3n)Pu237’, ‘(n,3n)’ ]. If level is not None,

fudge.legacy.endl.endl2.reactionInfo(yi, ZA, yo, C, I, S, bdflsFile=None)[source]

Returns a string of 5 lines. The first 3 lines are the item return by reactionEquations. The fourth is “Elastic” if C = 10 else it is a blank line, and the last is “total cross section” if I == 0 and C == 0, else it is the string return by endl_I.endl_ILabel.

fudge.legacy.endl.endl2.reactionQ(yi, ZA, C, targetELevel=0.0, X4=0, specialCases=1, printQWarning=True, bdflsFile=None)[source]

Returns the Q for reaction of type C involving incident particle yi and target ZA. Note, the target is taken to be in its ground state.

fudge.legacy.endl.endl2.reactionQByIsotopeNames(incomingNames, outgoingNames, bdflsFile=None)[source]

Returns the Q in MeV for the reaction, that is, the (sum of incoming masses) - (sum of outgoing mass) in MeV. Returns None if at least one of the masses is unknown. This routine only works for isotopes in the ground state as it converts each name to it ZA and calls reactionQByZAs (see reactionQByZAs for more details). Example, incomingNames = [ ‘n’, ‘W186’ ] outgoingNames = [ ‘H3’, ‘He4’, ‘Tm176’ ] Q = reactionQByIsotopeNames( incomingNames, outgoingNames )

fudge.legacy.endl.endl2.reactionQByZAs(incomingZAs, outgoingZAs, bdflsFile=None)[source]

Returns the Q in MeV for the reaction, that is, the (sum of incoming masses) - (sum of outgoing mass) in MeV. Returns None if at least one of the masses is unknown.

fudge.legacy.endl.endl2.reactionThreshold(yi, ZA, C, targetELevel=0.0, residualELevel=0.0, Q=None, specialCases=0, S=None, bdflsFile=None)[source]

Returns the threshold for this reaction. targetELevel is the excited state of the target and residualELevel is the excited state of the residual.

fudge.legacy.endl.endl2.residualZA_yos_Q(yi_, ZA_, C, targetELevel=0.0, X4=0, specialCases=1, printQWarning=True, bdflsFile=None)[source]

Returns a tuple containing the residual ZA’, yos and Q for reaction of type C involving incident particle yi and target ZA. yos is a list. For example, the reation, ZA + yi -> ZA’ + yo_1 + yo_2 + … + yo_n + Q, would return ( ZA’, [ yo_1, yo_2, …, yo_n ], Q ).

fudge.legacy.endl.endl2.symOrNameForYoOrZA(yoOrZA, wantName, ASep='', ZAOnly=0, AddNatural=1, m_to_m1=False, suffixSeperator=None)[source]

For internal use only (see symbolForYoOrZA or nameForYoOrZA).

fudge.legacy.endl.endl2.symbolForYoOrZA(yoOrZA, NameASeperator='', ZAOnly=0, AddNatural=1, m_to_m1=False, suffixSeperator=None)[source]

If ZAOnly == 0 and yoOrZA is a yo type particle then the symbol for its yo is returned; otherwise, the symbol for ZA is returned. If AddNatural is true, then natural ZAs (i.e., those with A = 000 like 12000) have the string ‘natural’ append to the symbol for the Z, otherwise, natural targets only contain the symbol. If m_to_m1 is True then when Suffix = ‘m’

it is changed to ‘m1’.
fudge.legacy.endl.endl2.yInfo()[source]

Prints a list of y-id, symbol and name for supported projectiles.

fudge.legacy.endl.endl2.yoToZA(yo_i)[source]
Returns ZA designator, or special code, from yo id. That is, ::

yo_i = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 is converted to

0, 1, 1001, 1002, 1003, 2003, 2004, 0, -8, -9, -10, 1, 1001, 1002, 1003, 2003, 2004
with the following meanings ::
none, n, p, d, t, He3, He, g, b+, b-, EC, n, p, d, t, He3, He.

yo_i must be a python integer.

fudge.legacy.endl.endl2.yoToZA_forNuclei(yo)[source]

Same as yoToZA except returns 0 if yo is in [ 7, 8, 9, 17, 18, 19 ] (i.e., is a gamma, positron or electron).

fudge.legacy.endl.endl2dmathClasses module

This module contains the endl2dmath class. Also see the supporting module endl2dmathmisc.py.

It also contains the variables doSafeDivide and doSafeDivideAlways (see __div__ for details).

class fudge.legacy.endl.endl2dmathClasses.endl2dmath(data=None, checkDataType=False, xLabel=None, yLabel=None, label='unknown', interpolation=0, template=None, allowSameX=False)[source]

Bases: object

The class endl2dmath is the base class for all 2d data (i.e., data consisting of (x, y) pairs or 2 column data). The data is stored as a python list of [ x, y ] values. For example, the 2 column data:

2.5  4.5
3.1  3.6
3.4  4.4

is stored as self.data = [ [ 2.5, 4.5 ], [ 3.1, 3.6 ], [ 3.4, 4.4 ] ].

Members:

data               A python list of [ x, y ] pairs.
columns            Always 2 (i.e., 2 column data).
interpolation      Type of interpolation used (see below).
xLabel             X label used for plotting.
yLabel             Y label used for plotting.

Interpolation values and meaning:

xylog   plot-type
----------------------
  0     linear-linear
  1     log-linear
  2     linear-log
  3     log-log
GetValueNIndex(x, i=0)[source]

Returns the tuple ( y, index ) where y is the value of self evaluated at x and index is the starting index to be used in the next call when ascending the list. I is the starting index.

clip(yMin, yMax)[source]

Returns an endl2dmath object whose y values are self’s y values clipped to be between yMin and yMax.

cmp(other, f=5e-05)[source]

Compares self to other and prints out data where they differ by more than f.

convolution(other, dxMax=None, convolutionMethod=None, interpolationAccuracy=0.01)[source]

Returns an endl2dmath instance that is a convolution of self and other. convolutionMethod can be None or ‘pythonCodingV1’. If None and module fudgeConvolutions exist then function fudgeConvolutions.convolution will be used; otherwise, the slow, original python code will be used. If interpolationAccuracy is not None then the endl2dmath.thin method is called with interpolationAccuracy = interpolationAccuracy.

copyData()[source]

Returns an endl2dmath instance that is a copy, and not a reference, of self.

copyDataToXYs()[source]
copyDataToXsAndYs()[source]
dimension
domain()[source]

Returns the domain (minumum and maximum x values) for self.

exp()[source]

Returns an endl2dmath instance that has all y values of self exponentiated.

getDimensions()[source]

Returns the dimensions (2 for endl2dmath) for this type of data.

getValue(x)[source]

Returns self’s y value evaluated at x. If x is outside the range of self’s x domain then 0. is returned. Also see getValueInDomain.

getValueInDomain(x)[source]

Returns self’s y value evaluated at x. If x is outside the range of self’s x domain then None is returned. Also see getValue.

integrateOneFunction(xMin=None, xMax=None)[source]

Returns the integral of self from xMin to xMax.

integrateThreeFunctions(other1, other2, xMin=None, xMax=None)[source]

Returns the integral of self, other1 and other2 from xMin to xMax.

integrateTwoFunctions(other, xMin=None, xMax=None)[source]

Returns the integral of self and other from xMin to xMax.

integrateX(xArray=None, weight=None, normalize=0)[source]

Returns an endl1dmath object of length len( xArray ) - 1 whose value at index i is the integral of self from xArray[i] to xArray[i+1]. If xArray is none then the x values of self are used for xArray. If Normailzie is non-zero the value at index i is divided by the x interval xArray[i+1] - xArray[i]. If weight is not equal to None, weigth must be an endl2dmath object, and the integral is of self * weight.

label()[source]

Returns self’s label.

log()[source]

Returns an endl2dmath instance that has all y values of self log_e-ed.

log10()[source]

Returns an endl2dmath instance that has all y values of self log10_e-ed.

map(other)[source]

Sets self’s y values to other evaluated at self’s x values.

max()[source]

Returns the maximum y value of self of None if self is empty.

min()[source]

Returns the minimum y value of self or None if self is empty.

normalize()[source]

Returns an endl2dmath instance that is the same as self normalized to 1. This, is the integral of dx y(x) is 1.

overstrike(other, leftFill=1, rightFill=1)[source]

Returns an endl2dmath instance that is the same as self, except that the data from other.xMin to other.xMax is replaced by other’s data. Other must be an endl2dmath object. If leftFill is true then a point at other.xMin * ( 1. - endlParameters.endlEpsx ) is inserted with y value of self at that x value. If rightFill is true then a point at other.xMax * ( 1. + endlParameters.endlEpsx ) is inserted with y value of self at that x value.

plot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None, style='lines')[source]

This routine is like qplot (quick plot) except it spawns an interactive plot. qplot is faster while plot is more flexible.

xylog interpolation values and meaning:

 xylog   plot-type
-----------------------
   0     linear-linear
   1     log-linear
   2     linear-log
   3     log-log
qplot(xMin=None, xMax=None, yMin=None, yMax=None, xylog=0, xLabel=None, yLabel=None, title=None, style='lines')[source]

Also see plot( ).

xylog interpolation values and meaning:

 xylog   plot-type
-----------------------
   0     linear-linear
   1     log-linear
   2     linear-log
   3     log-log
relativediff(other, i1, i2)[source]

Compares self’s y value at i1 to other’s y value at i2. Mainly for internal use.

removeClosePoints(verbose=0)[source]

Calls endl2dmathmisc.check2dData and removes all points that check2dData claims are too close.

reversex()[source]

Returns an endl2dmath instance whose list of [x,y] has been reversed. For example, the data [ [1, 2], [3, 3], [4, 5], [6, 3] ] becomes [ [6, 3], [4, 5], [3, 3], [1, 2] ].

safeDivide(other, fMaxValue=10.0)[source]

Like __div__ except it attemps to handle divide by removing the offending point and adding near by points on either side. This routine also detects zeros in the denominator and adds near by points on either side. See __div__ for more information.

scalex(f, xLabel=None)[source]

Returns an endl2dmath instance whose x data is set to f(x) where the x in f(x) is self’s x data and f(x) is a string representing a function. The y data is not altered. Two examples of f(x) are ‘exp(x)’ and ‘sqrt( pow( x, 2 ) - 1 ) / x’. Sets the returned objects xLabel to xLabel if is it not None.

set(other)[source]

Sets self’s data to other’s data.

setValue(x, y)[source]

Sets self’s y value evaluated at x to y. If there is no point at x then one is added. x and y must be numbers.

slice(xMin=None, xMax=None)[source]

Returns an endl2dmath instance that includes all points of self that lie between xMin and xMax inclusively. If xMin = None (xMax = None) then the lowest (highest) x value of self is used for xMin (xMax).

sliceDull(xMin=None, xMax=None)[source]

Same as slice except that the end points of the returned endl2dmath instance are dulled if they are not the same as the end points of self.

slicex(xMin=None, xMax=None, addZeroPoint=False)[source]

Same as slice except if self does not contain a point at xMin (xMax) then it is added with the y value being self evalauted at xMin (xMax). If self evalauted at xMin (xMax) is zero then no point is added, unless addZeroPoint is True.

slicexDull(xMin=None, xMax=None)[source]

Same as slicex except the end points of the returned endl2dmath instance are dulled if they are not the same as the end points of self.

sqrt()[source]

Returns an endl2dmath instance that has all y values of self sqrt-ed.

thicken(dx, Log=0)[source]

Returns an endl2dmath instance that is the same as self except that more points are added, if needed, to insure that the x spacing between points is less than dx if Log = 0 or the ratio between x values of points is less than dx if Log != 0. The actual x spacing may be smaller than dx but not larger.

thin(interpolationAccuracy=0.01, thinningMethod=None)[source]

Returns an endl2dmath instance that is the same as self except the points are thinned while keeping linear interpolation accurate to interpolationAccuracy. interpolationAccuracy is forced into the range 1e-1 to 1e-8. thinningMethod can be None, ‘c_CodingV1’ or ‘pythonCodingV1’. If thinningMethod is None or ‘c_CodingV1’ then thin tries to use the thinning function in fudge2dThin. If this fails or thinningMethod is ‘pythonCodingV1’, a slower python code is used.

toInterpolation(interpolation, accuracy, diSectionMax=3)[source]

Returns a new endl2dmath object with data converted to the specified interpolation and accuracy.

toPointwise_withLinearXYs(accuracy=0.001, lowerEps=0, upperEps=0, cls=None)[source]

This routine is designed to make an endl2dmath instance work with plotting packages like plot2d.py. This routine is not compatible with legacy fudge as the returned instance is of type XYs and not of type endl2dmath.

toString(format=None)[source]

Returns the string returned by the endl2dmath’s __repr__ function. This can be useful when endl2dmath is used as a base class.

toStringWithPrefixSuffix(Prefix='', Suffix='')[source]

Returns a printable string of the data in self with Prefix and Suffix append to each line.

trim()[source]

Removes extra leading and trailing data whose y values are zero.

union(other, xDomainUnionOnly=False)[source]

Returns an endl2dmath instance with its x values being a union of self’s and other’s x values. The y values are self’s y values mapped onto the union’s x values. If xDomainUnionOnly is True then only the x domain common to self and other is returned.

vectorScale(vector)[source]

Scales the y value of self at x by vector evaluated at x. Only self’s data within the x range of vector are modified.

vectorScaleAdd(vector)[source]

Scales the y value of self at x by vector evaluated at x. Only self’s data within the x range of vector are modified.

xArray()[source]

Returns an endl1dmath instances of the x values in self.

xMax()[source]

Returns the maximum x value of self if self contains data, otherwise it returns None.

xMin()[source]

Returns the minimum x value of self if self contains data, otherwise it returns None.

yMax()[source]

Returns the maximum y value of self if self contains data, otherwise it returns None.

yMin()[source]

Returns the minimum y value of self if self contains data, otherwise it returns None.

yMinMax()[source]

Returns the tuple of the minimum and maximum y values of self if self contains data, otherwise it returns ( None, None ).

fudge.legacy.endl.endl2dmathmisc module

This module contains miscellaneous routines for supporting the endl2dmath class from module endl2dmathClasses.

Module’s global variables:

endl2d_repr_xFormat : Default format string used for converting an x-element of the data of an endl2dmath object to a string.
endl2d_repr_yFormat : Default format string used for converting an y-element of the data of an endl2dmath object to a string.
fudge.legacy.endl.endl2dmathmisc.check2dData(data, allowNegativeX=True, allowSameX=False, allowZeroX=True, positiveY=True, printWarning=True, printErrors=True, xCloseEps=None, formatCode=12, maxAbsFloatValue=None)[source]

Checks that data (or data.data if data is an endl2dmath instance) is a list containing valid endl2dmath points. If positiveY is true (default) then a negative y value generates a raise. If positiveY is false then the number of negative y values is counted and the count is returned. The x values must be in increasing order else a raise is generated. If allowZeroX is False, a zero first x value will generate a raise. Also all x values must be positive unless allowNegativeX is true. If printWarning is true than close x value warnings are printed. X values x1 and x2 are considered close if x2 - x1 < xCloseEps * ( x1 + x2 ). If on input xCloseEps is None, the it is set to endlParameters.endlEpsx * pow( 0.1, formatCode - 14 ) / 3. If on input formatCode is 12 then it is set to 14. This function returns an integer and an array. The integer is the number of negative y values and the array is a list of all indices with close x-values. If printWarning is ‘True’ than warnings are printed (warning will not execute a raise). If printErrors is ‘True’ then errors are printed, and if at least one error exist, a raise will be executed after all data has been checked.

fudge.legacy.endl.endl2dmathmisc.check2dPoint(p)[source]

Checks that p is the list [ number, number ]. A raise is generated if p is not.

fudge.legacy.endl.endl2dmathmisc.convertFunctionToLinLin(f, xMin, xMax, accuracy)[source]

Returns a new endl2dmath object that represents the function f(x) as a lin-lin table to the specified absolute accuracy on the interval xMin to xMax.

fudge.legacy.endl.endl2dmathmisc.convertLogLogToLinLin(self, accuracy, diSectionMax=3)[source]

Returns a new endl2dmath object of self converted from log-log to lin-lin to specified accuracy.

fudge.legacy.endl.endl2dmathmisc.dullLowerEdge2d(d)[source]

Dulls the lower edge of d if the y value at that edge is not 0. d must be an endl2dmath instance.

fudge.legacy.endl.endl2dmathmisc.dullUpperEdge2d(d)[source]

Dulls the upper edge of d if the y value at that edge is not 0. d must be an endl2dmath instance.

fudge.legacy.endl.endl2dmathmisc.dulledges2d(d)[source]

Calls dullLowerEdge2d( d ) and dullUpperEdge2d( d ).

fudge.legacy.endl.endl2dmathmisc.flattop2d(xMin, xMax)[source]

Returns an endl2dmath instance of a flattop from xMin to xMax with height 1. 0 < xMin < xMax.

fudge.legacy.endl.endl2dmathmisc.flattop2dDull(xMin, xMax)[source]

Returns the endl2dmath instances returned by flattop2d( xMin, xMax ) and that is dulled using dulledges2d( ).

fudge.legacy.endl.endl2dmathmisc.gauss2d(xc, xw, f=0.001, xsigmax=4, xMin=None, xMax=None)[source]

Returns an endl2dmath instance the has a Gaussian shape centered at xc with width xw (i.e., Exp( -( (x - xc) / xw )^2 / 2 ). The points are generated such that linear interpolation is accurate to f. The x value’s range is limited by xMin, xMax and abs(x - xc) / xw <= xsigmax.

fudge.legacy.endl.endl2dmathmisc.gauss2dDull(xc, xw, f=0.001, xsigmax=4, xMin=None, xMax=None)[source]

Returns an endl2dmath instance of gauss2d( xc, xw, f, xsigmax, xMin, xMax ) that is dulled using dulledges2d( ).

fudge.legacy.endl.endl2dmathmisc.get2dmathData(object, callingRoutine, msg)[source]

If object is a python list, then it is returned. Else, if object is a sub-class of endl2dmath its data is return otherwise a raise is executed.

fudge.legacy.endl.endl2dmathmisc.interpolate2dPoints(interpolation, x, x1, y1, x2, y2)[source]

This function interpolates y at x where x1 <= x <= x2 using interpolation.

fudge.legacy.endl.endl2dmathmisc.interpolate_X(data, x)[source]

For internal use only.

fudge.legacy.endl.endl2dmathmisc.point2d(x)[source]

Returns an endl2dmath instance of [ x, 1. ].

fudge.legacy.endl.endl2dmathmisc.point2dDull(x)[source]

Returns an endl2dmath instance of point2d( x ) that is dulled using dulledges2d( ).

fudge.legacy.endl.endl2dmathmisc.ramp2d(xMin, xMax, down=0)[source]

Returns an endl2dmath instance of a ramp from xMin to xMax with height 0 at xMin and 1 at xMax if down = 0, and 1 at xMin and 0 at xMax otherwise.

fudge.legacy.endl.endl2dmathmisc.ramp2dDull(xMin, xMax, down=0)[source]

Returns the endl2dmath instances returned by ramp2d( xMin, xMax, ramp ) and that is dulled using dulledges2d( ).

fudge.legacy.endl.endl2dmathmisc.triangle2d(x0, x1, x2)[source]

Returns an endl2dmath instance of a triangle that starts at x0 with height 0, ramps up to 1 at x1 and ramps down to 0 at x2.

fudge.legacy.endl.endl2dmathmisc.valid2dClassType(object, callingRoutine, msg)[source]

Returns the first argument, object, if it is a subclass of the endl2dmath class; else, triggers a raise.

fudge.legacy.endl.endl3dmathClasses module

This module contains the endl3dmath class. Also see the supporting module endl3dmathmisc.py.

class fudge.legacy.endl.endl3dmathClasses.endl3dmath(data=None, checkDataType=False, xLabel=None, yLabel=None, zLabel=None, label='unknown', interpolation=0, template=None)[source]

Bases: object

This class is designed to support operations on a list of 3-column number data that may be useful to scientists. (A number is an integer or a float.) In this documenation the three columns are referred to as x, y and z. The data is to be stored as a python list of [ x, yz-data-for-x ], where yz-data-for-x is a list of [ y, z ] data. For example, consider the 3 column data:

1 1 1
1 2 2
1 3 1
2 1 1
2 2 0
2 4 0
3 2 0
3 3 1
3 4 2

This data is stored using python lists as

[ [ 1, [ [ 1, 1 ], [ 2, 2 ], [ 3, 1 ] ] ],
  [ 2, [ [ 1, 1 ], [ 2, 0 ], [ 4, 0 ] ] ]
  [ 3, [ [ 2, 0 ], [ 3, 1 ], [ 4, 2 ] ] ] ]

Members:

data        | A python list of numbers.
columns     | This is always 3 as this is 1d data.
xLabel      | Labelled used as the x-Label when plotting.
yLabel      | Labelled used as the y-Label when plotting.
zLabel      | Labelled used as the z-Label when plotting.
copyData()[source]

Returns an endl3dmath instance that is a copy, and not a reference, of self.

copyDataToGridWsAndXsAndYs()[source]

A method to be like the W_XYs’ method of the same name. Used in the vis.matplotlib.plot2d module.

copyDataToW_XYs(wUnit=None, xUnit=None, yUnit=None)[source]

A function designed to work with fudgeMultiPlots.py. Not for general use.

dimension
getAtX(x, unitBase=False, extrapolation='noExtrapolation', endl2dmathObject=False)[source]

Calls endl3dmathmisc.interpolate3d to get self’s yz data at x.

getDimensions()[source]

Returns the dimensions (3 for endl3dmath) for this type of data.

getValue(x, y=None)[source]

Returns an endl2dmath instance of self evaluated at x if y is None. Otherwise, returns, as a float, the value of self at x, y. If x (y) is outside the range of self’s x (y) domain then 0. is returned.

plot(xMin=None, xMax=None, yMin=None, yMax=None, zMin=None, zMax=None, xyzlog=0, xLabel=None, yLabel=None, zLabel=None, title=None, xrot=None, zrot=None)[source]

Plots the data.

xyzlog values and meaning:

 xyzlog   plot-type for x-y-z axis
-----------------------------------
   0     linear-linear-linear
   1     log-linear-linear
   2     linear-log-linear
   3     log-log-linear
   4     linear-linear-log
   5     log-linear-log
   6     linear-log-log
   7     log-log-log
setAtX(x, data)[source]

Sets self’s yz data at x to data. Data can be a endl2dmath object.

toString(format=None)[source]

Returns the string returned by the endl3dmath’s __repr__ function. This can be useful when endl3dmath is used as a base class.

toStringWithPrefixSuffix(Prefix='', Suffix='')[source]

Returns a printable string of the data in self with Prefix and Suffix append to each line. See __repr__ to change the output format.

xArray()[source]

Returns an endl1dmath instances of the x values in self.

xMax()[source]

Returns the maximum x value of self if self contains data, otherwise it returns None.

xMin()[source]

Returns the minimum x value of self if self contains data, otherwise it returns None.

fudge.legacy.endl.endl3dmathmisc module

This module contains miscellaneous routines for supporting the endl3dmath class from module endl3dmathClasses.

Module’s global variables:

endl3d_repr_xFormat : Default format string used for converting an x-element of the data of an endl3dmath object to a string.
endl3d_repr_yFormat : Default format string used for converting an y-element of the data of an endl3dmath object to a string.
endl3d_repr_zFormat : Default format string used for converting an z-element of the data of an endl3dmath object to a string.
fudge.legacy.endl.endl3dmathmisc.check3dData(data, allowNegativeX=False, allowZeroX=True, allowNegativeY=False, allowSameY=False, allowZeroY=True, positiveZ=False, printWarning=True, printErrors=True, xCloseEps=None, maxAbsFloatValue=None)[source]

Checks that data is a valid structure for endl3dmath data. Triggers a raise if it is not. Data may be an instance that is a subclass of endl3dmath or a python list as required by endl3dmath. If allowZeroX is False, a zero first x value will generate a raise. If allowNegativeX is true than the x data can have negative values (ENDL 3d-data has projectile energy as the x-data which must always be > 0. ). See endl2dmathmisc.check2dData’s allowSameX, allowZeroX, positiveY and xCloseEps argument for meaning of allowSameY, allowZeroY, positiveZ and xCloseEps respectively. If printErrors is ‘True’ then errors are printed, and if at least one error exist, a raise will be executed. printWarning is just passed on to endl2dmathmisc.check2dData.

fudge.legacy.endl.endl3dmathmisc.get3dmathData(object, callingRoutine, msg)[source]

If object is a python list, then it is returned. Else, if object is a sub-class of endl3dmath its data is return otherwise a raise is executed.

fudge.legacy.endl.endl3dmathmisc.interpolate3d(x, data, unitBase=False, extrapolation='noExtrapolation', endl2dmathObject=False)[source]

Returns the interpolation of data (an endl3dmath object or suitable data) at x as a list of [y,z] pairs. If x is outside the domain of data, then [] is returned. If x is one of the x-values of data, then its yz-data is returned. Otherwise, for xl < x < xu where xl and xu are consecutive x-values in data linear interpolation is performed on the yz data of xl and xu. If unitBase is True, then unit base interpolation is performed.

fudge.legacy.endl.endl3dmathmisc.interpolate_XY(data, x, y)[source]

For internal use only.

fudge.legacy.endl.endl3dmathmisc.valid3dClassType(object, callingRoutine, msg)[source]

Returns the first argument, object, if it is a subclass of the endl3dmath class; else, triggers a raise.

fudge.legacy.endl.endl4dmathClasses module

This module contains the endl4dmath class. Also see the supporting module endl4dmathmisc.py.

class fudge.legacy.endl.endl4dmathClasses.endl4dmath(data, checkDataType=False, tLabel=None, xLabel=None, yLabel=None, zLabel=None, label='unknown', interpolation=0, template=None)[source]

Bases: object

This class is designed to support operations on a list of 4-column number data that may be useful to scientists. (A number is an integer or a float.) In this documenation the four columns are referred to as t, x, y and z. The data is to be stored as a python list of [ t, xyz-data-for-t ], where xyz-data-for-t is a list of [ x, yz-data-for-x ] and yz-data-for-x is a list of [ y, z ] data. For example, consider the 4 column data:

1 1 1 1
1 1 2 2
1 1 3 1
1 2 1 1
1 2 2 0
1 2 4 0
3 1 1 1
3 1 2 3
4 2 2 0
4 2 3 1
4 2 4 2

For this data there are 3 different t-values. The length of this data is 3, for the 3 different t-values. The first t-value has the data:

1 1 1
1 2 2
1 3 1
2 1 1
2 2 0
2 4 0
for which there are 2 x values, and the first having the data::
1 1 2 2 3 1

All this data is stored using python lists as

[ [ 1, [ [ 1, [ [ 1, 1 ],
                [ 2, 2 ],
                [ 3, 1 ]
              ]
         ],
         [ 2, [ [ 1, 1 ],
                [ 2, 0 ],
                [ 4, 0 ]
              ]
         ]
       ]
  ]
  [ 3, [ [ 1, [ [ 1, 1 ],
                [ 2, 3 ]
              ]
         ]
       ]
  ]
  [ 4, [ [ 2, [ [ 2, 0 ],
                [ 3, 1 ],
                [ 4, 2 ]
              ]
         ]
       ]
  ]
]

Note, the xyz data is store like the data in an endl3dmath class. That is, endl3dmath data looks like a list of [ t, 3d-data ]. However, the 3d part is not an endl3dmath class but is structured like the data in an endl3dmath class. Thus, to plot the xyz data for the (i+1)^th t-value of an endl4dmath instance fourD, create an endl3dmath object of the data as endl3dmath( fourD.data[i][1] ) and use the endl3dmath plot method.

Members ::
data | A python list of numbers. columns | This is always 4 as this is 1d data. tLabel | Labelled used as the t-Label when plotting. xLabel | Labelled used as the x-Label when plotting. yLabel | Labelled used as the y-Label when plotting. zLabel | Labelled used as the z-Label when plotting.
copyData()[source]

Returns an endl4dmath instance that is a copy, and not a reference, of self.

dimension
getDimensions()[source]

Returns the dimensions (4 for endl4dmath) for this type of data.

ll()[source]

Same as __repr__( ).

ls()[source]

Prints the number of items in the top list of self and then the number of items in each item of the top list.

plot(xMin=None, xMax=None, yMin=None, yMax=None, zMin=None, zMax=None, xyzlog=0, tLabel=None, xLabel=None, yLabel=None, zLabel=None, title=None, tScaleLabel=None, xrot=None, zrot=None, style=None)[source]

Plots the data.

xyzlog values and meaning are

 xyzlog   plot-type for x-y-z axis
-----------------------------------
   0     linear-linear-linear
   1     log-linear-linear
   2     linear-log-linear
   3     log-log-linear
   4     linear-linear-log
   5     log-linear-log
   6     linear-log-log
   7     log-log-log
tArray()[source]

Returns an endl1dmath instances of the t values in self.

tMax()[source]

Returns the maximum t value of self if self contains data, otherwise it returns None.

tMin()[source]

Returns the minimum t value of self if self contains data, otherwise it returns None.

toString(format=None)[source]

Returns the string returned by the endl4dmath’s __repr__ function. This can be useful when endl4dmath is used as a base class.

toStringWithPrefixSuffix(Prefix='', Suffix='')[source]

Returns a printable string of the data in self with Prefix and Suffix append to each line. See __repr__ to change the output format.

fudge.legacy.endl.endl4dmathmisc module

This module contains miscellaneous routines for supporting the endl4dmath class from module endl4dmathClasses.

Module’s global variables:

endl4d_repr_tFormat : Default format string used for converting an t-element of the data of an endl4dmath object to a string.
endl4d_repr_xFormat : Default format string used for converting an x-element of the data of an endl4dmath object to a string.
endl4d_repr_yFormat : Default format string used for converting an y-element of the data of an endl4dmath object to a string.
endl4d_repr_zFormat : Default format string used for converting an z-element of the data of an endl4dmath object to a string.
fudge.legacy.endl.endl4dmathmisc.check4dData(data, allowNegativeT=False, allowZeroT=True, allowNegativeX=False, allowZeroX=True, allowSameY=False, allowNegativeY=False, allowZeroY=True, positiveZ=False, printWarning=True, printErrors=True, xCloseEps=None, maxAbsFloatValue=None)[source]

Checks that data is a valid structure for endl4dmath data. Triggers a raise if it is not. Data may be an instance that is a subclass of endl4dmath or a python list as required by endl4dmath. If allowZeroT is False, a zero first t value will generate a raise.If allowNegativeT is true than the t data can have negative values (many ENDL 4d-data have projectile energy as the t-data which must always be positive). For meanings of allowNegativeX, allowZeroX, allowSameY, allowNegativeY, allowZeroY, positiveZ and xCloseEps see endl3dmathmisc.check3dData. If printErrors is ‘True’ then errors are printed, and if at least one error exist, a raise will be executed. printWarning is just passed on to endl3dmathmisc.check3dData.

fudge.legacy.endl.endl4dmathmisc.get4dmathData(object, callingRoutine, msg)[source]

If object is a python list, then it is returned. Else, if object is a sub-class of endl4dmath its data is return otherwise a raise is executed.

fudge.legacy.endl.endl4dmathmisc.plot3dFrom4d(data, i, options, xyzlog=0)[source]

For internal use only.

fudge.legacy.endl.endl4dmathmisc.string4dData(d, i0=0, i1=1, i2=2, i3=3, fmt0=None, fmt1=None, fmt2=None, fmt3=None)[source]

Returns a list of strings for data d. D must be list[ number, list[ number, list[ number, number ] ] ].

fudge.legacy.endl.endl4dmathmisc.valid4dClassType(object, callingRoutine, msg)[source]

Returns the first argument, object, if it is a subclass of the endl4dmath class; else, triggers a raise.

fudge.legacy.endl.endlFile module

This module contains the class endlFile. See class endlFile for usage.

class fudge.legacy.endl.endlFile.endlFile(designerFile, name, path, ZA, yi, halflife=None, bdflsFile=None)[source]

This class holds data that is contained in an ENDL file. (In general, this class should only be instantiated indirectly via methods in endlZA.) An ENDL data file can contains one or more related data sets, each specified by a unique set of X1, X2, X3, X4 values, for a specific set of yo, C, I and S values.

As example, for the cross section, I = 0, for inelastic scattering of a neutron, C = 11, the target may be left in different excited states. In ENDL ths cross sections to specific excited state, S = 1, are stored in a file named “yo00c11i000s001”, and the data for different excited states are distinguished by different excitation levels, X1-value, for the target. When the read method for this class gets the data from this file it creates a new endlI0 object for each data set and addes it to the levels member of this class. The number of data sets (i.e., length of levels) is return by the len method for the endlFile object.

No data is read in when the object is instantiated; instead, the read method must be explicitly called.

Useful Members::
name The file’s name. path The full path, include name, of this file. ZA The ENDL ZA-value for this file. ZA = 1000 * Z + A. yi The ENDL yi-value for this file. That is, the projectile for this file. yo The ENDL yo-value for this file. That is, the outgoing particle for this file. C The ENDL C-value for this file. I The ENDL I-value for this file. S The ENDL S-value for this file. levels A list of endlI* objects for each data sets in file. This is empty until the method read is called.
IsyoCIS(yo=None, C=None, I=None, S=None)[source]

Returns 1 if self matches yo, C, I and S, and 0 otherwise. yo may be a single integer or a list of integers and the same for C, I and S. For example self has yo = 7 and C = 3 then self.IsyoCIS( yo = (5, 6, 7), C=(3,4) ) will return a true.

addData(data=[], date=None, interpolation=0, eLevel=0.0, temperature=2.586e-08, Q=None, X1=0.0, X2=0.0, X3=0.0, X4=0.0, mass=None, halflife=None)[source]

Adds data to self with the header information provided.

addEndlData(endlData, overWrite=0)[source]

Adds the data in the endl object endlData to self. enldData must be of an endlI* class that must match self’s I class. For example, if self is I = 11 data then endlData be must an endlI11 object. Currently, overWrite is not implemented.

check(targetParameters, dQ_MeV=0.01, dThreshold_MeV=0.01, allowZeroE=False, xCloseEps=None, normTolerance=1e-05, maxAbsFloatValue=None)[source]

Checks self’s data if it as been read in. This is, it goes through the list levels, calling the appropriate routines to check data.

columns()[source]

Returns the number of data columns for self’s data. For example, for 3d data a 3 is returned.

info()[source]

Prints information about each level in self (i.e., call info for each element of self.levels.

ls()[source]

Prints file name, and level information for self.

read()[source]

Reads in the data from self’s file.

save(f)[source]

Saves data to file f where f is a python file type (e.g., sys.stdout).

setYiZAYoCISs(yi=None, ZA=None, yo=None, C=None, I=None, S=None)[source]

Fixes the headers in all of file’s levels to match yo, C, I and S. For input parameters that are None, self’s values are used. Also sets self’s yi and ZA to inputted values if they are other than None.

unreadData(X1=None, X2=None, X3=None, X4=None, Q=None)[source]

Removes self’s reference to data matching X1, X2, X3, X4 and Q. Note, the data may still be in the work directory if the file is not saved.

fudge.legacy.endl.endlIClasses module

This module contains all the classes for the various types of ENDL I data.

fudge.legacy.endl.endlIClasses.I1sToCommonGrids(I1List, muGridPerE=True)[source]

This routine takes a list of I = 1 data and puts their E and mu data onto a common grid. Note, this function may add points for which integral( d_mu P(E,mu) ) = 0 and not 1 (that is, the normalization method may fail).

fudge.legacy.endl.endlIClasses.endlAddIObject(f, yo, C, I, S, h, points, bdflsFile=None)[source]

For internal use only.

class fudge.legacy.endl.endlIClasses.endlI0(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 0 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

heat(T, lowerlimit=None, upperlimit=None, interpolationAccuracy=0.002, heatAllPoints=False, doNotThin=True, EMin=1e-11, heatBelowThreshold=True, removeClosePoints=True, heatAllEDomain=True)[source]

Calls crossSectionAdjustForHeatedTarget with self’s data. Returns an endl2dmath instance. See module crossSectionAdjustForHeatedTarget for more details.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='cross section (barn)', interpolation=0)[source]
toZAsFrame(newProjectileMass, newTargetMass, halflife, bdflsFile, ELevel=0.0)[source]
class fudge.legacy.endl.endlIClasses.endlI1(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 1 data.

check(normTolerance=1e-05, printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 1 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

checkMus(internal=False)[source]

This method checks that the mu values are reasonable. For two-body reactions, the mu domain must range from -1 to 1. For other data, the first mu value must starts at -1 if above threshold and must be greater than -1 if at (near) threshold.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor3d to fix threshold.

getEData(E)[source]

Returns an endl2dmath object for the data at incident energy E. If E is outside the domain of the data, then None is returned. If the requested E is not a point in the data then linear interpolation is performed.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

normalize()[source]

Normalizes the data so that the integral P(E, mu ) dmu = 1.

runningMuSum()[source]

Does a running sum of the mu data, returning an endl3dmath object of the results.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='mu', zLabel='pdf(E, mu) vs mu', interpolation=0)[source]
setEData(E, muP)[source]

This method adds muP at E. If E is in self than its distribution is over-written; otherwise, a new E is added.

toZAsFrame(newProjectileMass, newTargetMass, halflife, bdflsFile, ELevel=0.0)[source]
class fudge.legacy.endl.endlIClasses.endlI10(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 10 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='E to yo (MeV)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI11(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 11 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='E to res. (MeV)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI12(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 12, Q(E), data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='Q (MeV)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI13(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 13 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='momentum (MeV/c)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI20(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl4dmathClasses.endl4dmath

This class is for the I = 20 data. I 20 data is unresolved resonance probability table data which has four columns. These columns are 1) s incident energy, 2) Temperature, 3) probability and 4) cross section.

check(normTolerance=0.0001, printWarning=False, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 20 data and returns a list of endlCheckerObject instances. Also, calls the endl4dmathmisc.check4dData function. See endl4dmathmisc.check4dData for meaning of printWarning and printErrors.

copyData()[source]

Returns an endlI20 instance that is a copy, and not a reference, of self.

normalize()[source]

Normalizes the data so that the cdf’s are 1.

set(data, checkDataType=0, tLabel='E (MeV)', xLabel='Temperature (keV)', yLabel='probability', zLabel='cross section (barn)', interpolation=0)[source]
toString(format=None)[source]

Returns a string with the data in the order (E, T, P, Xsec) as required by ENDL.

class fudge.legacy.endl.endlIClasses.endlI21(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 21 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 21 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor3d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="E' (MeV)", zLabel="pdf(E, E') vs E' (1/MeV)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI22(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 22 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 22 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor3d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='x = 1 - mu', zLabel='pdf(E, x) vs x', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI3(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl4dmathClasses.endl4dmath

This class is for the I = 3 data.

E(i)[source]

Returns the (i+1)^th incident energy value as a float or None if i is out-of-range.

EIndexMu(iE, mu, unitBase=True)[source]

Returns an endl2dmath object that is the interpolation of self’s data at mu for energy index iE.

EMax()[source]

Returns the last incident energy value for self. Returns None if data is empty.

EMin()[source]

Returns the first incident energy value for self. Returns None if data is empty.

check(normTolerance=1e-05, printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 3 data and returns a list of endlCheckerObject instances. Also, calls the endl4dmathmisc.check4dData function. See endl4dmathmisc.check4dData for meaning of printWarning and printErrors.

convertToI4(i1=None, lmax=0)[source]

Converts the self and the I=1 data given as an argument to an endlI4 instance where the new object has Legendre orders 0, 1, …, lmax

copyData()[source]

Returns an endlI3 instance - that is a copy, and not a reference - of self.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor4d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getMuEpPAtE(E, extrapolation='noExtrapolation')[source]

Returns an endl3dmath object of P’( mu, E’ ) = P( E, mu, E’ ). E is compare to the incident energies in self and is considered to be a match if the difference is less than relEps. Also see muEpP.

getThresholdsForChecker()[source]

For internal use only.

mapMuEpPToGrid(E, relEps=1e-05)[source]

P( E = E, mu, E’ ) with mu, and E’ mapped to a grid determine from the mu and E’ points. Returns a endl3dmath object of list[ u, list[ E’, P( u, E’ ) ] ]. See muEpP( ) for meaning of relEps.

muEpP(E, relEps=1e-05)[source]

Returns an endl3dmath object of P’( mu, E’ ) = P( E, mu, E’ ). E is compare to the incident energies in self and is considered to be a match if the difference is less than relEps. Also see getMuEpPAtE.

normalize()[source]

Normalizes the data so that the integral P(E, mu, E’) dE’ = 1.

plot(E=None, xMin=None, xMax=None, yMin=None, yMax=None, zMin=None, zMax=None, xyzlog=0, tLabel=None, xLabel=None, yLabel=None, zLabel=None, title=None, style=None, xrot=None, zrot=None)[source]

Plots the data. If E = None uses 4d plotting otherwise uses 3d plotting for the requested E.

xyzlog values and meaning::
xyzlog plot-type for x-y-z axis
0 linear-linear-linear 1 log-linear-linear 2 linear-log-linear 3 log-log-linear 4 linear-linear-log 5 log-linear-log 6 linear-log-log 7 log-log-log
reduceToEEpP()[source]

Integrates the mu dimension, returning an endl3dmath object of list[ E, list[ E’, P( E, E’ ) ] ].

reduceToEMuP(normalize=False)[source]

Integrates the E’ dimension, returning an unnormalized (normalize = False) or normalized (normalize = True) endlI1 object.

runningEpSum()[source]

Does a running sum of the E’ data, returning an endl4dmath object of the results.

set(data, checkDataType=0, tLabel='E (MeV)', xLabel='mu', yLabel="E' (MeV)", zLabel="pdf(E, mu, E') vs E' (1/MeV)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI4(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl4dmathClasses.endl4dmath

This class is for the I = 4 data.

EMax()[source]

Returns the last incident energy value for self. Returns None if data is empty.

EMin()[source]

Returns the first incident energy value for self. Returns None if data is empty.

check(normTolerance=1e-05, printWarning=False, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 4 data and returns a list of endlCheckerObject instances. Also, calls the endl4dmathmisc.check4dData function. See endl4dmathmisc.check4dData for meaning of printWarning and printErrors.

convertToI1I3(nMu=21, lMax=None)[source]

This methods converts the I = 4 data into the endl I = 1 and I = 3 data using nMu equally spaced mu values. This method calls convertToUI3. The returned value is the tuple (I1, I3).

convertToUI3(nMu=21, lMax=None)[source]

This methods converts the I = 4 data into unnormalized I = 3 data using nMu equally spaced mu values. Note that the data is not normalized; hence, the normalized method should be called on the returned object. This method will only convert up to Legendre order l = min( lMax, series1d.maxLegendreOrder ) of self’s data.

copyData()[source]

Returns an endlI4 instance that is a copy, and not a reference, of self.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor3d to fix threshold for each l-order data.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

getlData(l)[source]

Returns an endl3dmath object for the data at Legendre order l. If l is outside the domain of the data, then None is returned.

getl_EData(l, E, unitBase=True)[source]

Returns an endl2dmath object for the data at Legendre order l and incident energy E. If l or E is outside the domain of the data, then None is returned. If the requested E is not a point in the data then linear interpolation is performed. If unitBase is true, the Ep, P(l,E,Ep) data are unit based linear interpolated.

l(i)[source]

Returns the (i+1)^th Legendre l-value (e.g., self.l( 0 ) returns the first l-value) or None if i is out-of-range.

normalize(doL_0_Only=True)[source]

Normalizes the l = 0 data so that the integral P(l = 0, E, E’) dE’ = 1. If doL_0_Only is true, then only the l = 0 component is normalizes. Otherwise, the l = 0 sum is used to normalize all orders. The return value the tuple (n0, nm) where n0 (nm) is the number of sum that are zero (negative).

plot(l=None, xMin=None, xMax=None, yMin=None, yMax=None, zMin=None, zMax=None, xyzlog=0, tLabel=None, xLabel=None, yLabel=None, zLabel=None, title=None, xrot=None, zrot=None)[source]

Plots the data for Legendre order l.

xyzlog values and meaning::
xyzlog plot-type for x-y-z axis
0 linear-linear-linear 1 log-linear-linear 2 linear-log-linear 3 log-log-linear 4 linear-linear-log 5 log-linear-log 6 linear-log-log 7 log-log-log
reduceToEEpP()[source]

Returns the l = 0 term as an endl3dmath object of list[ E, list[ E’, P( E, E’ ) ] ]. Note, the l = 0 term is P( E, E’ ).

set(data, checkDataType=0, tLabel='l', xLabel='E (MeV)', yLabel="E' (MeV)", zLabel="Legendre coef. C_l(E, E') vs E' (1/MeV)", interpolation=0)[source]
setlData(l, EEpP)[source]

Set data for Legendre order l to EEpP. EEpP can be an endl3dmath object or a suitable python list. The l-value must be an existing l-value or one greater than the current maximum l-value.

setl_EData(l, E, EpP)[source]

Set data for Legendre order l and incident energy E to EpP. EpP can be an endl2dmath object or a suitable python list. The l-value must be an existing l-value or one greater than the current maximum l-value.

toString(format=None)[source]

Returns a string with the data in the order (E, E’, l, P) as required by ENDL.

toZAsFrame(newProjectileMass, newTargetMass, halflife, bdflsFile, ELevel=0.0)[source]
class fudge.legacy.endl.endlIClasses.endlI7(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 7 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='nu_bar', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI80(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 80 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="T ave'd rates (barn * cm/sh)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI81(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 81 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 81 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='T (MeV)', yLabel='E (MeV)', zLabel='cross section (T, E)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI84(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 84 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 84 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="E' (MeV)", zLabel="f(T, E')", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI89(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 89 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='multiplicity tn', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI9(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 9 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

fixThreshold(thresholdCrossSectionIsZero, threshold, dThreshold_MeV=0.01, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]

Calls endlIClasses.fixThresholdFor2d to fix threshold.

getEMin_EMinNext()[source]

Gets the first two Energy values from self’s data. None is return for any absent value.

getThresholdsForChecker()[source]

For internal use only.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='multiplicity', interpolation=0)[source]
toZAsFrame(newProjectileMass, newTargetMass, halflife, bdflsFile, ELevel=0.0)[source]
class fudge.legacy.endl.endlIClasses.endlI90(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 90 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="T ave'd E to yo (MeV)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI91(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 91 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="T ave'd E to res. (MeV)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI92(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 92 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='T (MeV)', yLabel="T ave'd total E (MeV)", interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI941(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 941 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=True, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='form factor', interpolation=0)[source]
toInterpolation(interpolation, accuracy, diSectionMax=3)[source]
class fudge.legacy.endl.endlIClasses.endlI942(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 942 data.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=True, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='scattering function', interpolation=0)[source]
toInterpolation(interpolation, accuracy, diSectionMax=3)[source]
class fudge.legacy.endl.endlIClasses.endlI951(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl2dmathClasses.endl2dmath

This class is for the I = 951 data. Special I value for NADS.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Calls the endl2dmathmisc.check2dData function and returns a list of endlCheckerObject instances. See endl2dmathmisc.check2dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel='cross section * v (barn * cm/sec)', interpolation=0)[source]
class fudge.legacy.endl.endlIClasses.endlI952(f, yo, C, I, S, h, points, bdflsFile=None)[source]

Bases: fudge.legacy.endl.endlNd.endlNd, fudge.legacy.endl.endl3dmathClasses.endl3dmath

This class is for the I = 952 data. Special I value for NADS.

check(printWarning=True, printErrors=True, xCloseEps=None, allowZeroE=False, maxAbsFloatValue=None, **arg)[source]

Checks to see that the data is consistance with I = 952 data and returns a list of endlCheckerObject instances. Also, calls the endl3dmathmisc.check3dData function. See endl3dmathmisc.check3dData for meaning of printWarning and printErrors.

set(data, checkDataType=0, xLabel='E (MeV)', yLabel="E' (MeV)", zLabel="P(E, E')", interpolation=0)[source]
fudge.legacy.endl.endlIClasses.fixThresholdFor2d(self, thresholdCrossSectionIsZero, threshold, dThreshold_MeV, thresholdValue, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]
fudge.legacy.endl.endlIClasses.fixThresholdFor3d(self, thresholdCrossSectionIsZero, I, threshold, dThreshold_MeV, EMin=0.0, realSelf=None, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]
fudge.legacy.endl.endlIClasses.fixThresholdFor4d(self, thresholdCrossSectionIsZero, threshold, dThreshold_MeV, EMin=0.0, fixThresholdMode='raiseOnly', threshold_MeV_shiftWarning=0.1)[source]
fudge.legacy.endl.endlIClasses.fixThresholdTest(threshold, dThreshold_MeV, EMin, EMin_, fixThresholdMode)[source]
fudge.legacy.endl.endlIClasses.getThresholdsForChecker2d(self)[source]
fudge.legacy.endl.endlIClasses.toZAsFrameMisc(endlI, old, newProjectileMass, newTargetMass, ELevel, halflife, bdflsFile, firstParameterEIn)[source]

fudge.legacy.endl.endlIClassesParameters module

fudge.legacy.endl.endlNd module

This module contains the class endlNd which contains methods common to data of any (N) dimension.

class fudge.legacy.endl.endlNd.endlNd(f, I_, yo, C, I, S, h, points, i0=0, i1=1, i2=None, i3=None, bdflsFile=None)[source]

Useful Members (all of these should be accessed via get/set methods):

h               The ENDL header for this data.
ZA              The ENDL ZA for this data. That is, the target for this file.
yi              The ENDL yi-value for this data. That is, the projectile for this file.
yo              The ENDL yo-value for this data. That is, the outgoing particle for this file.
C               The ENDL C-value for this data.
I               The ENDL I-value for this data.
S               The ENDL S-value for this data.
X1, X2, X3, X4  The X-vales for this data.
ELevel          The initial excitation level of the target for this data.
Halflife        The halflife of the target.
Temperature     The temperature of the target for this data.
checkHeader(index=None)[source]

For internal use only.

cmpyoCISX1(other, epsX1)[source]

Compares yo, C, I, S and X1 values of self to other and returns 1 if they are the same and 0 otherwise. The X1 values can differ by as much as epsX1.

compareQXs(Q, X1, X2, X3, X4)[source]

Return -1 if self’s values < (Q, X1, X2, X3, X4), 0 if equal and 1 otherwise.

determineQandThreshold(Q=None, specialCases=0)[source]
getDate()[source]

Returns the target’s date.

getELevel()[source]

Returns the target’s excitation level.

getENDLInterpolation()[source]

Returns the target’s ENDL interpolation flag. 0 or 2 is lin-lin, 3 is log-lin, 4 is lin-log and 5 is log-log. Also see getInterpolation.

getFormat()[source]

Returns the target’s format specifier.

getHalflife()[source]

Returns the target’s halflife.

getInterpolation()[source]

Returns the target’s fudge interpolation flag. 0 is lin-lin, 1 is log-lin, 2 is lin-log and 3 is log-log. Also see getENDLInterpolation.

getLifetime()[source]

Deprecated method. Use getHalflife instead.

getMass()[source]

Returns the target’s mass.

getQ()[source]

Returns the Q value for self’s reaction.

getTemperature()[source]

Returns the taget’s temperature.

getX1()[source]

Returns the X1 value for this data.

getX2()[source]

Returns the X2 value for this data.

getX3()[source]

Returns the X3 value for this data.

getX4()[source]

Returns the X4 value for this data.

getYi()[source]

Returns projectile’s identifier, yi value.

getYo()[source]

Returns the outgoing particle’s identifier, yo value.

getZA()[source]

Returns the targets ZA value.

info()[source]

Prints information about self’s data.

save(f=None)[source]

Writes header and data to file f where f is a python file type (e.g., sys.stdout). If f is None then writes data to sys.stdout.

setC(C)[source]

Sets self’s C value and self’s header C value to C.

setDate(date=None)[source]

Sets self’s data and self’s header date value to data. If date is None then today’s date is used.

setELevel(ELevel)[source]

Sets self’s ELevel value and self’s header ELevel value to ELevel.

setFormat(width)[source]

Sets self’s format specifier and self’s header format specifier value to width.

setHalflife(Halflife)[source]

Sets self’s Halflife value and self’s header Halflife value to Halflife.

setI(I)[source]

Sets self’s I value and self’s header I value to I.

setLifetime(Halflife)[source]

Deprecated method. Use setHalflife instead.

setMass(Mass)[source]

Sets self’s Mass value and self’s header Mass value to Mass.

setQ(Q)[source]

Sets self’s Q value and self’s header Q value to Q.

setQandThreshold(thresholdCrossSectionIsZero, Q, threshold, fixThresholdMode=None, dThreshold_MeV=0.01, EMin=0.0, threshold_MeV_shiftWarning=0.1)[source]
setS(S)[source]

Sets self’s S value and self’s header S value to S.

setTemperature(T)[source]

Sets self’s Temperature value and self’s header Temperature value to T.

setX1(X1)[source]

Sets self’s X1 value and self’s header X1 value to X1.

setX2(X2)[source]

Sets self’s X2 value and self’s header X2 value to X2.

setX3(X3)[source]

Sets self’s X3 value and self’s header X3 value to X3.

setX4(X4)[source]

Sets self’s X4 value and self’s header X4 value to X4.

setYi(yi)[source]

Sets self’s yi value and self’s header yi value to yi. yi must be an integer or a string convertible to an integer.

setYiZAYoCIS(yi=None, ZA=None, yo=None, C=None, I=None, S=None)[source]

For input parameters that are not None, sets self’s value to input parameter.

setYo(yo)[source]

Sets self’s yo value and self’s header yo value to yo. yo must be an integer or a string convertible to an integer.

setZA(ZA)[source]

Sets self’s ZA value and self’s header ZA value to ZA. ZA must be an integer or a string convertible to an integer.

fudge.legacy.endl.endlNd.readNdEndlData(f, i0, i1, i2=None, i3=None)[source]

For internal use only.

fudge.legacy.endl.endlParameters module

This module contains the paraments endlEpsx, endlSmallx and endlLargex.

fudge.legacy.endl.endlProject module

The main content of this module is the class endlProject.

To resolve the location of the bdfls file, endlProject does the following,
  1. Uses the bdflsFileName argument if it is None; else,
  2. Uses “./bdfls” if it exists; else,
  3. Uses the bdfls in the database (at the same level as the “ascii” file) if it exists; else,
  4. Uses the bdfls pointed to by the environmental variable BDFLSPATH if it exists; else,
  5. Uses “/usr/gapps/data/nuclear/bdfls”.
class fudge.legacy.endl.endlProject.endlProject(database=None, projectile=None, yi=None, workDir=None, delWorkDirWhenDone=0, readOnly=0, release='current', bdflsFile=None, cleanWorkDirOfZAs=False)[source]
ZA(ZA, suffix='')[source]

Returns a reference to the endlZA matching ZA in self. ZA is passed to endlmisc.intZA and its return value to used for matching ZAs. If ZA has not been instantiated then None is returned.

ZAList(Z=None, A=None, suffix='')[source]

Returns a list of ZA sub-directories in self’s database matching Z and A.

addZA(ZA, suffix='')[source]

Adds a new empty endlZA class to self and returns a reference to it. Also see readZA.

getDocumentation()[source]

Return None if there is not documentation file, otherwise, the text of the documentation file is returned.

getMass()[source]

Returns the mass of the projectile in MeV.

info()[source]

Prints yi, the database directory name, za sub-directory name, work directory name and delWorkDirWhenDone flag for self.

ll(Z=None, A=None, suffix='', w=5)[source]

Prints a table of all ZA directories in self’s default source database that match Z and A. The table is printed with w columns.

ls()[source]

Prints a list of ZAs instantiated in self.

process(oldfile, newfile=None, options='', defines=[], bdflsFile=None, ndfgen=None, mcfgen=None, endep=None, extraZAs=[])[source]

Processes the active ZAs in self, using oldfile as a template to create newfile. Active ZAs are ones that have been read-in-to (readZA) or added-to (addZA) self. Uses bdfls pointed to by bdflsFile if not None; otherwise, used search in the standard algorithm. The options argument sets internal flags (see below). The defines argument must contain a list of ksh environmental assignments (e.g., defines = ( ‘greeting=”Hello world”’, ‘NDFGENINPUTSPATH=./ndf.inputs’ ), note that since “Hello world” is 2 words, it is quoted).

Valid options are::
-i Creates a “.index” file (this should generally be included),
-u Update: newfile is oldfile amended by the active ZAs, otherwise newfile only contains the active ZAs in self,
-v Verbose mode (additional information is printed to screen and intermediate files are kept,
-e Stop processing after endep has been called (mainly for internal use).

All options can be negated by prepending with ‘no_’ (e.g., -no_u’).

read(target, database=None)[source]
readZA(ZA, database=None, suffix='')[source]

Reads in ZA from database, creating a new endlZA in self. If database = None, the database from self is used. Also see addZA.

remove(target)[source]

Removes self’s reference to target and deletes target’s directory from self’s work directory (i.e., if process( ) is called this target will not be processed). Also see unread.

removeZA(ZA, suffix='')[source]

Removes self’s reference to ZA and deletes ZA’s directory from self’s work directory (i.e., if process( ) is called this ZA will not be processed). Also see unreadZA.

save()[source]

Saves all ZAs instantiated within self.

saveProcess(oldfile, newfile=None, options=' -i -u ')[source]

Saves all ZAs instantiated within self and then calls process( oldfile, newfile, options ).

targetList(Symbol=None, A=None, suffix=None)[source]

Returns a list of target sub-directories in self’s database matching Symbol, A and suffix.

unread(target)[source]

Removes self’s reference to target, but does not delete target’s directory from self’s work directory (i.e., if process( ) is called this target will be processed). Also see remove.

unreadZA(ZA, suffix='')[source]

Removes self’s reference to ZA, but does not delete ZA’s directory from self’s work directory (i.e., if process( ) is called this ZA will be processed). Also see removeZA.

fudge.legacy.endl.endlProject.exit()[source]

Does some house cleaning and then exits python. This is the recommended way to exit fudge.

fudge.legacy.endl.endlProject.ll()[source]

Currently, the same as ls( ).

fudge.legacy.endl.endlProject.ls()[source]

List instantiated databases.

fudge.legacy.endl.endlProject.removeProject(p, delWorkDirWhenDone=None)[source]

Removes endlProject p from Fudge’s internal list and returns None.

fudge.legacy.endl.endlReactionParameters module

class fudge.legacy.endl.endlReactionParameters.endlReactionParameters(C, S, X1, X2, X3, X4, Q)[source]

This class contains the parameters C, S, X1, X2, X3, X4, Q for a reaction.

toPythonList()[source]

Returns the [ self.C, self.S, self.X1, self.X2, self.X3, self.X4, self.Q ]

fudge.legacy.endl.endlSplit module

fudge.legacy.endl.endlSplit.endlSplit(file, outDir, endlretHeaders=True, verbose=0, format=None)[source]

The function undoes what endlret does. That is, it takes an ascii file with a collect of isotopes in ENDL ascii format, and splits the isotopes up into separate ‘za’ directories with the appropriate ‘yo’ files. The za directories are placed in outDir.

fudge.legacy.endl.endlZA module

This module contains the class endlZA.

class fudge.legacy.endl.endlZA.endlZA(ZA, yi, database=None, release='current', workDir=None, suffix='', readOnly=0, bdflsFile=None)[source]

This class contains the information for an ENDL za.

CList()[source]

Returns the list of sorted C-values for self.

SListForC(C)[source]

Returns the list of S-values for C-value of self.

SXList(C)[source]

Returns a sorted list of S- and X-values (and Q) for all reaction of type C in self, excluding S = 7.

addEndlFile(endlfile, replace=0, checkHeaders=1, halflife=None, templateData=None)[source]

Adds endlFile instance endlfile to self. If replace is 0 and file exist in self, then a raise is executed. If replace is 1 and file exist, a warning message is printed and endlfile replaces the existing file. If replace is niether 0 or 1, any existing file in self is replaced by endlfile without any notification. If checkHeaders is true, the headers of endlfile are compared to other headers in self, and modified if needed. A reference to endlfile is returned.

addFile(yo, C, I, S, halflife=None, printWarnings=True)[source]

Adds the (yo, C, I, S) file to endlZA. If the file already exist a raise is executed.

adjustcs(C=10, S=None, X1=None, X2=None, X3=None, X4=None, Q=None, f=5e-05, csRelChangeNotice=0.1)[source]

Adjust the cross section given by C, S, X1, X2, X3, X4 and Q so that the total cross section remains fixed. If C = 1 (i.e., total cross section), then the total is adjusted to keep the others at there current values.

adjustcsWithWeights(CsNWeights, f=5e-05, total=None)[source]

Adjusts the cross sections given by CsNWeights, so that the total cross section remains fixed. CsNWeights is a list of C-value and weight. For example, a CsNWeights of [ [ 10, 6 ], [ 11, 4 ], [ 12, 2 ] ] would adjust the C = 10 cross section by 50% of the different, the C = 11 cross section by 33.3% of the different and the C = 12 cross section by 16.7% of the different. Relative total cross section less than f are set to 0.

changeFileYoCIS(file, yo, C, I, S, deleteOldFile=True)[source]

Changes endlFile object file’s yo-, C-, I- and S-values to yo, C, I and S. If deleteOldFile is true, the old file is deleted (a new file is not created unless method save is called).

check(dQ_MeV=0.01, dThreshold_MeV=0.01, xCloseEps=None, checkForEnDepData=False, normTolerance=1e-05, allowZeroE=False, checkList={}, crossSectionsOnly=False, maxAbsFloatValue=None)[source]

Checks all read in data in self.

clean()[source]

Removes all I=10 and I=11 data files from self.

convertI4ForOldProcessing(nMu=21, lMax=None, skipIf_deuteron_S8=True)[source]

This method finds all I = 4 data with Legendre order greater than 0 in self and converts it into I = 1 and 3 data so the mcfgen can process it. See method convertToUI3 in class endlI4 for meaning of nMu and lMax. If skipIf_deuteron_S8 is true, than for ZA == 1002 the S = 8 data is not converted as mcfgen was designed to ignore this data in ENDL94 and its descendent data sets.

convertS7ForOldProcessing()[source]

This method removes all S = 7, fission delayed nuclear data, data except I = 7 data and collapses the I = 7 data to a single data set, since ndfgen cannot handle non I = 7, S = 7 data and can only handle a single I = 7, S = 7 data set.

cs(C, S=None, X1=None, X2=None, X3=None, X4=None, Q=None)[source]

Calls findData( 0, C, 0, S, X1, X2, X3, X4, Q ) and returns the item. Deprecated method, will not be in version 4.

file(yo=None, C=None, I=None, S=None)[source]

Deprecated method, use findFile instead. This method will not be in version 4.

files(yo=None, C=None, I=None, S=None)[source]

Deprecated method, use findFiles instead. This method will not be in version 4.

findData(yo=None, C=None, I=None, S=None, X1=None, X2=None, X3=None, X4=None, Q=None, ifMultipleReturnFirst=False)[source]

Returns a single item matching yo, C, I, S, X1, X2, X3, X4 and Q.

findDatas(yo=None, C=None, I=None, S=None, X1=None, X2=None, X3=None, X4=None, Q=None)[source]

Returns a list of items matching yo, C, I, S, X1, X2, X3, X4 and Q. yo, C, I and S can be a list of integers (e.g., findDatas( C = [ 10, 11 ] ). The value None means to match all.

findFile(yo=None, C=None, I=None, S=None)[source]

Returns reference to file matching yo, C, I and S. If no file matches, None is returned. If multiple files match, an FUDGE_Exception is raised.

findFiles(yo=None, C=None, I=None, S=None)[source]

Returns a list of files matching yo, C, I and S

findItem(yo=None, C=None, I=None, S=None, X1=None, X2=None, X3=None, X4=None, Q=None)[source]

Deprecated method, use findData instead. This method will not be in version 4.

findItems(yo=None, C=None, I=None, S=None, X1=None, X2=None, X3=None, X4=None, Q=None)[source]

Deprecated method, use findDatas instead. This method will not be in version 4.

findReactionsDatas()[source]

Returns a list of reactionDatas for each reaction in self where reactionDatas is a list of all data for a reaction.

fixHeaders(yi=None, ZA=None, ELevel=None, temperature=None, dTemperatureEps=0.0001)[source]

This method makes the headers for all the data in self be consistent (e.g., makes all the temperatures the same). Items the are made consistent are ZA, yi, mass, ELevel, halflife, temperature amoung all the data and yo, C, I and S within a file. yi, ZA, ELevel and temperature can be inputted. For input parameters of None, the C = 10, I = 0 file values are used. If this file does not exist, a raise is executed, Mass and halflife are retrieved from the bdfls file.

fixQandThresholds(specialCases=1, fixThresholdMode='raiseOnly', dThreshold_MeV=0.01, EFloor=1e-11, threshold_MeV_shiftWarning=0.1)[source]

This methods fixes all the Qs and thresholds for all the data in self. Also, this method makes sures that the first energy point is greater than or equal to EFloor for all data. If the threshold is moved by more than threshold_MeV_shiftWarning, a warning is printed.

fixupReactions(fixReactions=None, fixReactionsEps=0.001, fixReactionsQuery=True)[source]

If the parameter fixReactions is one (or a list containing one or more) of the following ‘Q’, ‘X1, ‘X2, ‘X3’ or ‘X4’, this method will try to find data sets which are not considered to be for the same reaction due to slightly different value(s) in the members as given by fixReactions, but are within fixReactionsEps (e.g., fixReactions = [‘Q’, ‘X1’]). If fixReactionsQuery is true, you will be asked for your option on reaction parameters that this method deems the same.

getDocumentation()[source]

Return None if there is not documentation file, otherwise, the text of the documentation file is returned.

heat(T, interpolationAccuracy=0.002, heatAllPoints=False, doNotThin=True, EMin=1e-11, heatBelowThreshold=True, removeClosePoints=True, heatAllEDomain=True)[source]

Calls heat method for all cross section data (i.e., I = 0). and sets the temperature in the header for all data to T.

info()[source]

Prints Source, Z, mass and halflife for self.

ll(yo=None, C=None, I=None, S=None)[source]

Prints a long listing of the data in self.

llcs(C=None, S=None)[source]

Prints a long listing of cross sections, same as ll( yo = None, C, I = 0, S ). Deprecated method, will not be in version 4.

ls(yo=None, C=None, I=None, S=None, w=3)[source]

Prints a short listing of the data in self.

lscs(C=None, S=None, w=3)[source]

Prints a short listing of cross sections, same as ls( yo = None, C = C, I = 0, S = S, w = w ). Deprecated method, will not be in version 4.

plotcs(C=1, S=None)[source]

Plots cross section data for C_Value = C and S_Value = S. Deprecated method, will not be in version 4.

reactionList()[source]

Returns a list of all possible reactions (excluding C = 1). Each element of the list is a list of [ C, S, X1, X2, X3, X4, Q ] for a reaction.

read(yo=None, C=None, I=None, S=None, printWarning=True)[source]

Reads in all data matching yo, C, I and S. If printWarning is True and data has already be read in, a warning message is printed.

readIfNotRead(yo=None, C=None, I=None, S=None)[source]

Reads in all data matching yo, C, I and S which is not currently read in.

readcs(C=None, S=None)[source]

Reads in all unread cross section data with C_Value = C and S_Value = S. Deprecated method, will not be in version 4.

removeFile(yo=None, C=None, I=None, S=None)[source]

Removes self’s reference to all files matching yo, C, I and S and deletes them from the working directory. Also see unreadFile.

save(yo=None, C=None, I=None, S=None, path=None, file=None)[source]

Saves all data matching yo, C, I and S to path = path and file = file. In general file should not be specified.

savecs(C=None, S=None, path=None)[source]

Saves all cross section data matching C and S. Deprecated method, will not be in version 4.

setDocumentation(text)[source]

Sets self’s documentation text to text.

sumcs()[source]

Returns a endl2dmath object for the sum of all cross secitions for reactions 10 <= C < 50.

syncLevelEnergies(checkOnly=False, isomerMinimumHalflife=None)[source]

Synchronizes the level energies of the target, and discrete states of the residual with a database containing the accepted level energies for all nuclei. The residual level energies are synchronized for both the inelastic S=1 data (X1), and isomers (X4). Checks that the isomer level labels m? are consistent with the levels given in the database. If checkOnly = True then only check against database and print differences, else if checkOnly = False then make the changes to the data. If isomerMinimumHalflife is given then sets this variable in the Levels class before performing sync.

toGNDS(evaluationLibrary, evaluationVersion, excludeAverageProductData=True, testing=False, verbose=0)[source]
toZAsFrame(workDir=None, I3ToI4lMax=0)[source]

This methods boosts the data in self to invert the projectile/target particles.

unreadFile(yo=None, C=None, I=None, S=None)[source]

Removes self’s reference to all files matching yo, C, I and S. Also see removeFile.

fudge.legacy.endl.endl_C module

This module contains a set of routines that return information about the outgoing particles for a given C-value as defined in ENDL.

fudge.legacy.endl.endl_C.endl_CLabel(C)[source]

Returns a short string (i.e., mnemonic) describing the outgoing particles - called yos in ENDL - or reaction type for the specified C-value. If C-value is not defined then None is returned.

fudge.legacy.endl.endl_C.endl_CLabelMaxWidth()[source]

Returns the maximum length of a string returned by endl_CLabel.

fudge.legacy.endl.endl_C.endl_C_CList()[source]

Returns a list of C-values.

fudge.legacy.endl.endl_C.endl_C_yoInfo(C)[source]

Returns a tuple of integers describing the outgoing particles - called yos in ENDL - for the specified C-value, or a negative number (see “Special cases …” below) if outgoing particle types/numbers are not defined. Each particle is defined by its ZA = 1000 * Z + A value, with the exceptions of gammas, positrons and electrons whose integer designations are 7, 8 and 9 respectively. For example, neutron, Helium-3 and Pu-239 are designated as 1, 2003 and 94239 respectively. If C-value is not defined then None is returned.

Special cases for first integer of returned tuple::
-1 Unknown outgoing particles.
-2 Outgoing particle is the same as the incident particle.
-3 Unknown number of fission neutrons.
-4 Unknown number of particles of type of the second integer of the tuple.
fudge.legacy.endl.endl_C.endl_C_yosMultiplicity(C, yi)[source]

Returns the list [ nn, np, nd, nt, nHe3, na, ng ] where nn is the multiplicity for neutrons, np is the multiplicity for protons, etc. If C-value is not defined then None is returned. If the reaction is fission then -1 is returned for neutron multiplity (i.e., C = 15 returns [ -1, 0, 0, 0, 0, 0, 0 ] ). If multiplity for a particle is indeterminate then -2 is returned for that multiplity. If multiplicities are undefined then nYos * [ None ] is returned. yi is only needed for elastic (C = 10) scattering.

fudge.legacy.endl.endl_C.endl_nCMax()[source]

Returns the largest C-value for which information exist.

fudge.legacy.endl.endl_I module

This module contains a set of routines that return information about ENDL I-values.

fudge.legacy.endl.endl_I.endl_IColumns(I)[source]

Returns the number of columns of data for the specified I-value. If I-value is not defined than ‘None’ is returned.

fudge.legacy.endl.endl_I.endl_ILabel(I)[source]

Returns a mnemonic string for the specified I-value. If I-value is not defined than ‘None’ is returned.

fudge.legacy.endl.endl_I.endl_ILabelMaxWidth()[source]

Returns the maximum length of a string returned by endl_ILabel.

fudge.legacy.endl.endl_Z module

This module contains a set of routines that return the symbol or name for an element.

fudge.legacy.endl.endl_Z.endl_ZLabel(Z)[source]

Returns the label (i.e., name) for the specified Z or ‘None’ if Z is out-of-bounds.

fudge.legacy.endl.endl_Z.endl_ZLabelToZ(label)[source]

Returns the Z for the specified label or ‘None’ if no match for label.

fudge.legacy.endl.endl_Z.endl_ZSymbol(Z)[source]

Returns the symbol for the specified Z or ‘None’ if Z is out-of-bounds.

fudge.legacy.endl.endl_Z.endl_ZSymbolToZ(symbol)[source]

Returns the Z for the specified symbol or ‘None’ if no match for symbol.

fudge.legacy.endl.endl_Z.endl_nZs()[source]

Returns the number of elements, starting at neutron with Z = 0, for which data is present. The largest element for which information can be obtained has Z = endl_nZs( ) - 1.

fudge.legacy.endl.endl_y module

This module contains a set of routines that return the symbol or name for an ENDL incident, yi, or outgoing, yo, particle designator.

fudge.legacy.endl.endl_y.endl_yLabel(y)[source]

Returns the symbol for the specified y or ‘None’ if y is out-of-bounds.

fudge.legacy.endl.endl_y.endl_yLabelMaxWidth()[source]

Returns the maximum length of a string returned by endl_yLabel.

fudge.legacy.endl.endl_y.endl_yLongLabel(y)[source]

Returns the label (i.e., name) for the specified y or ‘None’ if y is out-of-bounds.

fudge.legacy.endl.endl_y.endl_yLongLabelMaxWidth()[source]

Returns the maximum length of a string returned by endl_yLongLabel.

fudge.legacy.endl.endlmath module

This module contains useful fudge math routines that do not fit into any other module.

fudge.legacy.endl.endlmath.YSum(data)[source]

Returns the area under the curve y(x). Data must be list of list( x, y ).

fudge.legacy.endl.endlmath.ZSum(data)[source]

Returns the area under the curve z(y) for each x as an endl2dmath object. Data must be list of ( x, list of ( y, z ) ).

class fudge.legacy.endl.endlmath.fastSumOfManyAddends[source]

Bases: object

This class in designed to sum a lot of endl2dmath or fudge2dmath object together efficiently. For example, consider the list f2d of 100,000 fudge2dmath objects that are to be summed. One way to do this is as s = fudge2dmath( ) for f in f2d : s = s + f

In general, this is very inefficient and will take a long time. Using, this class as

fs = fastSumOfManyAddends( ) for f in f2d : fs.appendAddend( f ) s = fs.returnSum( )

is, in general, much more efficient (i.e., runs a lot faster) and it should never be less efficient.

While this class was designed for endl2dmath and fudge2dmath objects, it should work for any object for which the ‘+’ operation is defined.

appendAddend(addend)[source]

Adds addend to current sum efficiently.

clear()[source]

Clears currently summed data.

returnSum()[source]

Returns the current sum of all addends appended.

fudge.legacy.endl.endlmath.getValue(n)[source]
fudge.legacy.endl.endlmath.runningYSum(data, normalize=False)[source]

Returns the running sum of dx * y (normalized to 1 of normalize is True) as an endl2dmath object. Data must be list of ( x, y ).

fudge.legacy.endl.endlmath.runningZSum(data, xLabel=None, yLabel=None, zLabel=None, normalize=False)[source]

Returns the running sum of dy * z (normalized to 1 of normalize is True) for each x as an endl3dmath object. Data must be list of ( x, list of ( y, z ) ).

fudge.legacy.endl.endlmisc module

This module contains miscellaneous functions related to ENDL.

fudge.legacy.endl.endlmisc.appendyiDirIfNeeded(path, yi)[source]

Appends the sub-directory yi## if it is not the last sub-directory of path. ## is yi convert to a 2-digit integer.

fudge.legacy.endl.endlmisc.checkCulling(errs, cullStrings)[source]

Removes all messages containing sub-strings listed in cullStrings. cullStrings can be either a string or a list of strings. If as list of strings, each string must be a sub-string in a message for the message to be culled.

fudge.legacy.endl.endlmisc.checkMessagesToString(message, indentation=' ', subIndentation=' ')[source]
fudge.legacy.endl.endlmisc.check_mapMuEpToGrid(data)[source]

For internal use only.

fudge.legacy.endl.endlmisc.copyEndlHeader(Desc, Src)[source]

This needs to be documented.

class fudge.legacy.endl.endlmisc.endlCheckerObject(data=None, database=None, yi=None, ZA=None, suffix=None, yo=None, C=None, I=None, S=None, X1=None, X2=None, X3=None, X4=None, Q=None, message='')[source]
sortOrder = ['database', 'yi', 'ZA', 'suffix', 'C', 'S', 'X1', 'yo', 'Q', 'I', 'X2', 'X3', 'X4', 'message']
toListOfStrings(indentation=None, subIndentation=None)[source]
toSelectedListOfStrings(indentation=None, subIndentation=None, selections=[])[source]
toString(selections=[], returnNoneOnNoMatches=True)[source]
fudge.legacy.endl.endlmisc.endlToFudgeInterpolation(interpolation)[source]

This function converts an endl interpolation value (0 or 2 is lin-lin, 3 is log-lin, 4 is lin-log and 5 is log-log) into a fudge interpolation value (0 is lin-lin, 1 is log-lin, 2 is lin-log and 3 is log-log).

fudge.legacy.endl.endlmisc.fudgeToEndlInterpolation(interpolation)[source]

This function converts a fudge interpolation value into an end interpolation value (see endlToFudgeInterpolation for valid interpolation vales.

fudge.legacy.endl.endlmisc.getAbsPath_withDefaultDBCheck(file)[source]

This routine returns the absolute path for file using getFullPath and then os.path.abspath. If the file is in fudgeDefaults.NUCLEAR_DATABASE_DIR, then the name will contain this even if fudgeDefaults.NUCLEAR_DATABASE_DIR is itself a link.

fudge.legacy.endl.endlmisc.getFormat(self)[source]

Checks if self has a getFormat method. If it does not, then None is returned. If it does then: 1) if getFormat returns a string or None then it is returned else getFormat must return an integer, n1. If n1 is 12 (default for legacy ENDL) then None is returned else returns string ‘%n1.n2e’ where n2 = n1 - 7.

fudge.legacy.endl.endlmisc.getFullPath(file, path=None)[source]

For internal use only.

fudge.legacy.endl.endlmisc.getNumberOfColumns_(I, callingRoutine)[source]

For internal use only.

fudge.legacy.endl.endlmisc.getmodestring_(I, callingRoutine)[source]

For internal use only.

fudge.legacy.endl.endlmisc.headerFunkyDouble2String(d)[source]

For internal use only.

fudge.legacy.endl.endlmisc.headerString2FunkyDouble(s, i, callingRoutine, newMethod=True)[source]

For internal use only.

fudge.legacy.endl.endlmisc.incidentParticleTags(yi)[source]

Returns a list of [ iYi, strYi, symbol, name ] for projectile yi where yi can be any of iYi, strYi, label or name. iYi is the projectile integer id, strYi is a string of the form “yi##” where ## is iYi converted to a two digit string, and the last two (symbol and name) are the projectiles symbol and name. For example, incidentParticleTags( “yi02” ) would return [ 2, “yi02”, “p”, “proton” ].

fudge.legacy.endl.endlmisc.intYoCIS(fileName)[source]

Returns the list of integers ( yo, C, I, S ) from fileName where fileName must be of the from ‘yo##c##i###s###’.

fudge.legacy.endl.endlmisc.intZA(ZA_i)[source]

Returns the ZA part of intZASuffix( ZA_i ).

fudge.legacy.endl.endlmisc.intZASuffix(ZA_ii)[source]

ZA_ii can be an integer (e.g., 92235) or a string of the from “zaZZZAAA_suffix” (e.g., “za095242m”). Returns the tuple integer ZA and _suffix from ZA_i. For examples, ZA_i = 92235 would return ( 92235, “” ) and ZA_i = “za095242m” would return ( 95242, “m” ).

fudge.legacy.endl.endlmisc.outgoingParticleTags(yo)[source]

Calls incidentParticleTags but allows for yo to be integers in the range 10 to 19 inclusive.

fudge.legacy.endl.endlmisc.print3dData(d, i0=0, i1=1, i2=2, fmt0=None, fmt1=None, fmt2=None)[source]

Calls string3dData and print its results.

fudge.legacy.endl.endlmisc.print4dData(d, i0=0, i1=1, i2=2, i3=3, fmt0=None, fmt1=None, fmt2=None, fmt3=None)[source]

Calls string4dData and print its results.

fudge.legacy.endl.endlmisc.printWarning(s)[source]
fudge.legacy.endl.endlmisc.processDataBase(database, oldFile, newFile, options='', defines=[], bdflsFile=None, ndfgen=None, mcfgen=None, endep=None, extraZAs=[])[source]

For internal use only.

fudge.legacy.endl.endlmisc.read1dDataFile(fn, comment='#', i0=0)[source]

Opens file with name fn, reads in the data, closes the file and then calls translate1dStringData with the data. Returns the results of translate1dStringData.

fudge.legacy.endl.endlmisc.read2dDataFile(fn, comment='#', i0=0, i1=1)[source]

Opens file with name fn, reads in the data, closes the file and then calls translate2dStringData with the data. Returns the results of translate2dStringData.

fudge.legacy.endl.endlmisc.read3dDataFile(fn, comment='#', i0=0, i1=1, i2=2)[source]

Opens file with name fn, reads in the data, closes the file and then calls translate3dStringData with the data. Returns the results of translate3dStringData.

fudge.legacy.endl.endlmisc.read4dDataFile(fn, comment='#', i0=0, i1=1, i2=2, i3=3)[source]

Opens file with name fn, reads in the data, closes the file and then calls translate4dStringData with the data. Returns the results of translate4dStringData.

fudge.legacy.endl.endlmisc.simplifyDataLine(l, n, callingRoutine, comment)[source]

For internal use only.

fudge.legacy.endl.endlmisc.strZASuffix(ZA, suffix='')[source]

Converts ZA and suffix into ‘za%6.6d%s’ % ( ZA, suffix ). If ZA is already of the form ‘za%6.6d%s’, it is returned without any change.

fudge.legacy.endl.endlmisc.string3dData(d, i0=0, i1=1, i2=2, fmt0=None, fmt1=None, fmt2=None)[source]

Returns a list of strings for data d. D must be list[ number, list[ number, number ] ].

fudge.legacy.endl.endlmisc.string4dData(d, i0=0, i1=1, i2=2, i3=3, fmt0=None, fmt1=None, fmt2=None, fmt3=None)[source]

Returns a list of strings for data d. D must be list[ number, list[ number, list[ number, number ] ] ].

fudge.legacy.endl.endlmisc.stringWithPrefixSuffix(list, Prefix='', Suffix='')[source]

For internal use only.

fudge.legacy.endl.endlmisc.translate1dStringData(ls, comment='#', i0=0)[source]
Translates 1d data from the list of strings ls and returns ::
list[ number ].

This list can be used as input when creating endl1dmath instances. All strings starting with comment are ignored and all data in a string after comment are ignored. After comments are removed, the strings can only contain one numbers per line else a raise is issued. The x-component is column i0.

fudge.legacy.endl.endlmisc.translate2dStringData(ls, comment='#', i0=0, i1=1)[source]
Translates 2d data from the list of strings ls and returns ::
list[ number, number ].

This list can be used as input when creating endl2dmath instances. All strings starting with comment are ignored and all data in a string after comment are ignored. After comments are removed, the strings can only contain two numbers per line else a raise is issued. The x-component is column i0 of the data and the y-component is column i1 (i0 and i1 can only be 0 or 1).

fudge.legacy.endl.endlmisc.translate3dData(data, i0=0, i1=1, i2=2)[source]
Translates 3d data from the list of (x,y,z) data and returns ::
list[ number, list[ number, number ] ].

The returned list can be used as input when creating endl3dmath instances. The x-component is column i0 of the data, the y-component is column i1 and the z-component is column i2 (i0, i1 and i2 can only be 0, 1 or 2).

fudge.legacy.endl.endlmisc.translate3dStringData(ls, comment='#', i0=0, i1=1, i2=2)[source]
Translates 3d data from the list of strings ls and returns ::
list[ number, list[ number, number ] ].

The returned list can be used as input when creating endl3dmath instances. All strings starting with comment are ignored and all data in a string after comment are ignored. After comments are removed, the strings can only contain three numbers per line else a raise is issued. The x-component is column i0 of the data, the y-component is column i1 and the z-component is column i2 (i0, i1 and i2 can only be 0, 1 or 2).

fudge.legacy.endl.endlmisc.translate4dData(data, comment='#', i0=0, i1=1, i2=2, i3=3)[source]
Translates 4d data from the list of (x,y,z,zz) data and returns ::
list[ number, list[ number, list[ number, number ] ] ].

The returned list that can be used as input when creating endl4dmath instances. The x-component is column i0 of the data, the y-component is column i1, the z-component is column i2 and the zz-component is column i3 (i0, i1, i2 and i3 can only be 0, 1, 2 or 3).

fudge.legacy.endl.endlmisc.translate4dStringData(ls, comment='#', i0=0, i1=1, i2=2, i3=3)[source]
Translates 4d data from the list of strings ls and returns ::
list[ number, list[ number, list[ number, number ] ] ].

This list that can be used as input when creating endl4dmath instances. All strings starting with comment are ignored and all data in a string after comment are ignored. After comments are removed, the strings can only contain four numbers per line else a raise is issued. The x-component is column i0 of the data, the y-component is column i1, the z-component is column i2 and the zz-component is column i3 (i0, i1, i2 and i3 can only be 0, 1, 2 or 3).

fudge.legacy.endl.endlmisc.validZADirectoryName_(name)[source]

For internal use only.

fudge.legacy.endl.endltdf module

fudge.legacy.endl.endltdf.processTDF_Reaction(target, C, S=None, X1=None, X2=None, X3=None, X4=None, Q=None, outputFile='tdfgen.out', workDir=None, bdflsFile=None)[source]

fudge.legacy.endl.fudgeDocumentationFile module

class fudge.legacy.endl.fudgeDocumentationFile.fudgeDocumentationFile(fileName)[source]
getText()[source]

Returns the documentation for self. Calls read if file has not been read.

getXML_ParserFriendlyText()[source]

Converts &, < and > in the self.text to ‘&amp;’, ‘&lt;’ and ‘&gt;’, respectively and stores it in self.XML_ParserFriendlyText

read()[source]

Read in the documentation for self. Note, this is not done by the __init__ method.

setText(text)[source]
write(fileName=None)[source]

If self.text is not equal to None, then its contents are written to file fileName. Self.text must be a python string. If fileName is None then self.fileName is used.

fudge.legacy.endl.fudgemiscLegacy module

fudge.legacy.endl.fudgemiscLegacy.databaseList(yi=None, path=None)[source]

Returns a list of the default databases. The list can be narrowed to a single incident particle type if yi is specified. Also, the location where databases are to be searched for can be set with path. This allows a user to have their own directory containing databases.

fudge.legacy.endl.fudgemiscLegacy.info(yi=None, w=2)[source]

List the default database path and all databases in it. The list of databases is printed with w columns.

fudge.legacy.endl.fudgemiscLegacy.projectileList(path=None)[source]

Returns a list of the projectiles in path.

fudge.legacy.endl.largeAngleCoulombScattering_generator module

fudge.legacy.endl.tdf module

This module contains the methods to run tdfgen, producing tdf files for light ion thermonuclear reactions. Methods include prepping the endlZA input and running the code (processTDF_Reaction), and various wrappers to provide running options.

fudge.legacy.endl.tdf.localZsymbol(Z)[source]
fudge.legacy.endl.tdf.main(arglist)[source]
fudge.legacy.endl.tdf.processTDF_Reaction(target, C, S=None, X1=None, X2=None, X3=None, X4=None, Q=None, outputDir=None, workDir=None, movePoints=None, movePointsEps=0.0001, addPoints=None, libraryName='ENDL2008', libraryVersion='2', verbose=False, overWrite=True, dryrun=False)[source]
fudge.legacy.endl.tdf.process_everything(libraryName='endl2008.2', libraryVersion='', libPath='/usr/gapps/data/nuclear/endl_official/', outputDir=None, workDir='work', verbose=False, dryrun=False)[source]
fudge.legacy.endl.tdf.process_names(libraryName='endl2008.2', libraryVersion='', libPath='/usr/gapps/data/nuclear/endl_official/', outputDir=None, workDir='work', verbose=False, dryrun=True, ZAlist=[1, 1001, 1002, 1003, 2003, 2004, 3006, 3007, 4007, 4009, 5010, 5011])[source]
fudge.legacy.endl.tdf.process_one_evaluation(yi, ZA, libraryName='endl2008.2', libraryVersion='', libPath='/usr/gapps/data/nuclear/endl_official/', outputDir=None, workDir='work', verbose=False, dryrun=False)[source]

process all reactions for an evaluation that we possibley can

fudge.legacy.endl.tdf.process_one_reaction(yi, ZA, C, libraryName='endl2009.0', libraryVersion='', libPath='/usr/gapps/data/nuclear/endl_official/', outputDir=None, workDir='work', verbose=False, dryrun=False)[source]

process one reaction, use this for testing

projectile designator: yi = ( 1,n; 2,p; 3,d; 4,t; 5,3He; 6,He; 7,g ) target ZA = 1000 * Z + A I = 0 is cross section data.

fudge.legacy.endl.tdf.process_sublibrary(yi, libraryName='endl2008.2', libraryVersion='', libPath='/usr/gapps/data/nuclear/endl_official/', outputDir=None, workDir='work', verbose=False, dryrun=False)[source]
fudge.legacy.endl.tdf.run_command(command, verbose=False)[source]
fudge.legacy.endl.tdf.usage()[source]

print usage message

fudge.legacy.endl.tdf.version()[source]

prints version information, uses tdfgen to do it

Module contents

fudge.legacy.endl.readOnly()[source]

Sets Fudge’s internal readonly flag which causes fudge to not create working directories for the isotopes read in. Note, you cannot unset this flag once readOnly has been called.

fudge.legacy.endl.verbose(mode=1)[source]

Sets Fudge’s internal verbose flag to mode. Mode = 0 suppress all informational messages.