thomasorb / orcs

ORCS is an analysis engine for SITELLE spectral cubes.
GNU General Public License v3.0
9 stars 6 forks source link

fit_lines_in_region does not complete #4

Closed Lyalpha closed 6 years ago

Lyalpha commented 7 years ago

When running fit_lines_in_region, the process does not seem to complete and the threaded processes that are spawned become zombie quickly and I am left with 1 process running indefinitely until I interrupt (left for at least an hour while trying to fit only a few spaxels in a small region with only a single line).

Tried with different combinations of lines to fit, and values for snr_guess, nofilter, pos_def etc.

>>> from orcs.process import SpectralCube`
>>> from orcs.version import __version__ as orcsver
>>> from orb.version import __version__ as orbver
>>> print orcsver
>>> print orbver
2.2.3
3.1.2
cube = SpectralCube('data/SN3/NGC6946_SN3.merged.cm1.1.0.hdf5')
INFO| Data shape : (2048, 2064, 320)
INFO| Cube is in WAVENUMBER (cm-1)
INFO| Cube is CALIBRATED in wavenumber
>>> cube.fit_lines_in_region('region.reg',
                     ('Halpha',),
                     fmodel='sincgauss',
                     pos_def=['1'],
                     pos_cov=100,
                     sigma_def=['1'],
                     sigma_cov=1,
                     binning=1,
                     snr_guess="auto",
                     nofilter=True)
loading region: Shape : box ( Number(1369.6762),Number(1593.6944),Number(6),Number(6),Number(0) )

WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orcs-2.2.3-py2.7.egg/orcs/core.py:654: RuntimeWarning: invalid value encountered in greater

WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orcs-2.2.3-py2.7.egg/orcs/core.py:658: RuntimeWarning: invalid value encountered in divide

WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orcs-2.2.3-py2.7.egg/orcs/core.py:663: RuntimeWarning: invalid value encountered in greater

WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orcs-2.2.3-py2.7.egg/orcs/core.py:667: RuntimeWarning: invalid value encountered in divide

INFO| Number of spectra to fit: 36
WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orcs-2.2.3-py2.7.egg/orcs/core.py:1546: RuntimeWarning: invalid value encountered in sqrt

WARNING| /home/jdl/anaconda2/envs/astroconda2/lib/python2.7/site-packages/orb_kernel-3.1.2-py2.7-linux-x86_64.egg/orb/utils/image.py:938: RuntimeWarning: Mean of empty slice
  return np.squeeze(np.nanmean(np.nanmean(im_view, axis=3), axis=1))

INFO| Init of the parallel processing server with 8 threads
INFO| 6 lines to fit

 [==========] [100%] [] [remains: 0.000 s]                                    

It remains like this, with 1 process using cpu, until I interrupt.

simon-prunet commented 6 years ago

@thomasorb @Lyalpha Works on my side, well done !!!

Lyalpha commented 6 years ago

Success! Thanks for your help with this!

Lyalpha commented 6 years ago

I find now that

cube.map_sky_velocity(80., div_nb=10)

hangs and I don't know if it is related to this fix (I could run this function ok before). @simon-prunet could you test if you're able to run this? Just so I can check if it something wrong with my end.

Lyalpha commented 6 years ago

After investigating, doesn't look to be related. Opened #32 instead.