Exemple #1
0
    rows, cols = IM.shape  # new image size

c2 = cols // 2  # half-image
print('image size {:d}x{:d}'.format(rows, cols))

# Step 2: perform the Hansen & Law transform!
print('Performing Hansen and Law inverse Abel transform:')

AIM = iabel_hansenlaw(IM,
                      dr=1,
                      use_quadrants=(True, True, True, True),
                      vertical_symmetry=False,
                      horizontal_symmetry=False,
                      verbose=True)

speeds, r = calculate_speeds(AIM)

# Set up some axes
fig = plt.figure(figsize=(15, 4))
ax1 = plt.subplot(131)
ax2 = plt.subplot(132)
ax3 = plt.subplot(133)

# Plot the raw data
im1 = ax1.imshow(IM, origin='lower', aspect='auto')
fig.colorbar(im1, ax=ax1, fraction=.1, shrink=0.9, pad=0.03)
ax1.set_xlabel('x (pixels)')
ax1.set_ylabel('y (pixels)')
ax1.set_title('velocity map image')

# Plot the 2D transform
Exemple #2
0
for q, method in enumerate(transforms.keys()):

    Q0 = Q0fresh.copy()   # top-right quadrant of O2- image

    print ("\n------- {:s} inverse ...".format(method))  
    t0 = time()

    IAQ0 = transforms[method](Q0)   # inverse Abel transform using 'method'

    print ("                    {:.1f} sec".format(time()-t0))

    iabelQ.append(IAQ0)  # store for plot

    # polar projection and speed profile
    speed, radial = calculate_speeds(IAQ0, origin=(0,0))

    # normalize image intensity and speed distribution
    IAQ0  /= IAQ0[mask].max()  
    speed /= speed[radial>50].max()

    # plots    #121 whole image,   #122 speed distributions
    plt.subplot(121) 

    # method label for each quadrant
    annot_angle = -(45+q*90)*np.pi/180  # -ve because numpy coords from top
    if q > 3: 
       annot_angle += 50*np.pi/180    # shared quadrant - move the label  
    annot_coord = ( h/2+(h*0.9)*np.cos(annot_angle)/2, 
                    w/2+(w*0.9)*np.sin(annot_angle)/2 )
    plt.annotate(method, annot_coord, color="yellow")
Exemple #3
0
   # covering the radial range [300:400] pixels from the center
   IM = find_image_center_by_slice (IM, radial_range=(300,400))[0]
   rows,cols = IM.shape   # new image size

c2 = cols//2   # half-image
print ('image size {:d}x{:d}'.format(rows,cols))

# Step 2: perform the Hansen & Law transform!
print('Performing Hansen and Law inverse Abel transform:')

AIM = iabel_hansenlaw(IM, dr=1, use_quadrants=(True,True,True,True),
                                vertical_symmetry=False,
                                horizontal_symmetry=False,
                                verbose=True)

speeds, r = calculate_speeds (AIM)

# Set up some axes
fig = plt.figure(figsize=(15,4))
ax1 = plt.subplot(131)
ax2 = plt.subplot(132)
ax3 = plt.subplot(133)

# Plot the raw data
im1 = ax1.imshow(IM,origin='lower',aspect='auto')
fig.colorbar(im1,ax=ax1,fraction=.1,shrink=0.9,pad=0.03)
ax1.set_xlabel('x (pixels)')
ax1.set_ylabel('y (pixels)')
ax1.set_title('velocity map image')

# Plot the 2D transform
Exemple #4
0
for q, method in enumerate(transforms.keys()):

    Q0 = Q0fresh.copy()  # top-right quadrant of O2- image

    print("\n------- {:s} inverse ...".format(method))
    t0 = time()

    IAQ0 = transforms[method](Q0)  # inverse Abel transform using 'method'

    print("                    {:.1f} sec".format(time() - t0))

    iabelQ.append(IAQ0)  # store for plot

    # polar projection and speed profile
    speed, radial = calculate_speeds(IAQ0, origin=(0, 0))

    # normalize image intensity and speed distribution
    IAQ0 /= IAQ0[mask].max()
    speed /= speed[radial > 50].max()

    # plots    #121 whole image,   #122 speed distributions
    plt.subplot(121)

    # method label for each quadrant
    annot_angle = -(45 +
                    q * 90) * np.pi / 180  # -ve because numpy coords from top
    if q > 3:
        annot_angle += 50 * np.pi / 180  # shared quadrant - move the label
    annot_coord = (h / 2 + (h * 0.9) * np.cos(annot_angle) / 2,
                   w / 2 + (w * 0.9) * np.sin(annot_angle) / 2)