Skip to content

Commit

Permalink
Merge pull request #207 from TheSkyentist/no-scipy-poly
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer authored Feb 16, 2024
2 parents 9de8443 + 44a064d commit 0d9b5cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions grizli/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,7 @@ def xfit_redshift(self, prior=None,
"""
from numpy import polyfit, polyval
from numpy.polynomial.polynomial import polyfit, polyval
from scipy.stats import t as student_t
from scipy.special import huber
import peakutils
Expand Down Expand Up @@ -3480,7 +3480,7 @@ def objfun_scale(pscale, AxT, data, self, retval):
spectra
"""
import scipy.optimize
from numpy import polyval
from numpy.polynomial.polynomial import polyval

scale = self.compute_scale_array(pscale, self.wavef[self.fit_mask])
scale[-self.Nphot:] = 1.
Expand Down
2 changes: 1 addition & 1 deletion grizli/multifit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,7 @@ def fit_redshift(self, prior=None, poly_order=1, fwhm=1200,
fsps_templates=False):
"""TBD
"""
from scipy import polyfit, polyval
from numpy.polynomial.polynomial import polyfit, polyval

if zr is None:
zr = [0.65, 1.6]
Expand Down
2 changes: 1 addition & 1 deletion grizli/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,7 @@ def tweak_align(direct_group={}, grism_group={}, max_dist=1., n_min=10, key=' ',
'prep.tweak_align')

from drizzlepac.astrodrizzle import AstroDrizzle
from scipy import polyfit, polyval
from numpy.polynomial.polynomial import polyfit, polyval

if len(direct_group['files']) < 2:
logstr = '# ! {0}: Only one direct image found, can\'t compute shifts'
Expand Down
4 changes: 2 additions & 2 deletions grizli/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def scale_AxT(p, Ax, spec_wave, Nphot, Next):
"""
Scale spectrum templates by polynomial function
"""
from scipy import polyval
from numpy.polynomial.polynomial import polyval

scale = np.ones(Ax.shape[1])
scale[:-Nphot] = polyval(p[::-1]/10., (spec_wave-1.e4)/1000.)
Expand All @@ -578,7 +578,7 @@ def objective_scale(p, Ax, data, spec_wave, fit_mask, sivarf, Nphot, Next, retur
spectra
"""
import scipy.optimize
from scipy import polyval
from numpy.polynomial.polynomial import polyval

scale = np.ones(Ax.shape[1])
scale[:-Nphot] = polyval(p[::-1]/10., (spec_wave-1.e4)/1000.)
Expand Down

0 comments on commit 0d9b5cd

Please sign in to comment.