Example #1
0
    r_coils = np.concatenate(
        (r_coils[:, :, :, :, :], r_coils[:, 0:1, :, :, :]), axis=1)
    for ic in range(r_coils.shape[0]):
        for n in range(r_coils.shape[2]):
            for b in range(r_coils.shape[3]):
                p = mlab.plot3d(r_coils[ic, :, n, b, 0],
                                r_coils[ic, :, n, b, 1],
                                r_coils[ic, :, n, b, 2],
                                tube_radius=0.01,
                                color=color)  #, line_width = 0.01,)
    return p


coil_data_9, params_9 = get_all_coil_data(
    "../../../tests/w7x/scanold2/w7x_l3.hdf5")  # 0.06
I_9, dl_9, r_9, _ = CoilSet.get_outputs(coil_data_9, params_9)
centroid_9 = CoilSet.get_r_centroid(coil_data_9, params_9)

r_surf, nn, sg, _ = read_w7x_data()
mlab.options.offscreen = True
mlab.figure(size=(2400, 2400), bgcolor=(1, 1, 1))
p = plot_surface(r_surf[146:])
p = plot_surface(r_surf[0:19])
p = plot_coils(r_9[0:5], color=(0.0, 0.0, 0.8))
mlab.view(azimuth=200,
          elevation=110,
          distance=9,
          focalpoint=(5.3, 1.5, 0.1),
          roll=None,
          reset_roll=True)
mlab.savefig('w7x_section.eps', figure=mlab.gcf())
Example #2
0
            for b in range(r_coils.shape[3]):
                p = mlab.plot3d(r_coils[ic, :, n, b, 0],
                                r_coils[ic, :, n, b, 1],
                                r_coils[ic, :, n, b, 2],
                                tube_radius=0.02,
                                color=color)  #, line_width = 0.01,)
    return p


mlab.clf()
NS = 96
r_surf, nn, sg, fc_init = read_lhd_data()
coil_data, params = get_all_coil_data("../../tests/lhd/scan/lhd_l4.hdf5")
#coil_data_fb, params_fb = get_all_coil_data("fb_lhd_test.hdf5")
r_init = compute_r_centroid(NS, fc_init)
_, _, r_c, _ = CoilSet.get_outputs(coil_data, params)
#_, _, r_fb, _ = CoilSet.get_outputs(coil_data_fb, params_fb)
mlab.options.offscreen = True
mlab.figure(size=(2400, 2400), bgcolor=(1, 1, 1))

p = plot_surface(r_surf)
#p = plot_coils_centroid(r_init,color=(0.0,0.0,0.8))
p = plot_coils(r_c, color=(0.0, 0.0, 0.8))
#p = plot_coils(r_fb,color=(0.0,0.0,0.8))
mlab.view(azimuth=0.0,
          elevation=180,
          distance=20.0,
          focalpoint=(0.0, 0.0, 0.0),
          roll=None,
          reset_roll=True,
          figure=None)
    for ic in range(r_coils.shape[0]):
        for n in range(r_coils.shape[2]):
            for b in range(r_coils.shape[3]):
                p = mlab.plot3d(r_coils[ic, :, n, b, 0],
                                r_coils[ic, :, n, b, 1],
                                r_coils[ic, :, n, b, 2],
                                tube_radius=0.003,
                                color=color)  #, line_width = 0.01,)
    return p


surface = Surface("../../focusadd/initFiles/axes/ellipticalAxis4Rotate.txt",
                  128, 32, 1.0)
r_surf = surface.get_r_central()

coil_data_fb, params_fb = CoilSet.get_initial_data(
    surface, input_file="../../tests/postresaxis/triple_comparison/fb.hdf5")
_, _, r_fb, _ = CoilSet.get_outputs(coil_data_fb, params_fb)
centroid_fb = CoilSet.get_r_centroid(coil_data_fb, params_fb)

mlab.options.offscreen = True
mlab.figure(size=(2400, 1600), bgcolor=(1, 1, 1))
p = plot_surface(r_surf)
#r_c = compute_r_centroid(NS, fc_init)
#p = plot_coils(r_fil, color=(0.8,0.0,0.0))
p = plot_coils(r_fb, color=(0.0, 0.0, 0.8))
mlab.view(azimuth=0,
          elevation=0,
          distance=4.0,
          focalpoint=(0.0, 0.0, 0.0),
          reset_roll=True)
mlab.savefig('elliptical_stellarator.eps', figure=mlab.gcf())
Example #4
0
		p = mlab.plot3d(r_coils[ic,:,0], r_coils[ic,:,1], r_coils[ic,:,2], tube_radius=0.02, color = color)#, line_width = 0.01,)
	return p


def plot_coils(r_coils, color=(0.0, 0.0, 0.8)):
	r_coils = np.concatenate((r_coils[:, :, :, :, :], r_coils[:, 0:1, :, :, :]),axis=1)
	for ic in range(r_coils.shape[0]):
		for n in range(r_coils.shape[2]):
			for b in range(r_coils.shape[3]):
				p = mlab.plot3d(r_coils[ic,:,n,b,0], r_coils[ic,:,n,b,1], r_coils[ic,:,n,b,2], tube_radius=0.02, color = color)#, line_width = 0.01,)
	return p

