mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
improve based on Paul's comments
This commit is contained in:
parent
8cb0dca813
commit
b842ae78ee
2 changed files with 4 additions and 13 deletions
|
|
@ -8,8 +8,6 @@ import h5py
|
|||
import pickle
|
||||
import numpy as np
|
||||
from scipy.signal import find_peaks
|
||||
import matplotlib
|
||||
matplotlib.use("agg")
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
import openmc.checkvalue as cv
|
||||
|
|
@ -646,7 +644,8 @@ def _windowing(mp_data, n_cf, rtol=1e-3, atol=1e-5, n_win=None, spacing=None,
|
|||
energy_sqrt = np.linspace(np.sqrt(e_start), np.sqrt(e_end), n_points)
|
||||
energy = energy_sqrt**2
|
||||
|
||||
# reference xs from multipole form
|
||||
# reference xs from multipole form, note the residue terms in the
|
||||
# multipole and vector fitting representations differ by a 1j
|
||||
xs_ref = vf.evaluate(energy_sqrt, poles, residues*1j) / energy
|
||||
|
||||
# curve fit matrix
|
||||
|
|
|
|||
|
|
@ -5,14 +5,6 @@ import numpy as np
|
|||
import pytest
|
||||
import openmc.data
|
||||
|
||||
no_vectfit = False
|
||||
try:
|
||||
import vectfit as vf
|
||||
except:
|
||||
no_vectfit = True
|
||||
|
||||
vf_only = pytest.mark.skipif(no_vectfit, reason="vectfit package not installed")
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def u235():
|
||||
|
|
@ -56,16 +48,16 @@ def test_export_to_hdf5(tmpdir, u235):
|
|||
assert os.path.exists(filename)
|
||||
|
||||
|
||||
@vf_only
|
||||
def test_from_endf():
|
||||
pytest.importerskip('vectfit')
|
||||
endf_data = os.environ['OPENMC_ENDF_DATA']
|
||||
endf_file = os.path.join(endf_data, 'neutrons', 'n-001_H_001.endf')
|
||||
return openmc.data.WindowedMultipole.from_endf(
|
||||
endf_file, wmp_options={"n_win": 400, "n_cf": 3})
|
||||
|
||||
|
||||
@vf_only
|
||||
def test_from_endf_search():
|
||||
pytest.importerskip('vectfit')
|
||||
endf_data = os.environ['OPENMC_ENDF_DATA']
|
||||
endf_file = os.path.join(endf_data, 'neutrons', 'n-095_Am_244.endf')
|
||||
return openmc.data.WindowedMultipole.from_endf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue