Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions brownies/bin/endf2gnds.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def process_args( ) :
outFile = args.outputFile
if outFile is None:
outFile = os.path.basename(inFile) + '.gnds.xml'
outCovFile = os.path.basename(inFile) + '.gnds-covar.xml'
outCovFile = os.path.basename(inFile) + '.gndsCov.xml'
elif '.xml' in outFile:
outCovFile = outFile.replace('.xml', '-covar.xml')
outCovFile = outFile.replace('.xml', '.gndsCov.xml')
else:
outCovFile = outFile + "-covar.xml"
outCovFile = outFile + ".gndsCov.xml"

try:
kwargs = {}
Expand Down
2 changes: 1 addition & 1 deletion brownies/bin/gnds2endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

description = """Translate a GNDS file to ENDF-6.
Sample use: python gnds2endf.py n-001_H_001.xml n-001_H_002.endf
If file n-001_H_001-covar.xml exists, covariances will automatically be read from it.
If file n-001_H_001.gndsCov.xml exists, covariances will automatically be read from it.
The output file name is optional, defaults to the input file with '.endf' appended."""

__doc__ = description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ def spin( self ) :

@property
def etaCoefficient( self ) :
r"""This function returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`."""
"""This function returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`."""

self.initialize( )
return( self.__etaCoefficient )

@property
def kCoefficient( self ) :
r"""This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \sqrt{E}`)."""
"""This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \\sqrt{E}`)."""

self.initialize( )
return( self.__kCoefficient )
Expand Down Expand Up @@ -219,16 +219,17 @@ def initialize( self ):
self.__kCoefficient = (A / (A + 1)) * math.sqrt( 2 * mass1 ) / hbar_c * 1e-14 # 1e-14 = sqrt( barn )

def dSigma_dMu(self, energy, muCutoff, accuracy=1e-3, epsilon=1e-6, excludeRutherfordScattering=False, probability=False):
r"""
This function returns :math:`d\sigma / d\mu` at the specified incident energy if *probability* is False and :math:`P(\mu)` otherwise
if True.. The :math:`\mu` domain goes from muMin to *muCutoff*. For identical particles, muMin is set to -*muCutoff* otherwise it is -1.

"""
This function returns :math:`d\\sigma / d\\mu` at the specified incident energy if *probability* is False and :math:`P(\\mu)` otherwise
if True.. The :math:`\\mu` domain goes from muMin to *muCutoff*. For identical particles, muMin is set to -*muCutoff* otherwise it is -1.

:param energy: Energy of the projectile.
:param muCutoff: The maximum (and maybe minimum) value of :math:`\mu` for the returned function.
:param muCutoff: The maximum (and maybe minimum) value of :math:`\\mu` for the returned function.
:param accuracy: The accuracy of the returned function.
:param epsilon: This variable is not used.
:param excludeRutherfordScattering: If True, Rutherford scattering is not added to the returned function, otherwise it is.
:param probability: If True :math:`P(\mu)` is returned otherwise :math:`d\sigma / d\mu` is returned.
:param probability: If True :math:`P(\\mu)` is returned otherwise :math:`d\\sigma / d\\mu` is returned.

