Skip to content

Commit

Permalink
Field plotting fix for PyVQ
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaxwilson committed Nov 22, 2017
1 parent a90b1df commit 79bc083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PyVQ/pyvq/pyvq.py
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ def create_field_image(self, angles=None, masked=True):

# FIGURE 1 canvas.tostring_argb give pixmap in ARGB mode. Roll the ALPHA channel to have it in RGBA mode
buf = np.roll ( buf, 3, axis = 2 )
im1 = Image.fromstring( "RGBA", ( w ,h ), buf.tostring( ) )
im1 = Image.frombytes( "RGBA", ( w ,h ), buf.tostring( ) )

# FIGURE 2 draw the renderer
fig2.canvas.draw()
Expand All @@ -1903,7 +1903,7 @@ def create_field_image(self, angles=None, masked=True):

# FIGURE 2 canvas.tostring_argb give pixmap in ARGB mode. Roll the ALPHA channel to have it in RGBA mode
buf = np.roll ( buf, 3, axis = 2 )
im2 = Image.fromstring( "RGBA", ( w ,h ), buf.tostring( ) )
im2 = Image.frombytes( "RGBA", ( w ,h ), buf.tostring( ) )

if self.field_type == 'displacement' or self.field_type == 'insar':
# FIGURE 3 draw the renderer for the sea mask
Expand All @@ -1915,7 +1915,7 @@ def create_field_image(self, angles=None, masked=True):

# FIGURE 3 canvas.tostring_argb give pixmap in ARGB mode. Roll the ALPHA channel to have it in RGBA mode
buf = np.roll ( buf, 3, axis = 2 )
im3 = Image.fromstring( "RGBA", ( w ,h ), buf.tostring( ) )
im3 = Image.frombytes( "RGBA", ( w ,h ), buf.tostring( ) )
mask = im3.convert('L')

# Clear all three figures
Expand Down

0 comments on commit 79bc083

Please sign in to comment.