diff --git a/aipy/amp.py b/aipy/amp.py index 43ed5b9..9e19efc 100644 --- a/aipy/amp.py +++ b/aipy/amp.py @@ -125,7 +125,7 @@ def response(self, xyz): class Beam2DGaussian(phs.Beam): """Representation of a 2D Gaussian beam pattern, with default setting for a flat beam.""" - def __init__(self, freqs, xwidth=np.Inf, ywidth=np.Inf): + def __init__(self, freqs, xwidth=np.inf, ywidth=np.inf): """xwidth = angular width (radians) in EW direction ywidth = angular width (radians) in NS direction""" phs.Beam.__init__(self, freqs) diff --git a/aipy/deconv.py b/aipy/deconv.py index 722a75d..76d6627 100644 --- a/aipy/deconv.py +++ b/aipy/deconv.py @@ -77,7 +77,7 @@ def recenter(a, c): return a2 def lsq(im, ker, mdl=None, area=None, gain=.1, tol=1e-3, maxiter=200, - lower=lo_clip_lev, upper=np.Inf, verbose=False): + lower=lo_clip_lev, upper=np.inf, verbose=False): """This simple least-square fitting procedure for deconvolving an image saves computing by assuming a diagonal pixel-pixel gradient of the fit. In essence, this assumes that the convolution kernel is a delta-function. @@ -132,7 +132,7 @@ def f(x): return x, info def maxent(im, ker, var0, mdl=None, gain=.1, tol=1e-3, maxiter=200, - lower=lo_clip_lev, upper=np.Inf, verbose=False): + lower=lo_clip_lev, upper=np.inf, verbose=False): """Maximum entropy deconvolution (MEM) (see Cornwell and Evans 1984 "A Simple Maximum Entropy Deconvolution Algorithm" and Sault 1990 "A Modification of the Cornwell and Evans Maximum Entropy Algorithm") @@ -197,7 +197,7 @@ def dot(x, y): return (x*y/-gg_J).sum() return b_i, info def maxent_findvar(im, ker, var=None, f_var0=.6, mdl=None, gain=.1, tol=1e-3, - maxiter=200, lower=lo_clip_lev, upper=np.Inf, verbose=False, + maxiter=200, lower=lo_clip_lev, upper=np.inf, verbose=False, maxiterok=False): """This frontend to maxent tries to find a variance for which maxent will converge. If the starting variance (var) is not specified, it will be @@ -237,7 +237,7 @@ def maxent_findvar(im, ker, var=None, f_var0=.6, mdl=None, gain=.1, tol=1e-3, if verbose: print('Done with MEM.') return cl, info -def anneal(im, ker, mdl=None, maxiter=1000, lower=lo_clip_lev, upper=np.Inf, +def anneal(im, ker, mdl=None, maxiter=1000, lower=lo_clip_lev, upper=np.inf, cooling=lambda i,x: 1e+1*(1-np.cos(i/50.))*(x**2), verbose=False): """Annealing takes a non-deterministic approach to deconvolution by randomly perturbing the model and selecting perturbations that improve the diff --git a/scripts/cl_img.py b/scripts/cl_img.py index c66c99d..9d65f85 100755 --- a/scripts/cl_img.py +++ b/scripts/cl_img.py @@ -78,7 +78,7 @@ def to_fits(prefix,ftag,i,kwds): level = float(opts.rewgt.split('(')[-1][:-1]) abms = np.abs(bms) thresh = abms.max() * level - divisor = abms.clip(thresh, np.Inf) + divisor = abms.clip(thresh, np.inf) uvs /= divisor; bms /= divisor elif opts.rewgt.startswith('radial'): #x,y = np.indices(dim.shape) diff --git a/scripts/combine_freqs.py b/scripts/combine_freqs.py index 9c88074..5530355 100755 --- a/scripts/combine_freqs.py +++ b/scripts/combine_freqs.py @@ -54,7 +54,7 @@ def mfunc(uv, p, d, f): d = d.sum(axis=1) f.shape = (opts.nchan, nchan/opts.nchan) f = np.logical_not(f).astype(np.int_).sum(axis=1) - d /= f.clip(1,np.Inf) + d /= f.clip(1,np.inf) if opts.careful_flag: f = np.where(f < nchan/opts.nchan, 1, 0) elif opts.dont_flag: f = np.where(f < 1, 1, 0) else: f = np.where(f <= nchan/opts.nchan/2, 1, 0) diff --git a/scripts/fitmdl.py b/scripts/fitmdl.py index 8d1e186..2b0530c 100755 --- a/scripts/fitmdl.py +++ b/scripts/fitmdl.py @@ -54,7 +54,7 @@ aa.set_jultime(t) cat.compute(aa) del(uv) -if opts.maxiter < 0: opts.maxiter = np.Inf +if opts.maxiter < 0: opts.maxiter = np.inf # Figure out parameters to fit prms, prm_dict, shkeys = {}, {}, [] @@ -234,7 +234,7 @@ def fit_func(prms): fit_func, prm_list, #args=(args, opts.decimate, opts.decphs), full_output=1, disp=0, - maxfun=opts.maxiter, maxiter=np.Inf, + maxfun=opts.maxiter, maxiter=np.inf, ftol=opts.ftol, xtol=opts.xtol ) prms,score = rv[:2] @@ -252,7 +252,7 @@ def fit_func(prms): fit_func, prm_list, args=(args, opts.decimate, opts.decphs), full_output=1, disp=0, - maxfun=opts.maxiter, maxiter=np.Inf, + maxfun=opts.maxiter, maxiter=np.inf, ftol=opts.ftol, xtol=opts.xtol ) prms,score = rv[:2] @@ -283,7 +283,7 @@ def fit_func(prms): fit_func, prm_list, args=([uvfile], decimate, opts.decimate*cnt + opts.decphs), full_output=1, disp=0, - maxfun=opts.maxiter, maxiter=np.Inf, + maxfun=opts.maxiter, maxiter=np.inf, ftol=opts.ftol, xtol=opts.xtol ) prms,score = rv[:2] diff --git a/scripts/xtalk3.py b/scripts/xtalk3.py index dd0c38a..ecdfecb 100755 --- a/scripts/xtalk3.py +++ b/scripts/xtalk3.py @@ -91,7 +91,7 @@ guess[bl] += np.where(f, 0, d) cnt[bl] += np.logical_not(f) del(uv) - for bl in guess: xtalk[bl] = guess[bl] / np.clip(cnt[bl], 1, np.Inf) + for bl in guess: xtalk[bl] = guess[bl] / np.clip(cnt[bl], 1, np.inf) if opts.outfile: xfile = '%f.xtalk.npz' % jd print('Writing', xfile)