:return: An instance of :py:class:`angularModule.XYs1d`.
"""
Expand Down Expand Up @@ -289,8 +290,8 @@ def calculateAverageProductData( self, style, indent = '', **kwargs ) :
raise CoulombDepositionNotSupported( "Cannot compute average product data for %s distribution" % self.moniker )

def processCoulombPlusNuclearMuCutoff( self, style, energyMin = None, accuracy = 1e-3, epsilon = 1e-6, excludeRutherfordScattering = False ) :
r"""
This function returns the cross section and angular distribution for :math:`\mu` from muMin to muMax.
"""
This function returns the cross section and angular distribution for :math:`\\mu` from muMin to muMax.
For identical particles, muMin is set to -muMax otherwise it is -1. The value of muMax is the *muCufoff*
member of *style*.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, domainMin=None, domainMax=None, domainUnit=None ):

@property
def etaCoefficient( self ) :
r"""This method returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`."""
"""This method returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`."""

return( self.ancestor.etaCoefficient )

Expand All @@ -64,7 +64,7 @@ def spin( self ) :

@property
def kCoefficient( self ) :
r"""This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \sqrt{E}`)."""
"""This function returns the coefficient for the particle wave number (i.e., :math:`k(E) / \\sqrt{E}`)."""

return( self.ancestor.kCoefficient )

Expand All @@ -89,11 +89,11 @@ def convertUnits( self, unitMap ):
self.domainUnit = newUnit

def crossSectionVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax=None):
r"""
Returns the partial Rutherford cross section by Integrating :math:`d\sigma / d\mu` from muMin to *muMax*. For identical particles, muMin
"""
Returns the partial Rutherford cross section by Integrating :math:`d\\sigma / d\\mu` from muMin to *muMax*. For identical particles, muMin
is set to -*muMax* otherwise it is -1.

:param muMax: The upper limit for the :amth:`\mu` integration.
:param muMax: The upper limit for the :amth:`\\mu` integration.
:param accuracy: The lin-lin interpolation accuracy of the returned cross section.
:param energyMin: The minimum projectile energy for the returned cross section.
:param energyMax: The maximum projectile energy for the returned cross section.
Expand Down Expand Up @@ -130,10 +130,10 @@ def evaluateAtX(self, energy):


def dSigma_dMuVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax=None):
r"""
Returns :math:`d\sigma(E) / d\mu`.
"""
Returns :math:`d\\sigma(E) / d\\mu`.

:param muMax: The upper limit for the :amth:`\mu` integration.
:param muMax: The upper limit for the :amth:`\\mu` integration.
:param accuracy: The lin-lin interpolation accuracy of the returned cross section.
:param energyMin: The minimum projectile energy for the returned cross section.
:param energyMax: The maximum projectile energy for the returned cross section.
Expand All @@ -159,13 +159,13 @@ def dSigma_dMuVersusEnergy(self, muMax, accuracy=1e-3, energyMin=None, energyMax
return xys2d

def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False):
r"""
Returns :math:`d\sigma / d\mu` at the specified projdctile energy if *probability* is False, otherwise :math:`P(mu)` is returned..
"""
Returns :math:`d\\sigma / d\\mu` at the specified projdctile energy if *probability* is False, otherwise :math:`P(mu)` is returned..

:param energy: Energy of the projectile.
:param accuracy: The lin-lin interpolation accuracy of the returned data.
:param muMax: Slices the upper domain mu to this value.
:param probability: If True :math:`P(mu)` is returned instead of :math:`d\sigma / d\mu`.
:param probability: If True :math:`P(mu)` is returned instead of :math:`d\\sigma / d\\mu`.

:return: A :py:class:`angularModule.XYs1d` instance.
"""
Expand Down Expand Up @@ -224,10 +224,10 @@ def energyDomain(self, energyMin=None, energyMax=None):
return energyUnit, energyMin, energyMax

def evaluate( self, energy, mu, phi = 0.0 ) :
r"""
Returns the :math:`d\sigma / d \Omega(energy,\mu,\phi) for Rutherford scattering. Note, Rutherford
"""
Returns the :math:`d\\sigma / d \\Omega(energy,\\mu,\\phi) for Rutherford scattering. Note, Rutherford
scattering is independent of phi but phi is listed as an argument to be consistent with others
:math:`d\sigma / d\Omega` that may depend on phi.
:math:`d\\sigma / d\\Omega` that may depend on phi.

:param energy: Projectile energy.
:param mu: Scattering angle cosine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def fixMuRange(data, epsilon=1e-6):
r"""
This function ensures that the range of mu in *data* is [-1, 1] by adding 0.0's to the missing ranges. Note, *data* is modified.

:param data: A python list of :math:`P(\mu)`.
:param data: A python list of :math:`P(\\mu)`.
:param epsilon: The relative amount to add a point below (above) the first (last) point in addition to the point at -1 (1).
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__( self, nuclearTerm = None, realInterference = None, imaginaryInterf

@property
def etaCoefficient( self ) :
r"""This method returns the parameter :math:`\eta \, \sqrt{E} = Z_1 \, Z_2 \, sqrt{\alpha^2 \mu m_1 / 2}`."""
"""This method returns the parameter :math:`\\eta \\, \\sqrt{E} = Z_1 \\, Z_2 \\, sqrt{\\alpha^2 \\mu m_1 / 2}`."""

return( self.ancestor.etaCoefficient )

Expand Down Expand Up @@ -206,8 +206,8 @@ def convertUnits( self, unitMap ):
self.imaginaryInterferenceTerm.convertUnits( unitMap )

def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False):
r"""
This function returns :math:`d\sigma / d\mu` at the specified incident energy.
"""
This function returns :math:`d\\sigma / d\\mu` at the specified incident energy.

:param energy: Energy of the projectile.
:param accuracy: The accuracy of the returned *dSigma_dMu*.
Expand All @@ -218,8 +218,8 @@ def dSigma_dMu(self, energy, accuracy=1e-3, muMax=0.999, probability=False):
"""

class Tester :
r"""
This class is used to added point to :math:`d\sigma / d\mu` until the desired lin-lin interpolation is met.
"""
This class is used to added point to :math:`d\\sigma / d\\mu` until the desired lin-lin interpolation is met.
This class is for internal use.
"""

