keflavich / agpy Goto Github PK
View Code? Open in Web Editor NEWagpy (cloned from googlecode: agpy.googlecode.com)
License: MIT License
agpy (cloned from googlecode: agpy.googlecode.com)
License: MIT License
numpy version: 1.11.1
agpy version: 0.1.3 (from auto conda repository)
conda: 4.2.13
Calling gaussfitter.gaussfit raises a warning due to np.rank L2277 of mpfit.py.
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy
/core/fromnumeric.py:2641: VisibleDeprecationWarning: `rank` is deprecated; use the `ndim`
attribute or function instead. To find the rank of a matrix see `numpy.linalg.matrix_rank`.
VisibleDeprecationWarning)
Consider replacing all instances of numpy.rank to numpy.ndim to comply with the new numpy standards.
if numpy.rank(rr) != 2:
by
if numpy.ndim(rr) != 2:
Line 2278 of /Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/mpfit/mpfit.py
Environment:
conda version: 4.2.13
Numpy version: numpy 1.11.1 py27_0
agpy version: agpy 0.1.3 py27_0 auto
Python command-line:
from agpy import gaussfitter
mpfit2, psf_fit2 = gaussfitter.gaussfit(testimg,returnfitimage=True)
raises a ValueError:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-2f88faf6f9b5> in <module>()
40 plt.imshow(testimg,interpolation="None")
41 #tmpcs=reduction.EvalDirtyImage2(testimg,verbose=True)
---> 42 mpfit2, psf_fit2 = gaussfitter.gaussfit(testimg,returnfitimage=True)
/Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/gaussfitter.pyc in gaussfit(data, err, params, autoderiv, return_all, circle, fixed, limitedmin, limitedmax, usemoment, minpars, maxpars, rotate, vheight, quiet, returnmp, returnfitimage, **kwargs)
241 # p, cov, infodict, errmsg, success = optimize.leastsq(errorfunction,\
242 # params, full_output=1)
--> 243 mp = mpfit(mpfitfun(data,err),parinfo=parinfo,quiet=quiet)
244
245
/Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/mpfit/mpfit.py in __init__(self, fcn, xall, functkw, parinfo, ftol, xtol, gtol, damp, maxiter, factor, nprint, iterfunct, iterkw, nocovar, rescale, autoderivative, quiet, diag, epsfcn, debug)
1165 catch_msg = 'calculating LM parameter (MPFIT_)'
1166 [fjac, par, wa1, wa2] = self.lmpar(fjac, ipvt, diag, qtf,
-> 1167 delta, wa1, wa2, par=par)
1168 # Store the direction p and x+p. Calculate the norm of p
1169 wa1 = -wa1
/Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/mpfit/mpfit.py in lmpar(self, r, ipvt, diag, qtb, delta, x, sdiag, par)
2153 temp = numpy.sqrt(par)
2154 wa1 = temp * diag
-> 2155 [r, x, sdiag] = self.qrsolv(r, ipvt, wa1, qtb, sdiag)
2156 wa2 = diag*x
2157 dxnorm = self.enorm(wa2)
/Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/mpfit/mpfit.py in qrsolv(self, r, ipvt, diag, qtb, sdiag)
1974 #x.flags.writeable=True
1975 # END JGMOD
-> 1976 x[ipvt] = wa
1977 return (r, x, sdiag)
1978
ValueError: assignment destination is read-only
Temporary fix:
add
x.flags.writeable=True
before
x[ipvt] = wa
at L.1973 in qrsolv function in
/Users/jgirard/anaconda/lib/python2.7/site-packages/agpy/mpfit/mpfit.py
but requires some long-term fixing.
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.