Skip to content

Commit

Permalink
gaia: make no value for mask match the documented behaviour
Browse files Browse the repository at this point in the history
which is to not mask any areas with non-zero values
  • Loading branch information
pwdraper committed Oct 8, 2014
1 parent 9167f8a commit 5ca307b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions applications/gaia/gaia/generic/GaiaArray.C
Expand Up @@ -2881,6 +2881,9 @@ void gaiaArrayMaskData( ARRAYinfo *dataInfo, ARRAYinfo *maskInfo,
destptr[i] = badValue; \
} \
} \
else if ( maskValue == 0 && ! seebad ) { \
destptr[i] = badValue; \
} \
else { \
if ( seebad ) { \
destptr[i] = badValue; \
Expand Down Expand Up @@ -2986,6 +2989,9 @@ void gaiaArrayMaskData( ARRAYinfo *dataInfo, ARRAYinfo *maskInfo,
destptr[i] = badValue; \
} \
} \
else if ( maskValue == 0 && ! seebad ) { \
destptr[i] = badValue; \
} \
else { \
if ( seebad ) { \
destptr[i] = badValue; \
Expand Down
7 changes: 4 additions & 3 deletions applications/gaia/gaia/library/GaiaMask.tcl
Expand Up @@ -360,17 +360,18 @@ itcl::class gaia::GaiaMask {
set bitpix [$itk_option(-rtdimage) bitpix]
set el [expr [$itk_option(-rtdimage) width] * \
[$itk_option(-rtdimage) height]]
set isfits [$itk_option(-rtdimage) isfits]

# And wrap as an array structure.
set image_adr_ [array::wrap $adr $bitpix $el]
set image_adr_ [array::wrap $adr $bitpix $el $isfits]
}

# Apply the mask to to the image and display, returns the masked
# copy as an array.
set range [get_values_]
if { [catch {set adr [array::maskdata $image_adr_ $mask_adr_ $range]} msg] } {
$history_ clear_last
error_dialog "Failed to mask data: $msg"
error "Failed to mask data: $msg"
return
}

Expand Down Expand Up @@ -496,7 +497,7 @@ itcl::class gaia::GaiaMask {
protected variable mask_namer_ {}

# Mask values to display.
protected variable values_ {}
protected variable values_ 0

# The GaiaHistory instance used for "Go" menu.
protected variable history_ {}
Expand Down

0 comments on commit 5ca307b

Please sign in to comment.