示例#1
0
def show_image_with_edges(im, splines, img, debug):

    if debug:
        print('plotting the extracted spectra on the slit image')

    y_dim, x_dim = numpy.shape(im)
    x = numpy.arange(0, x_dim, 1)
    # collopse the image on the y-axis

    # start with a rectangular Figure
    pl.figure(num=None, figsize=(14, 10))

    z1, z2 = saltimagetools.zscale(im, 0.25)
    colmap = pl.cm.Greys

    pl.imshow(im, cmap=colmap, vmin=z1, vmax=z2, origin='lower')
    for i in range(0, len(splines)):
        left_edge = splines[i][0]
        right_edge = splines[i][1]
        pl.plot(x, left_edge, 'b-')
        pl.plot(x, right_edge, 'r-')

    pl.xlim((-10, x_dim + 10))
    pl.ylim((-10, y_dim + 10))
    pl.title('Slits detected on %s' % img)
    pl.xlabel('x - pixels')
    pl.ylabel('y - pixels')

    pl.show()
示例#2
0
文件: mostools.py 项目: rirze/pysalt
def show_image_with_edges(im, splines, img, debug):

    if debug:
        print 'plotting the extracted spectra on the slit image'

    y_dim, x_dim = numpy.shape(im)
    x = numpy.arange(0, x_dim, 1)
    # collopse the image on the y-axis

    # start with a rectangular Figure
    pl.figure(num=None, figsize=(14, 10))

    z1, z2 = saltimagetools.zscale(im, 0.25)
    colmap = pl.cm.Greys

    pl.imshow(im, cmap=colmap, vmin=z1, vmax=z2, origin='lower')
    for i in range(0, len(splines)):
        left_edge = splines[i][0]
        right_edge = splines[i][1]
        pl.plot(x, left_edge, 'b-')
        pl.plot(x, right_edge, 'r-')

    pl.xlim((-10, x_dim + 10))
    pl.ylim((-10, y_dim + 10))
    pl.title('Slits detected on %s' % img)
    pl.xlabel('x - pixels')
    pl.ylabel('y - pixels')

    pl.show()
示例#3
0
 def setScale(self):
     # Set scale parameters
     if self.scale=='minmax':
         self.vmin=np.min(self.image)
         self.vmax=np.max(self.image)
     elif self.scale=='zscale':
         self.vmin,self.vmax=zscale(self.image,self.contrast)
     else:
         self.vmin=None
         self.vmax=None