From 56c946e2ec3ce09e02960a8ae8a308a8acb0a4fa Mon Sep 17 00:00:00 2001 From: Darrell Schiebel Date: Tue, 9 Jan 2024 15:06:45 -0500 Subject: [PATCH] fix cursor tracking string update for pixels == 0 --- casagui/apps/_interactiveclean.py | 17 +++++++++++------ casagui/toolbox/_cube.py | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/casagui/apps/_interactiveclean.py b/casagui/apps/_interactiveclean.py index 8f03780..bcd45d2 100644 --- a/casagui/apps/_interactiveclean.py +++ b/casagui/apps/_interactiveclean.py @@ -406,12 +406,17 @@ def __init__( self, vis, imagename, usemask='user', mask='', initial_mask_pixel= ### --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- 'update-converge': '''function update_convergence( msg ) { let convdata - if ( typeof msg === 'undefined' && '_convergence_data' in flux_src ) { - // use complete convergence cache attached to flux_src... - // get the convergence data for channel and stokes - const pos = img_src.cur_chan - convdata = flux_src._convergence_data.chan.get(pos[1]).get(pos[0]) - // chan-------------------------------^^^^^^ ^^^^^^----stokes + if ( typeof msg === 'undefined' ) { + if ( '_convergence_data' in flux_src ) { + // use complete convergence cache attached to flux_src... + // get the convergence data for channel and stokes + const pos = img_src.cur_chan + convdata = flux_src._convergence_data.chan.get(pos[1]).get(pos[0]) + // chan-------------------------------^^^^^^ ^^^^^^----stokes + } else { + console.log( 'Insert code here to get convergence data when no cache and no update (msg) is available...' ) + return + } } else if ( 'result' in msg ) { // update based on msg received from convergence update message convdata = msg.result.converge diff --git a/casagui/toolbox/_cube.py b/casagui/toolbox/_cube.py index 890e024..87aea0d 100644 --- a/casagui/toolbox/_cube.py +++ b/casagui/toolbox/_cube.py @@ -1856,8 +1856,8 @@ def connect( self ): movement_code_pixel_update = '''if ( cb_obj.event_type === 'move' ) { function update_pixel( msg ) { if ( msg.update && - msg.update.pixel && - msg.update.index && + 'pixel' in msg.update && + 'index' in msg.update && msg.update.index.length == 2 ) { const digits = 5 if ( pix_wrld && pix_wrld.label == 'pixel' ) {