from numpy import *
from matplotlib import *
from matplotlib.pylab import *
import pyfits

workmain = '/AstroCode/EMC2/'
thisrundir = 'Bayes-Image-Analysis_dvd_060818/'
filen='do_emc2c1_HlfSquishICSPionBremss539.0.060912_on_Pois539.X.060612.it1000.ms100gamttlcnt_1_.05FixS0.061002a.moments.fits'

HlfSquishMomentsHDULst = pyfits.open(workmain+thisrundir+filen)

print HlfSquishMomentsHDULst[0].header
print HlfSquishMomentsHDULst[0].data.shape
print HlfSquishMomentsHDULst[0].data[0]

HlfSquishMomentsHDULst.close()

#rc('axes', hold=True)
#rc('image', origin='upper')
#figure(1, frameon=False)

#HlfSquishMoment1FigImage = figimage(HlfSquishMomentsHDULst[0].data[1],
#    xo=70, yo=70,
#    alpha=1.0,
#    norm=None,
#    cmap=None,
#    vmin=None, vmax=None,
#    origin=None)
##clim(-1,2)
#HlfSquishMomentFigImage.set_image_extent(-30, 30, -30, 30)
#jet()
#colorbar()

#HlfSquishMoment1AxesImage = imshow(HlfSquishMomentsHDULst[0].data[1],
#    cmap=cm.jet,
#    norm=None, aspect=None, 
#    interpolation='nearest',
#    alpha=0.0,
#    vmin=None, vmax=None,
#    origin='lower')
#colorbar()
#box(on=False)
HlfSquishSqrtMoment1AxesImage = imshow(sqrt(HlfSquishMomentsHDULst[0].data[1]),
    cmap=cm.jet,
    norm=None, aspect=None, 
    interpolation='nearest',
    alpha=1.0,
    vmin=None, vmax=None,
    origin='lower')
#box(on=False)
#delaxes()
#grid(b=True)

grid(False)

colorbar()
#xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(yticklabels, None)
#setp(xticklabels, 'color', 'r', fontsize='medium')
#setp(yticklabels, None)
#setp(xticklabels, None)
#xgridlines = getp(gca(), 'xgridlines')
show()
#--------end of test??------------------#

