samconnolly / DELightcurveSimulation

Emmanoulopoulos style lightcurve simulation
33 stars 19 forks source link

Different number of arguments in Fix_BL(), example.py, line 67 #5

Open vlad7235 opened 5 years ago

vlad7235 commented 5 years ago

When trying to run the provided example (Fedora 29, Python 2.7.16, numpy 1.14.3) I have a TypeError:

$python example.py Read 1170 lines of data /home/vlad/.local/lib/python2.7/site-packages/DELCgen.py:237: RuntimeWarning: invalid value encountered in power denom = 1 + (v/v_bend)*(a_high-a_low) /home/vlad/.local/lib/python2.7/site-packages/DELCgen.py:394: RuntimeWarning: invalid value encountered in log p = 2.0 np.sum( np.log(psd[:-1]) + (periodogram[1][:-1]/psd[:-1]) ) /home/vlad/.local/lib/python2.7/site-packages/DELCgen.py:395: RuntimeWarning: invalid value encountered in log p_nq = np.log(np.pi periodogram[1][-1]psd[-1]) \ /home/vlad/.local/lib/python2.7/site-packages/DELCgen.py:237: RuntimeWarning: overflow encountered in power denom = 1 + (v/v_bend)**(a_high-a_low)

### Fit successful: ### Parameter 1: 0.0187866186811 Parameter 2: 0.000109037211659 Parameter 3: 1.98920186469 Parameter 4: 0.00864471600195 PDF not fitted, fitting using defaults (gamma + lognorm) /home/vlad/.local/lib/python2.7/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg. warnings.warn("The 'normed' kwarg is deprecated, and has been " Traceback (most recent call last): File "example.py", line 67, in "Emmanoulopoulos from model","Emmanoulopoulos from data"],bins=25) File "/home/vlad/.local/lib/python2.7/site-packages/DELCgen.py", line 1363, in Comparison_Plots mpl = lc.psdModel(plx,*lightcurves[-1].psdFit['x']) TypeError: Fix_BL() takes exactly 5 arguments (6 given)

luca1996c commented 1 year ago

Hi, I met the same problem. Did you find a solution?

sergebor commented 7 months ago

If you are trying the example.py, you should not mix the models, hopefully something like datalc.Fit_PSD(initial_params=[1,0.001, 1.1, 2.5,0],model=BendingPL) will make it work for you. (after fixing syntax-related issues if using py3 :)