Expand All @@ -237,8 +237,8 @@ def __init__( self, evaluate, energy, relativeTolerance, absoluteTolerance ) :
self.absoluteTolerance = absoluteTolerance

def evaluateAtX( self, mu ) :
r"""
This function returns *self* evaluated at a projectile energy and outgoing :math:`\mu`.
"""
This function returns *self* evaluated at a projectile energy and outgoing :math:`\\mu`.

:param mu: The mu point to evaluate *self* at.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
from . import misc as miscModule

class CrossSection(miscModule.ChargedParticleElasticTerm):
r"""
This class represents the :math:`\sigma(E)` part of :math:`\sigma(E) \, P(\mu|E)`
"""
This class represents the :math:`\\sigma(E)` part of :math:`\\sigma(E) \\, P(\\mu|E)`
"""

moniker = 'crossSection'

allowedDataForms = (crossSectionModule.XYs1d, crossSectionModule.Regions1d)

class Distribution( miscModule.ChargedParticleElasticTerm):
r"""
This class represents the :math:`P(\mu|E)` part of :math:`\sigma(E) \, P(\mu|E)`.
"""
This class represents the :math:`P(\\mu|E)` part of :math:`\\sigma(E) \\, P(\\mu|E)`.
"""

moniker = 'distribution'
Expand All @@ -56,16 +56,16 @@ class Distribution( miscModule.ChargedParticleElasticTerm):
class NuclearPlusInterference( ancestryModule.AncestryIO ):
r"""
This class represents the nuclear + interference term of the elastic scattering of two nuclei and
stores the double differential cross section as the product :math:`\sigma(E) \, P(\mu|E)`.
In :math:`P(\mu|E)` the :math:`\mu` ranges from muMin to muCutoff where muCutoff is a member of this
stores the double differential cross section as the product :math:`\\sigma(E) \\, P(\\mu|E)`.
In :math:`P(\\mu|E)` the :math:`\\mu` ranges from muMin to muCutoff where muCutoff is a member of this
class and muMin is -muCutoff for identical particles and -1 otherwise.

The following table list the primary members of this class:

+-------------------+-------------------------------------------------------------------------------+
| Member | Description |
+===================+===============================================================================+
| muCutoff | The maximum :math:`\mu` value the data represent. |
| muCutoff | The maximum :math:`\\mu` value the data represent. |
+-------------------+-------------------------------------------------------------------------------+
| crossSection | The cross section part of the nuclear + interference term. |
+-------------------+-------------------------------------------------------------------------------+
Expand All @@ -76,8 +76,8 @@ class and muMin is -muCutoff for identical particles and -1 otherwise.
moniker = "nuclearPlusInterference"

def __init__( self, muCutoff, crossSection = None, distribution = None ):
r"""
:param muCutoff: The maximum :math:`\mu` value the data represent.
"""
:param muCutoff: The maximum :math:`\\mu` value the data represent.
:param crossSection: The cross section part of the nuclear + interference term.
:param distribution: The distribution part of the nuclear + interference term.
"""
Expand Down Expand Up @@ -174,8 +174,8 @@ def convertUnits( self, unitMap ):
self.distribution.convertUnits( unitMap )

def dSigma_dMu(self, energy, accuracy=1e-3, muMax=None, probability=False):
r"""
Returns :math:`d\sigma / d\mu` at the specified projectile energy.
"""
Returns :math:`d\\sigma / d\\mu` at the specified projdctile energy.

:param energy: Energy of the projectile.
:param accuracy: This argument is not used.
Expand Down Expand Up @@ -207,10 +207,10 @@ def dSigma_dMu(self, energy, accuracy=1e-3, muMax=None, probability=False):
return _dSigma_dMu

def evaluate( self, E, mu, phi = 0.0 ) :
r"""
Returns the :math:`d\sigma / d \Omega(energy,\mu,\phi) for Rutherford scattering. Note, Rutherford
"""
Returns the :math:`d\\sigma / d \\Omega(energy,\\mu,\\phi) for Rutherford scattering. Note, Rutherford
scattering is independent of phi but phi is listed as an argument to be consistent with others
:math:`d\sigma / d\Omega` that may depend on phi.
:math:`d\\sigma / d\\Omega` that may depend on phi.

:param energy: Projectile energy.
:param mu: Scattering angle cosine.
Expand Down
Loading