#NEWLINE# def updatePixels( self , tlc , shape , props , **pixelBlocks ) : #NEWLINE# #INDENT# t = np . array ( pixelBlocks [ 'temperature_pixels' ] , dtype = 'f4' , copy = False ) #NEWLINE# s = np . array ( pixelBlocks [ 'salinity_pixels' ] , dtype = 'f4' , copy = False ) #NEWLINE# tMinA = 17.99 #NEWLINE# tMinP = 26.37 #NEWLINE# tMaxP = 29.15 #NEWLINE# tMaxA = 33.35 #NEWLINE# np . putmask ( t , ( t <= tMinP ) , ( ( t - tMinA ) / ( tMinP - tMinA ) ) ) #NEWLINE# np . putmask ( t , ( t >= tMaxP ) , ( ( t - tMaxA ) / ( tMaxP - tMaxA ) ) ) #NEWLINE# np . putmask ( t , ( ( t > tMinP ) & ( t < tMaxP ) ) , 1 ) #NEWLINE# np . putmask ( t , ( t < 0 ) , 0 ) #NEWLINE# sMinA = 28.81 #NEWLINE# sMinP = 32.27 #NEWLINE# sMaxP = 35.81 #NEWLINE# sMaxA = 36.79 #NEWLINE# np . putmask ( s , ( s <= sMinP ) , ( ( sMinA - sMinA ) / ( sMinP - sMinA ) ) ) #NEWLINE# np . putmask ( s , ( s >= sMaxP ) , ( ( s - sMaxA ) / ( sMaxP - sMaxA ) ) ) #NEWLINE# np . putmask ( s , ( ( s > sMinP ) & ( s < sMaxP ) ) , 1 ) #NEWLINE# np . putmask ( s , ( s < 0 ) , 0 ) #NEWLINE# pixelBlocks [ 'output_pixels' ] = np . array ( ( ( t * s ) * self . depth ) ) . astype ( props [ 'pixelType' ] , copy = False ) #NEWLINE# return pixelBlocks