Ejemplo n.º 1
0
 def plotCloudImage(self):
     """Generate some additional information and plots about the cloud image, if desired."""
     from pImagePlots import PImagePlots
     import pylab
     im = PImagePlots()
     im.setImage(self.cloudimage)
     im.showImage(copy=True)
     im.hanningFilter()
     im.calcAll()
     im.showPsd2d()
     im.showAcovf2d()
     im.showAcovf1d()
     im.showSf(linear=True)
     #pylab.show()
     return
Ejemplo n.º 2
0
# Start here to invert from FFT (useI = False, and will get perfect reconstruction). 
im.invertFft(useI=True)

# Use im2 to recalculate 1d PSD/ACovF starting from the reconstructed image, without altering the original. 
im2 = PImagePlots()
im2.setImage(im.imageI.real, copy=True)
im2.calcAll(min_dr=1.0, min_npix=2)
im2.plotMore()

# Now start plotting things, in comparison. 
clims = im.showImage()
#print clims
im2.showImage(clims=clims)
im2.showImage()
im.showFft(clims=clims)
im2.showFft(clims=clims)
im.showPsd2d()
im2.showPsd2d()
im.showPhases()
im2.showPhases()
im.showAcovf2d()
im2.showAcovf2d(imag=False)
im.showPsd1d(comparison=im2)
im.showAcovf1d(comparison=im2)
im.showSf(linear=True, comparison=im2)

pylab.show()
exit()

Ejemplo n.º 3
0
    # Trim image to desired final size
    trim = round((imsize - final_imsize)/2.0)
    print 'Trimming about %d pixels from each side' %(trim)
    image = im.imageI[trim:trim+final_imsize, trim:trim+final_imsize]
    image = rescaleImage(image.real, sigma_goal, kappa)
    imsize = len(image)
    pixscale = pixscale
    rad_fov = imsize/2.0*pixscale
    print 'Image After Trimming: Rad_fov', rad_fov, 'Imsize', imsize, 'Pixscale', pixscale, 'deg/pix', '(', pixscale*60.*60., 'arcsec/pix)'    
    im.setImage(image.real)
    imageStats(im.image)
    im.showImage(copy=True)
    im.hanningFilter()
    im.calcAll()
    im.showPsd2d()
    im.showAcovf2d()
    im.showAcovf1d(comparison=im)

    # And also try to make an image with the same (final) pixel scale, but that will be created (first)
    #  larger and then scaled down, to avoid introducing artifacts from the ACovF1d being truncated. 
    final_imsize = 1500 # pixels desired in final image
    final_rad_fov = 1.75*numpy.sqrt(2) # degrees
    final_pixscale = 2*final_rad_fov / float(final_imsize)
    # Start with larger image 
    pixscale = final_pixscale
    rad_fov = final_rad_fov*2. 
    imsize = int(2*rad_fov / pixscale)
    if (imsize%2 != 0):
        imsize = imsize + 1
    xr = xsf / pixscale # xr = in pixels, over range that want to simulate
    print 'Image: Rad_fov', rad_fov, 'Imsize', imsize, 'Pixscale', pixscale, 'deg/pix', '(', pixscale*60.*60., 'arcsec/pix)'