A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
xsreader.h File Reference

Utility functions to parse in ENDF cross-sections from text files into data arrays. More...

Go to the source code of this file.

Functions

void setXSLibDirectory (const char *directory)
 Sets the directory for the cross-section library. More...
 
const char * getXSLibDirectory ()
 Returns the directory for the cross-section library directory. More...
 
int restoreXSLibrary ()
 Restores the cross-section library to its original, installed state. More...
 
int parseCrossSections (const char *file, float *energies, float *xs_values)
 Parses an input file of cross-section data. More...
 
int getNumCrossSectionDataPoints (const char *filename)
 Counts the number of lines in an cross-section input file. More...
 

Detailed Description

Utility functions to parse in ENDF cross-sections from text files into data arrays.

Author
William Boyd (wboyd.nosp@m.@mit.nosp@m..edu)
Date
March 20, 2012

Function Documentation

int getNumCrossSectionDataPoints ( const char *  filename)

Counts the number of lines in an cross-section input file.

Parameters
filenamethe file of interest
Returns
the number of lines in the file
const char* getXSLibDirectory ( )

Returns the directory for the cross-section library directory.

Returns
a character array with the cross-section library directory
int parseCrossSections ( const char *  file,
float *  energies,
float *  xs_values 
)

Parses an input file of cross-section data.

Loads the energy values (as eV) and the cross-section values (barns) into two float arrays. It takes in the energies in MeV since that is the most typical unit for ENDF nuclear data, but converts the values into eV during parsing.

Parameters
filethe filename for the data
energiesa pointer to a float array for the energies (MeV)
xs_valuesa pointer to a float array fo the xs values (barns)
Returns
the number of data points
int restoreXSLibrary ( )

Restores the cross-section library to its original, installed state.

This function copies the original cross-section data files installed with PINSPEC from the pinspec/xs-lib/BackupXS folder into the main cross-section library directory pinspec/xs-lib. This function is primarily when a user is using PINSPEC's SLBW module to create artifical cross-sections from Reich-Moore date. This function is called anytime the python pinspec module is imported.

Returns
returns an int representing whether or not the copy was successful
void setXSLibDirectory ( const char *  xs_directory)

Sets the directory for the cross-section library.

Parameters
xs_directorycharacter array for the cross-section library directory