I = np.ones(50)

coil_data_fil, params_fil = get_all_coil_data("../../tests/w7x/scan2/w7x_l0.hdf5") # fil
I_fil, dl_fil, r_fil, _ = CoilSet.get_outputs(coil_data_fil, params_fil)
centroid_fil = CoilSet.get_r_centroid(coil_data_fil, params_fil)

coil_data_1, params_1 = get_all_coil_data("../../tests/w7x/scan2/w7x_l1.hdf5") # 0.035
I_1, dl_1, r_1, _ = CoilSet.get_outputs(coil_data_1, params_1)
centroid_1 = CoilSet.get_r_centroid(coil_data_1, params_1)

coil_data_2, params_2 = get_all_coil_data("../../tests/w7x/scan2/w7x_l2.hdf5") # 0.07
I_2, dl_2, r_2, _ = CoilSet.get_outputs(coil_data_2, params_2)
centroid_2 = CoilSet.get_r_centroid(coil_data_2, params_2)

coil_data_3, params_3 = get_all_coil_data("../../tests/w7x/scan2/w7x_l3.hdf5") # 0.14
I_3, dl_3, r_3, _ = CoilSet.get_outputs(coil_data_3, params_3)
centroid_3 = CoilSet.get_r_centroid(coil_data_3, params_3)

coil_data_5, params_5 = get_all_coil_data("../../tests/w7x/scan2/w7x_l5.hdf5") # 0.105
Example #5
0
def plot_coils(r_coils, color=(0.0, 0.0, 0.8)):
    r_coils = np.concatenate(
        (r_coils[:, :, :, :, :], r_coils[:, 0:1, :, :, :]), axis=1)
    for ic in range(r_coils.shape[0]):
        for n in range(r_coils.shape[2]):
            for b in range(r_coils.shape[3]):
                p = mlab.plot3d(r_coils[ic, :, n, b, 0],
                                r_coils[ic, :, n, b, 1],
                                r_coils[ic, :, n, b, 2],
                                tube_radius=0.02,
                                color=color)  #, line_width = 0.01,)
    return p


coil_data_fil, params_fil = get_all_coil_data("../../tests/w7x/w7x_fil.hdf5")
_, _, r_fil, _ = CoilSet.get_outputs(coil_data_fil, params_fil)
centroid_fil = CoilSet.get_r_centroid(coil_data_fil, params_fil)
coil_data_fb, params_fb = get_all_coil_data("../../tests/w7x/w7x_fb.hdf5")
_, _, r_fb, _ = CoilSet.get_outputs(coil_data_fb, params_fb)
centroid_fb = CoilSet.get_r_centroid(coil_data_fb, params_fb)
coil_data_rot, params_rot = get_all_coil_data("../../tests/w7x/w7x_rot.hdf5")
_, _, r_rot, _ = CoilSet.get_outputs(coil_data_rot, params_rot)
centroid_rot = CoilSet.get_r_centroid(coil_data_rot, params_rot)

r_surf, nn, sg, _ = read_w7x_data()
mlab.options.offscreen = True
mlab.figure(size=(2400, 2400), bgcolor=(1, 1, 1))
p = plot_surface(r_surf)
#r_c = compute_r_centroid(NS, fc_init)
#p = plot_coils(r_fil, color=(0.8,0.0,0.0))
#p = plot_coils(r_fb, color=(0.0,0.0,0.8))
Example #6
0
    r_coils = np.concatenate(
        (r_coils[:, :, :, :, :], r_coils[:, 0:1, :, :, :]), axis=1)
    for ic in range(r_coils.shape[0]):
        for n in range(r_coils.shape[2]):
            for b in range(r_coils.shape[3]):
                p = mlab.plot3d(r_coils[ic, :, n, b, 0],
                                r_coils[ic, :, n, b, 1],
                                r_coils[ic, :, n, b, 2],
                                tube_radius=0.02,
                                color=color)  #, line_width = 0.01,)
    return p


coil_data_fil, params_fil = get_all_coil_data(
    "../../../tests/w7x/scan3/w7x_l0.hdf5")
I_fil, dl_fil, r_fil, _ = CoilSet.get_outputs(coil_data_fil, params_fil)
centroid_fil = CoilSet.get_r_centroid(coil_data_fil, params_fil)
coil_data_fb, params_fb = get_all_coil_data(
    "../../../tests/w7x/scan3/w7x_l3.hdf5")  # 0.06 * 3
I_fb, dl_fb, r_fb, _ = CoilSet.get_outputs(coil_data_fb, params_fb)
centroid_fb = CoilSet.get_r_centroid(coil_data_fb, params_fb)
"""
coil_data_rot, params_rot = get_all_coil_data("../../tests/w7x/w7x_rot.hdf5")
_, _, r_rot, _ = CoilSet.get_outputs(coil_data_rot, params_rot)
centroid_rot = CoilSet.get_r_centroid(coil_data_rot, params_rot)
"""

r_surf, nn, sg, _ = read_w7x_data()
mlab.options.offscreen = True
mlab.figure(size=(1600, 1200), bgcolor=(1, 1, 1))
#p = plot_surface(r_surf)