                          repeat = 3,
                          number = 100)
    print('Slow time: {}'.format(min(times)))

# Compute the fast time
def fast_time():
    SETUP_CODE = '''
from __main__ import compute_u_direct_fast, func
import numpy as np
'''

    TEST_CODE = '''
Nx = 200
Ny = 200
Lx = 200
Ly = 200
npoints = 2000
Ndirect = 21

rng = np.random.default_rng()
points = (rng.random((npoints, 2)) - 0.5)*(Lx)
values = func(points[:,0], points[:,1])
values = np.array([values])
positions = np.concatenate((points, values.T), axis = 1)
z = positions[:,2]
r = positions[:,0:2]
[udirect_fast] = compute_u_direct_fast(Lx, Ly, Ndirect, r, z)'''
    
    # timeit.repeat statement
    times = timeit.repeat(setup = SETUP_CODE,
                          stmt = TEST_CODE,
                          repeat = 3,
                          number = 100)
    print('Fast time: {}'.format(min(times)))
    


if __name__ == "__main__":
    #fft_time()
    #slow_time()
    #fast_time()

    # Set up the system
    Nx = 200
    Ny = 200
    Lx = 200
    Ly = 200
    Nxgrid = Nx * 1j
    Nygrid = Ny * 1j
    npoints = 2000
    Ndirect = 11

    # Set the direct calc cutoff
    qcutoff_direct = 2.0*np.pi/Lx
    
    # Create some random points
    rng = np.random.default_rng()
    points = (rng.random((npoints, 2)) - 0.5)*(Lx)
    # Put on a uniform grid
    #points[:,0] = np.arange(-Lx/2, Lx/2, 1)
    #points[:,1] = np.arange(-Ly/2, Ly/2, 1)
    values = func(points[:,0], points[:,1])
    values = np.array([values])
    
    # Concatenate together to make something like a position statement
    positions = np.concatenate((points, values.T), axis = 1)
    
    z = positions[:,2]
    r = positions[:,0:2]
    
    ################
    # Interpolation method on a grid
    ################
    
    # Save the information
    [u_fft, qcutoff_fft] = compute_u_fft(Lx, Ly, Nx, Ny, r, z)
    
    ################
    # Original direct (slow) version
    ################
    [udirect_slow] = compute_u_direct_slow(Lx, Ly, Ndirect, r, z)
    
    ################
    # Fast direct version?
    ################
    [udirect_fast] = compute_u_direct_fast(Lx, Ly, Ndirect, r, z)
    
    ################
    # Plot everythig to compare
    ################
    fig, axarr = plt.subplots(1, 3)
    axarr[0].imshow(np.abs(u_fft.T), origin = 'lower')
    axarr[1].imshow(np.abs(udirect_slow.T), origin = 'lower')
    axarr[2].imshow(np.abs(udirect_fast.T), origin = 'lower')
    
    plt.show()

    # Up to here, everything looks good, except for the normalization factor. Need to figure
    # out the difference in the scaling of the real and imaginary parts

    # Find the maximum value in abs space, and then use that to draw a 1D line across each one to compare
    idx_fft     = np.unravel_index(np.argmax(u_fft, axis=None), u_fft.shape)
    idx_slow    = np.unravel_index(np.argmax(udirect_slow, axis=None), udirect_slow.shape)
    idx_fast    = np.unravel_index(np.argmax(udirect_fast, axis=None), udirect_fast.shape)


    #print(f"Bailing early to figure out scaling argument")
    #sys.exit(1)

    # Save everything to compare radial averaging
    uq_2d_fft = u_fft
    uq_2d_slow = udirect_slow
    uq_2d_fast = udirect_fast

    # Chose a deltaq
    deltaq = 0.0375

    [radii_fft, intensity_fft] = radial_average(uq_2d_fft, deltaq, qcutoff_fft)
    [radii_slow, intensity_slow] = radial_average(uq_2d_slow, deltaq, qcutoff_direct)
    [radii_fast, intensity_fast] = radial_average(uq_2d_fast, deltaq, qcutoff_direct)

    su_fft  = np.square(intensity_fft)*len(z)
    su_slow = np.square(intensity_slow)*len(z)
    su_fast = np.square(intensity_fast)*len(z)

    fig, axarr = plt.subplots(1, 1)

    axarr.scatter(radii_fft, su_fft, color = 'b', marker = '+', linewidth = 1)
    axarr.scatter(radii_slow, su_slow, color = 'r', marker ='s', s = 80, facecolors = 'none')
    axarr.scatter(radii_fast, su_fast, color ='m', marker = 'o', s = 80, facecolors = 'none')

    axarr.set_yscale('log')
    axarr.set_xscale('log')

    fig.tight_layout()
    plt.show()
Writing NSW Writer & Scientist Grant
The Writer & Scientist Grant is awarded by Writign NSW visit the Writing NSW website.I don't really see how anything I said implies cognitive dissonance...

I like less regulation in the market, in general. In other words I am in favor of a freer market. This would imply that I would want the government to apply regulations like antitrust laws only in the most severe cases.

The fact that I think they should take action against Disney in the near future, is not inconsistent with my beliefs, but serves to illustrate both the limit of my belief in the free market and my assessment of Disney's excessive size.

Cognitive dissonance is when someone's beliefs contradict one another, not when I have a different opinion than you. You can think my opinion on free markets is wrong or even stupid, but I haven't said anything contradictory.- : Sione PaleleiPosted by Cincinnati Bowtie on 4/30/13 at 7:47 am to redfieldk717
Bumped for LSUAfro
re: Sione PaleleiPosted by GABlueDog
on 4/30/13 at 8:43 am to Cincinnati Bowtie
I still think LSU could get him if they decide they want him.
re: Sione PaleleiPosted by Cincinnati Bowtie on 7/15/13 at 11:19 pm to GABlueDog
Boo will be working out Wednesday morning, running routes, etc for Cam and Frank, then discuss an offer.
re: Sione PaleleiPosted by jembeurt
on 7/15/13 at 11:49 pm to Cincinnati Bowtie
Good to hear. Hopefully a ball doesn't hit his shoulder.
Hope he gets it!
Hope he gets it!
Let us count! L.F. #1, CM r. 2, Tony B. 3, G. Willis 4, M. Dupree 4, Noil 5, T. Quinn 6, Blacknall 7, C. Garrett 8, Davon G. 9, McDowell 10, Williams 11, B. Harris 12, Hootie 13, See where this is going. With the commits that we already have. Where is the room?
This post was edited on 7/16 at 12:19 am
re: Sione PaleleiPosted by Cincinnati Bowtie on 7/16/13 at 12:10 am to jembeurt
He's going to be wrapped, so I hope his flexibility isn't hampered. Signing him could open up doors to more Polys, having a local family here for support. Hoko Fanaika is already close to the Paleleis so much that Boo's Mom and little brothers stayed here for the Spring