Skip to content

Commit

Permalink
fix overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Jan 16, 2024
1 parent d9390c1 commit a8f87c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/test_fit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

os.environ['OMP_NUM_THREADS'] = '1'
import sys
import pytest
Expand All @@ -10,8 +11,10 @@
from rvspecfit import vel_fit
from rvspecfit import spec_fit
from rvspecfit import fitter_ccf

path = str(pathlib.Path(__file__).parent.absolute())


def test_config():
with pytest.raises(RuntimeError):
config = utils.read_config('xx.yaml')
Expand All @@ -22,14 +25,15 @@ def test_config():
finally:
os.chdir(cwd)


def test_fit():
config = utils.read_config(path + '/config.yaml')

# read data
dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits')
err = dat['ivar']
err = 1. / err**.5
err[~np.isfinite(err)] = 1e40
err[~np.isfinite(err)] = 1e30

# construct specdata object
specdata = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sdss.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_fits():
dat = pyfits.getdata(path + '/data/spec-0266-51602-0031.fits')
err = dat['ivar']
err = 1. / err**.5
err[~np.isfinite(err)] = 1e40
err[~np.isfinite(err)] = 1e30

# construct specdata object
specdata = [
Expand Down

0 comments on commit a8f87c8

Please sign in to comment.