lofar-astron / PyBDSF

Python Blob Detector and Source Finder
https://pybdsf.readthedocs.io
GNU General Public License v3.0
50 stars 24 forks source link

ValueError: cannot convert float NaN to integer #44

Open twshimwell opened 6 years ago

twshimwell commented 6 years ago

Hi,

Anyone seen this issue before?

Thanks,

Tim

--> Wavelet scale #4
--> Calculating background rms and mean images
Using user-specified rms_box ............ : (165, 55) pixels
--> Using 2D map for background rms
--> Using constant background mean
Min/max values of background rms map .... : (0.00003, 0.00658) Jy/beam
Value of background mean ................ : 0.0 Jy/beam
Number of islands found ................. : 64
Fitting islands with Gaussians .......... : [=========/software/rhel7/lib64/python2.7/site-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.
  warnings.warn("Mean of empty slice.", RuntimeWarning)
Thread raised exception cannot convert float NaN to integer
Traceback of thread is:
-------------------------
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/multi_proc.py", line 53, in worker
    result = f(val)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/functions.py", line 2044, in eval_func_tuple
    return f_args[0](*f_args[1:])
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/gausfit.py", line 238, in process_island
    gaul, fgaul = self.fit_island(isl, opts, img)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/gausfit.py", line 301, in fit_island
    gaul = self.inigaus_nobeam(isl, thr0, beam, img)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/gausfit.py", line 576, in inigaus_nobeam
    max(0,int(ym[i+1]-avsize/2)):min(im.shape[1],int(ym[i+1]+avsize/2))] = True
-------------------------
Fitting islands with Gaussians .......... : [=========================================================Traceback (most recent call last):
  File "sourcefind-intermediate.py", line 18, in <module>
    img = bdsm.process_image(catprefix,detection_image=catprefix.replace('.int','.app'),thresh_isl=4.0, thresh_pix=5.0, rms_box=(160,50), rms_map=True, mean_map='zero', ini_method='intensity', adaptive_rms_box=True, adaptive_thresh=150, rms_box_bright=(60,15), group_by_isl=False, group_tol=10.0,output_opts=True, output_all=True, atrous_do=True,atrous_jmax=4, flagging_opts=True, flag_maxsize_fwhm=0.5,advanced_opts=True, blank_limit=None,frequency=restfrq)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/__init__.py", line 245, in process_image
    img.process(**kwargs)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/image.py", line 126, in process
    success = interface.process(self, **kwargs)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/interface.py", line 53, in process
    _run_op_list(img, op_chain)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/__init__.py", line 151, in _run_op_list
    op(img)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/wavelet_atrous.py", line 186, in __call__
    op(wimg)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/gausfit.py", line 96, in __call__
    bar=bar, weights=weights)
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/multi_proc.py", line 222, in parallel_map
    results = run_tasks(procs, err_q, out_q, len(sequence))
  File "/home/shimwell/.local/lib/python2.7/site-packages/bdsf-1.8.11-py2.7-linux-x86_64.egg/bdsf/multi_proc.py", line 113, in run_tasks
    raise err_q.get()
ValueError: cannot convert float NaN to integer
twshimwell commented 6 years ago

Dont bother looking at this yet. I'll just update my repository and try again first (sorry should have done this before).

twshimwell commented 6 years ago

yeh still there in the latest master.

epolisensky commented 6 years ago

yep, I'm getting this error too. running 1.8.13

gmloose commented 1 year ago

Is this still an issue with latest PyBDSF (v1.10.2)?