weblog generation fails
jjtobin opened this issue · 2 comments
Weblog generation can fail inexplicably sometimes:
CASA 6.4.3.27 -- Common Astronomy Software Applications [6.4.3.27]
IRAS04368+2557 EVLA_X S/N decrease
(0) waiting for viewer process...
(1) waiting for viewer process...
(2) waiting for viewer process...
(3) waiting for viewer process...
(4) waiting for viewer process...
(5) waiting for viewer process...
(6) waiting for viewer process...
(7) waiting for viewer process...
(8) waiting for viewer process...
(9) waiting for viewer process...
(10) waiting for viewer process...
(11) waiting for viewer process...
...{'id': 'casaviewer:5159', 'priority': 0, 'types': array(['shutdown', 'image-view', 'interactive-clean'], dtype='<U18'), 'uri': '0.0.0.0:37679'}
Traceback (most recent call last):
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/site-packages/casashell/private/init_system.py", line 235, in evprop
run_path( args[0], init_globals=exec_globals, run_name='main' )
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/runpy.py", line 85, in run_code
exec(code, run_globals)
File "regenerate_weblog.py", line 15, in
generate_weblog(selfcal_library,solints,bands)
File "selfcal_helpers.py", line 1832, in generate_weblog
render_summary_table(htmlOut,sclib,target,band)
File "selfcal_helpers.py", line 1868, in render_summary_table
'weblog/images/'+sanitize_string(target)+''+band+'_final.image.tt0.png')
File "selfcal_helpers.py", line 1634, in plot_image
im1=im.crop((trim_amount,height-1,width,width-trim_amount-1,0))
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/site-packages/PIL/Image.py", line 1172, in crop
return self._new(self._crop(self.im, box))
File "/home/casa/packages/RHEL7/release/casa-6.4.3-27/lib/py/lib/python3.6/site-packages/PIL/Image.py", line 1186, in _crop
x0, y0, x1, y1 = map(int, map(round, box))
ValueError: too many values to unpack (expected 4)
The workaround for this is to 'rm -rf ~/.casa/viewer', removing all the saved configuration regarding the casaviewer on your system. Then the weblog can run without a problem. however, it would be good to be able to run this without needing to occasionally nuke the viewer settings. Perhaps exporting to fits and using matplotlib for drawing the images is a better way in the future.
Just happened to come across this as I was looking over the code - I think this might be fixed by a pull request that I opened last week, #9. In short, there's an error for the im.crop arguments when the width of a casaviewer image is greater than the height. If this gets fixed up I think that would solve this problem.
Was reminded of this when looking at the other open issue just now - I think this got fixed and can be closed as well?