featuremapper/command.py
def _make_key_image(self, p):
        """
        Generate the image with keys to hues used to code angles the image is
        saved on-the-fly, in order to fit the current choice of angle range
        """
        width = 60
        height = 300
        border = 6
        n_a = 7
        angle_0 = p.angle_0
        angle_1 = p.angle_1
        a_step = 0.5 * ( angle_1 - angle_0 ) / float(n_a)
        x_0 = border
        x_1 = ( width - border ) / 2
        x_a = x_1 + 2 * border
        y_use = height - 2 * border
        y_step = y_use / float(n_a)
        y_d = int(float(0.5 * y_step))
        y_0 = border + y_d
        l = 15

        hues = ["hsl(%2d,100%%,50%%)" % h for h in range(0, 360, 360 / n_a)]
        angles = [0.5 * angle_0 + a_step * a for a in range(n_a)]
        y_pos = [int(np.round(y_0 + y * y_step)) for y in range(n_a)]
        deltas = [(int(np.round(l * np.cos(a))),
                   int(np.round(l * np.sin(a)))) for a in angles]
        lb_img = PILImage.new("RGB", (width, height), "white")
        dr_img = ImageDraw.Draw(lb_img)

        for h, y, d in zip(hues, y_pos, deltas):
            dr_img.rectangle([(x_0, y - y_d), (x_1, y + y_d)], fill=h)
            dr_img.line([(x_a, y), (x_a + d[0], y + d[1])], fill="black")
            dr_img.line([(x_a, y), (x_a + d[0], y - d[1])], fill="black")

        lb_img.save(p.key_img_fname)

        return ( self.key_img_fname )

        Generate the image with keys to hues used to code angles the image is
        saved on-the-fly, in order to fit the current choice of angle range
        
Generate the image with keys to hues used to code angles the image is
saved on-the-fly, in order to fit the current choice of angle range
Generate the image with keys to hues used to code angles the image is saved on - the - fly in order to fit the current choice of angle range
def _make_key_image(self, p):
        width = 60
        height = 300
        border = 6
        n_a = 7
        angle_0 = p.angle_0
        angle_1 = p.angle_1
        a_step = 0.5 * ( angle_1 - angle_0 ) / float(n_a)
        x_0 = border
        x_1 = ( width - border ) / 2
        x_a = x_1 + 2 * border
        y_use = height - 2 * border
        y_step = y_use / float(n_a)
        y_d = int(float(0.5 * y_step))
        y_0 = border + y_d
        l = 15
        hues = ["hsl(%2d,100%%,50%%)" % h for h in range(0, 360, 360 / n_a)]
        angles = [0.5 * angle_0 + a_step * a for a in range(n_a)]
        y_pos = [int(np.round(y_0 + y * y_step)) for y in range(n_a)]
        deltas = [(int(np.round(l * np.cos(a))),
                   int(np.round(l * np.sin(a)))) for a in angles]
        lb_img = PILImage.new("RGB", (width, height), "white")
        dr_img = ImageDraw.Draw(lb_img)
        for h, y, d in zip(hues, y_pos, deltas):
            dr_img.rectangle([(x_0, y - y_d), (x_1, y + y_d)], fill=h)
            dr_img.line([(x_a, y), (x_a + d[0], y + d[1])], fill="black")
            dr_img.line([(x_a, y), (x_a + d[0], y - d[1])], fill="black")
        lb_img.save(p.key_img_fname)
        return ( self.key_img_fname )
def _make_key_image ( self , p ) : width = 60 height = 300 border = 6 n_a = 7 angle_0 = p . angle_0 angle_1 = p . angle_1 a_step = 0.5 * ( angle_1 - angle_0 ) / float ( n_a ) x_0 = border x_1 = ( width - border ) / 2 x_a = x_1 + 2 * border y_use = height - 2 * border y_step = y_use / float ( n_a ) y_d = int ( float ( 0.5 * y_step ) ) y_0 = border + y_d l = 15 hues = [ "hsl(%2d,100%%,50%%)" % h for h in range ( 0 , 360 , 360 / n_a ) ] angles = [ 0.5 * angle_0 + a_step * a for a in range ( n_a ) ] y_pos = [ int ( np . round ( y_0 + y * y_step ) ) for y in range ( n_a ) ] deltas = [ ( int ( np . round ( l * np . cos ( a ) ) ) , int ( np . round ( l * np . sin ( a ) ) ) ) for a in angles ] lb_img = PILImage . new ( "RGB" , ( width , height ) , "white" ) dr_img = ImageDraw . Draw ( lb_img ) for h , y , d in zip ( hues , y_pos , deltas ) : dr_img . rectangle ( [ ( x_0 , y - y_d ) , ( x_1 , y + y_d ) ] , fill = h ) dr_img . line ( [ ( x_a , y ) , ( x_a + d [ 0 ] , y + d [ 1 ] ) ] , fill = "black" ) dr_img . line ( [ ( x_a , y ) , ( x_a + d [ 0 ] , y - d [ 1 ] ) ] , fill = "black" ) lb_img . save ( p . key_img_fname ) return ( self . key_img_fname )
Generate the image with keys to hues used to code angles the image is
saved on-the-fly, in order to fit the current choice of angle range
Generate the image with keys to hues used to code angles the image is saved on - the - fly in order to fit the current choice of angle range
"""
        Generate the image with keys to hues used to code angles the image is
        saved on-the-fly, in order to fit the current choice of angle range
        """
self
p