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

make_clean_mask.py crashes with odd numpy error #54

Closed amisk closed 6 years ago

amisk commented 6 years ago

Hi,

I am trying to run the Initial Subtract Fast Pipeline. After the wsclean_high step, when it starts PyBDSF to create a mask, it crashes.

Here's the command: python /opt/soft/lofar-stuff/prefactor/scripts/make_clean_mask.py /home/amisk/N3432/target/work/Initial-Subtract-Fast/L192989_SAP000_SB000_uv_123A9AE4Dt_137MHz.pre-cal.wsclean_high-image.fits /home/amisk/N3432/target/work/Initial-Subtract-Fast/L192989_SAP000_SB000_uv_123A9AE4Dt_137MHz.pre-cal.wsclean_high-image.mask_high --threshpix=5 --atrous_jmax=3 --adaptive_rmsbox=True --trim_by=0.1 --img_format=fits --threshisl=3 --rmsbox="(60,20)" --atrous_do=True

Checking islands for overlap ............ : [Traceback (most recent call last):-------------------------------------------------------------------------------] 0/113
  File "/opt/soft/lofar-stuff/prefactor/scripts/make_clean_mask.py", line 793, in <module>
    region_file=args.region_file)
  File "/opt/soft/lofar-stuff/prefactor/scripts/make_clean_mask.py", line 612, in main
    atrous_jmax=atrous_jmax)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/__init__.py", line 245, in process_image
    img.process(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/image.py", line 126, in process
    success = interface.process(self, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/interface.py", line 53, in process
    _run_op_list(img, op_chain)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/__init__.py", line 151, in _run_op_list
    op(img)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/wavelet_atrous.py", line 271, in __call__
    tot_flux = check_islands_for_overlap(img, wimg)
  File "/usr/local/lib/python2.7/dist-packages/bdsf-1.8.12-py2.7-linux-x86_64.egg/bdsf/wavelet_atrous.py", line 723, in check_islands_for_overlap
    orig_islands = ne.evaluate('wav_rankim_bool * ipp - 1')
  File "/usr/lib/python2.7/dist-packages/numexpr/necompiler.py", line 742, in evaluate
    return compiled_ex(*arguments, **kwargs)
ValueError: Using `oa_ndim == 0` when `op_axes` is NULL. Use `oa_ndim == -1` or the MultiNew iterator for NumPy <1.8 compatibility

It happens when atrous is used and there, according to the error, when it searches for overlaps. We use numpy 1.13.3. It also happens on a totally different dataset. It might also be something within numpy, I don't know. I was looking for files containing "oa_ndim" and it appears that I only have one binary file containing this...

I tried different numpy versions, but if I use some version <1.13, it crashes because it cannot load some module.

Any Ideas?

amisk commented 6 years ago

Thanks to David for the tip of upgrading numexpr. I though that would be part of numpy.

Issue can be closed now.