# import sys full_path = sys.path[0] + '/' + 'SimEvents.fits' # # Find out what the names of the HDUs in the file. # hdus = ntc.getNTupleNames ( full_path ) print "Names of the Header/Data Units are..." print hdus events = ntc.createDataArray ( full_path, hdus[1] ) # Set matrix of ploats canvas.setPlotMatrix ( 3, 3 ) from hippo import Display, Cut # # Create a 1D histogram # hist = Display ( "Histogram", events, ('GLON', ) ) canvas.addDisplay ( hist ) # # First create cuts individually # from hippo import Cut cut1 = Cut ( events, ( 'zenith_angle', ) ) canvas.addDisplay ( cut1 )
from load_hippo import app, canvas # # Create NTuple with its controller so Inspector can see it. # from hippo import NTupleController ntc = NTupleController.instance() # # Create full path to example file in case this script is not run from # this directory. # full_path = sys.path[0] + '/' + 'aptuple.tnt' nt1 = ntc.createNTuple ( full_path ) canvas.setPlotMatrix ( 2, 3 ) from hippo import Display hist = Display ( "Histogram", nt1, ("Cost", ) ) canvas.addDisplay( hist ) # Get the data representation so we can add function to it. datarep1 = hist.getDataRep() from hippo import Function gauss = Function ( "Gaussian", datarep1 ) gauss.addTo ( hist ) # Get the function parameters and display them. print "Before fitting" parmnames = gauss.parmNames ( ) print parmnames
# # Get full path to examplefile in case this script is not run from this # directory. # import sys full_path = sys.path[0] + '/' + 'aptuple.tnt' # Read an ASCII NTuple file to create an NTuple. ntc = NTupleController.instance() nt1 = ntc.createNTuple ( full_path ) from hippo import Display # Change the matrix from the default canvas.setPlotMatrix ( 3, 4 ) # Create the displays. hist = Display ("Histogram", nt1, ('Cost', ) ) canvas.addDisplay( hist ) profile = Display ( "Profile", nt1, ('Age', 'Cost' )) canvas.addDisplay ( profile ) color = Display ( "Color Plot", nt1, ('Age', 'Cost' )) color.setBinWidth ( 'x', 1.0 ) canvas.addDisplay ( color ) contour = Display ( "Contour Plot", nt1, ('Age', 'Cost' )) contour.setBinWidth ( 'x', 1.0 )
""" from load_hippo import app, canvas import hippo, hippofft num = None try: import numpy as num import numpy.random as ra except : import numarray as num import num.random_array as ra canvas.setPlotMatrix ( 1, 3 ) # # generate a random ordered sequence # npts = 400000 times = num.sort ( ra.uniform ( 1e9, 1e10, (npts, ) ) ) ds = hippo.NumArrayTuple () ds.addColumn ( 'times', times ) # # Use the hippo FFT utility to get binned light curve display the # normalized contents of the bins # lightcurve, bintimes = hippofft.simpleLightCurve( ds,'times', numberbins=4096 )