domeckert / pyproffit

Pyproffit is a Python code for the analysis of X-ray brightness profiles from clusters of galaxies
GNU General Public License v3.0
18 stars 4 forks source link

failed to take model parameters/arguments #8

Closed rmajidul closed 3 years ago

rmajidul commented 3 years ago

MacBPro:validation rmajidul$ python3 test_script.py WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' / Equatorial system reference the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs] File reading test passed Excluded 2 sources Region file test passed Applying high-pass filter Interpolating in the masked regions Filling holes Dmfilth test passed Computing centroid and ellipse parameters using principal component analysis Will search for the centroid within a region of 20 arcmin centered on RA=55.5399, DEC=-53.5573 Denoising image... Running PCA... Centroid position: 277.21168362323596 282.2225139481457 Corresponding FK5 coordinates: 55.68500552386556 -53.62311186648865 Ellipse axis ratio and position angle: 1.1989467307554385 -174.82015707871992 Centroid calculation test passed Determining X-ray peak Coordinates of surface-brightness peak: 272.0 281.0 Corresponding FK5 coordinates: 55.72147733144434 -53.628226297404545 SB peak test passed Corresponding pixels coordinates: 277.18944608325205 282.3833169452636 Surface brightness profile test passed Traceback (most recent call last): File "/Users/rmajidul/soft/pyproffit/validation/test_script.py", line 73, in fitobj.Migrad(beta=0.7,rc=2.,norm=-2,bkg=-4,pedantic=False) File "/usr/local/lib/python3.9/site-packages/pyproffit/fitting.py", line 212, in Migrad minuit=iminuit.Minuit(chi2,**kwargs) File "/usr/local/lib/python3.9/site-packages/iminuit/_minuit.py", line 485, in init self._init_state = _make_init_state(self._pos2var, args, kwds) File "/usr/local/lib/python3.9/site-packages/iminuit/_minuit.py", line 1401, in _make_init_state raise RuntimeError( RuntimeError: pedantic is not one of the parameters [beta rc norm bkg]

domeckert commented 3 years ago

This is an iminuit error, it could be that the "pedantic" parameter was removed from recent versions of iminuit. Try removing the "pedantic=False" option from the test script and running again

domeckert commented 3 years ago

It looks like there has been a big change in the API of iminuit starting from version 2.0.

https://iminuit.readthedocs.io/en/stable/changelog.html

I need to update the code to make it compatible with the new version. In the meantime, as a work around you can revert to previous versions of iminuit:

pip uninstall iminuit pip install 'iminuit<2'

domeckert commented 3 years ago

I have just pushed a new version of pyproffit which is now compatible with iminuit version >2. There are some changes to be made in the way the code is called, I will soon update the documentation. Now closing this issue