Skip to content

Commit

Permalink
fix segv w/ fetching pixels while tclean is running
Browse files Browse the repository at this point in the history
  • Loading branch information
schiebel committed Jan 9, 2024
1 parent 0dc3a39 commit 194b45f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions casagui/apps/_interactiveclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def __init__( self, vis, imagename, usemask='user', mask='', initial_mask_pixel=
if ( slider ) slider.disabled = true
if ( go_to ) go_to.disabled = true
image_fig.disabled = true
if ( cursor_tracking_text) { cursor_tracking_text.disabled = true }
if ( spectra_fig ) spectra_fig.disabled = true
if ( with_stop ) {
btns['stop'].disabled = true
Expand All @@ -508,6 +509,7 @@ def __init__( self, vis, imagename, usemask='user', mask='', initial_mask_pixel=
if ( slider ) slider.disabled = false
if ( go_to ) go_to.disabled = false
image_fig.disabled = false
if ( cursor_tracking_text) { cursor_tracking_text.disabled = false }
if ( spectra_fig ) spectra_fig.disabled = false
if ( ! only_stop ) {
btns['continue'].disabled = false
Expand Down Expand Up @@ -958,7 +960,7 @@ def convergence_handler( msg, self=self ):
self._fig['slider'] = None
self._fig['spectra'] = None


self._fig['cursor_pixel_text'] = self._cube.pixel_tracking_text( )
self._cb['clean'] = CustomJS( args=dict( btns=self._control['clean'],
state=dict( mode='interactive', stopped=False, awaiting_stop=False, mask="" ),
ctrl_pipe=self._pipe['control'], conv_pipe=self._pipe['converge'],
Expand All @@ -977,6 +979,7 @@ def convergence_handler( msg, self=self ):
slider=self._fig['slider'],
image_fig=self._fig['image'],
spectra_fig=self._fig['spectra'],
cursor_tracking_text = self._fig['cursor_pixel_text'],
stopstatus=self._status['stopcode'],
cube_obj = self._cube.js_obj( ),
go_to = self._control['goto'],
Expand Down Expand Up @@ -1080,7 +1083,7 @@ def convergence_handler( msg, self=self ):
help_button,
),
self._fig['image'],
self._cube.pixel_tracking_text( ),
self._fig['cursor_pixel_text'],
height_policy='max', width_policy='max',
),
column( Tabs( tabs=[ TabPanel(child=column( row( self._control['clean']['stop'],
Expand Down
4 changes: 3 additions & 1 deletion casagui/toolbox/_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ async def mod_mask( msg, self=self ):
self._mask_add_sub['add'],
self._mask_add_sub['sub'] ],
tooltips=None ), **kw )

###
### set tools that are active by default
###
Expand Down Expand Up @@ -1877,7 +1878,8 @@ def connect( self ):
var geometry = cb_data['geometry'];
var x_pos = Math.floor(geometry.x);
var y_pos = Math.floor(geometry.y);
if ( isFinite(x_pos) && isFinite(y_pos) ) {
if ( ! pixlabel.disabled && isFinite(x_pos) && isFinite(y_pos) ) {
/* SEGV: cannot fetch pixels while tclean may be modifying the image */
ctrl.send( ids['pixel-value'],
{ action: 'pixel',
value: { chan: imageds.cur_chan, index: [ x_pos, y_pos ] } },
Expand Down

0 comments on commit 194b45f

Please sign in to comment.