Exemple #1
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load plotting functions
#import matplotlib.pyplot as plt
#plt.interactive(True)

# Load the data using the wamit module.
wamit_data = read(out_file='wamit_data/rm3.out',scale=False)


# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data.body[0].num_bodies): #wamit_data.body[0].num_bodies
 	wamit_data.body[i].calc_irf_radiation(t_end=20., n_t=1001, n_w=501)
	#wamit_data.body[i].calc_ss_radiation()
	wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=1001, n_w=501, w_max=1.25)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #2
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.
wamit_data = read(out_file='./sphere.out')

# Calculate IRF and plot using the wamit module
for i in range(wamit_data.body[0].num_bodies):  #wamit_data.body[0].num_bodies
    wamit_data.body[i].calc_irf_radiation(t_end=100, n_t=201, n_w=201)
    #wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
    wamit_data.body[i].calc_irf_excitation(t_end=50, n_t=101, n_w=101)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #3
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.
wamit_data = read(out_file='./ecm_ellipsoid.out')

# Calculate IRF and plot using the wamit module
for i in range(wamit_data.body[0].num_bodies):  #wamit_data.body[0].num_bodies
    wamit_data.body[i].calc_irf_radiation(t_end=100, n_t=201, n_w=201)
    #wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
    wamit_data.body[i].calc_irf_excitation(t_end=50, n_t=101, n_w=101)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #4
0
# Import bemio modules
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data
wamit_data = read(out_file='rm3.out')
num_bodies = wamit_data.body[0].num_bodies

# Calculate IRF
for i in xrange(num_bodies):
	wamit_data.body[i].calc_irf_radiation(t_end=100., n_t=501, n_w=501, w_max=1.5)
	wamit_data.body[i].calc_ss_radiation()
	wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=501, n_w=501)

# Save the data in HDF5 format
write_hdf5(wamit_data)
Exemple #5
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5
from bemio.utilities.hdf_utilities import combine_h5
from bemio.utilities.hdf_utilities import create_hydro_data

# Load the data using the wamit module.
wamit_1 = read(out_file='wamit_data/coer_comp_f.out')
write_hdf5(wamit_1,out_file='wamit_1.h5')

# Load the data using the wamit module.
wamit_2 = read(out_file='wamit_data/coer_comp_f.out')
write_hdf5(wamit_2,out_file='wamit_2.h5')

hdf5_data = combine_h5(['wamit_1.h5','wamit_2.h5'])
hydro_data = create_hydro_data(hdf5_data)
Exemple #6
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5
from bemio.utilities.hdf_utilities import combine_h5
from bemio.utilities.hdf_utilities import create_hydro_data

# Load the data using the wamit module.
wamit_1 = read(out_file='wamit_data/coer_comp_f.out')
write_hdf5(wamit_1, out_file='wamit_1.h5')

# Load the data using the wamit module.
wamit_2 = read(out_file='wamit_data/coer_comp_f.out')
write_hdf5(wamit_2, out_file='wamit_2.h5')

hdf5_data = combine_h5(['wamit_1.h5', 'wamit_2.h5'])
hydro_data = create_hydro_data(hdf5_data)
Exemple #7
0
# Import bemio modules
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data
wamit_data = read(out_file='rm3.out')
num_bodies = wamit_data.body[0].num_bodies

# Calculate IRF
for i in xrange(num_bodies):
    wamit_data.body[i].calc_irf_radiation(t_end=60.)
    wamit_data.body[i].calc_ss_radiation()
    wamit_data.body[i].calc_irf_excitation(t_end=157.)

# Save the data in HDF5 format
write_hdf5(wamit_data)
Exemple #8
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5


# Load the data using the wamit module.
wamit_data = read(out_file='./sphere.out')


# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data.body[0].num_bodies): #wamit_data.body[0].num_bodies
 	wamit_data.body[i].calc_irf_radiation(t_end=100,n_t=201,n_w=201)
	#wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
	wamit_data.body[i].calc_irf_excitation(t_end=50,n_t=101,n_w=101)


# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #9
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load plotting functions
#import matplotlib.pyplot as plt
#plt.interactive(True)

# Load the data using the wamit module.
wamit_data = read(out_file='wamit_data/rm3.out', scale=False)

# Calculate IRF and plot using the wamit module
for i in range(wamit_data.body[0].num_bodies):  #wamit_data.body[0].num_bodies
    wamit_data.body[i].calc_irf_radiation(t_end=20., n_t=1001, n_w=501)
    #wamit_data.body[i].calc_ss_radiation()
    wamit_data.body[i].calc_irf_excitation(t_end=100.,
                                           n_t=1001,
                                           n_w=501,
                                           w_max=1.25)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #10
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.
wamit_data = read(out_file='./wec3.out')

# Calculate IRF and plot using the wamit module
for i in range(wamit_data.body[0].num_bodies):  #wamit_data.body[0].num_bodies
    wamit_data.body[i].calc_irf_radiation(t_end=100., n_t=1001, n_w=501)
    #wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
    wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=1001, n_w=501)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #11
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.
wamit_data_f = read(out_file='wamit_data/coer_comp_f.out')

# Calculate IRF and SS coefficients
for i in range(wamit_data_f.body[0].num_bodies):
    wamit_data_f.body[i].calc_irf_radiation(t_end=20.0, n_t=1001, n_w=501)
    wamit_data_f.body[i].calc_irf_excitation(t_end=20.0, n_t=1001, n_w=501)

# Save the data in the hdf5 format.
write_hdf5(wamit_data_f, out_file='coer_comp_f.h5')

# Load the data using the wamit module, scaling the data by rho=1000, g=9.81 and
# frequench (w)
wamit_data_f_scaled = read(out_file='wamit_data/coer_comp_f.out', scale=True)

# Calculate IRF and plot using the wamit module
for i in range(wamit_data_f_scaled.body[0].num_bodies):
    wamit_data_f_scaled.body[i].calc_irf_radiation(t_end=20.0,
                                                   n_t=1001,
                                                   n_w=1001)
    wamit_data_f_scaled.body[i].calc_irf_excitation(t_end=20.0,
                                                    n_t=1001,
                                                    n_w=1001)

# Save the data in the hdf5 format.
write_hdf5(wamit_data_f_scaled, out_file='coer_comp_f_scaled.h5')
Exemple #12
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.
wamit_data_f = read(out_file='wamit_data/coer_comp_f.out')

# Calculate IRF and SS coefficients
for i in xrange(wamit_data_f.body[0].num_bodies):
 	wamit_data_f.body[i].calc_irf_radiation(t_end=20.0, n_t=1001, n_w=501)
	wamit_data_f.body[i].calc_irf_excitation(t_end=20.0, n_t=1001, n_w=501)

# Save the data in the hdf5 format.
write_hdf5(wamit_data_f,out_file='coer_comp_f.h5')


# Load the data using the wamit module, scaling the data by rho=1000, g=9.81 and
# frequench (w)
wamit_data_f_scaled = read(out_file='wamit_data/coer_comp_f.out', scale=True)

# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data_f_scaled.body[0].num_bodies):
 	wamit_data_f_scaled.body[i].calc_irf_radiation(t_end=20.0, n_t=1001, n_w=1001)
	wamit_data_f_scaled.body[i].calc_irf_excitation(t_end=20.0, n_t=1001, n_w=1001)

# Save the data in the hdf5 format.
write_hdf5(wamit_data_f_scaled,out_file='coer_comp_f_scaled.h5')
Exemple #13
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5


# Load the data using the wamit module.
wamit_data = read(out_file="./ecm_ellipsoid.out")


# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data.body[0].num_bodies):  # wamit_data.body[0].num_bodies
    wamit_data.body[i].calc_irf_radiation(t_end=100, n_t=201, n_w=201)
    # wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
    wamit_data.body[i].calc_irf_excitation(t_end=50, n_t=101, n_w=101)


# Save the data in the hdf5 format.
write_hdf5(wamit_data)
# Import bemio modules
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data
wamit_data = read(out_file='ellipsoid.out')
num_bodies = wamit_data.body[0].num_bodies

# Calculate IRF
for i in xrange(num_bodies):
    wamit_data.body[i].calc_irf_radiation(t_end=100., n_t=1001, n_w=1001)
    wamit_data.body[i].calc_ss_radiation()
    wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=1001, n_w=1001)

# Save the data in HDF5 format
write_hdf5(wamit_data)
Exemple #15
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data using the wamit module.

wamit_data_f = read(out_file='coer_comp_f.out')

# Calculate IRF and SS coefficients
for i in xrange(wamit_data_f.body[0].num_bodies): #wamit_data_f.body[0].num_bodies
 	wamit_data_f.body[i].calc_irf_radiation(t_end=20.0, n_t=2001, n_w=4001)
	# wamit_data_f.body[i].calc_ss_radiation(max_order=7, r2_thresh=0.95)
	wamit_data_f.body[i].calc_irf_excitation(t_end=20.0, n_t=2001, n_w=4001)

# Save the data in the hdf5 format.
write_hdf5(wamit_data_f,out_file='coer_comp_f.h5')
Exemple #16
0
#! /usr/bin/python

# bemio WAMIT tutorial

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5


# Load the data using the wamit module.
wamit_data = read(out_file='./wec3.out')


# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data.body[0].num_bodies): #wamit_data.body[0].num_bodies
 	wamit_data.body[i].calc_irf_radiation(t_end=100., n_t=1001, n_w=501)
	#wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
	wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=1001, n_w=501)

# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #17
0
# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5


# Load the data using the wamit module.
wamit_data = read(out_file='wamit_data/oswec.out')


# Calculate IRF and plot using the wamit module
for i in xrange(wamit_data.body[0].num_bodies): #wamit_data.body[0].num_bodies
 	wamit_data.body[i].calc_irf_radiation(t_end=20, n_t=501, n_w=501, w_max=10.)
	#wamit_data.body[i].calc_ss_radiation(max_order=5, r2_thresh=0.90)
	wamit_data.body[i].calc_irf_excitation(t_end=30. , n_t=501, n_w=501)


# Save the data in the hdf5 format.
write_hdf5(wamit_data)
Exemple #18
0
# [Topcoder]

import sys 
import os
import os.path

sys.path.append(os.path.dirname(os.path.dirname(__file__)))

# Load the needed modules from bemio
from bemio.io.wamit import read
from bemio.io.output import write_hdf5
from bemio.utilities.hdf_utilities import combine_h5
from bemio.utilities.hdf_utilities import create_hydro_data

# .out files
inFile = sys.argv[1]
inDir = os.path.dirname(inFile)
head, tail = os.path.split(inFile)
head = os.path.dirname(head)
# H5 files 
#outFile = os.path.splitext(inFile)[0]

# Load the data using the wamit module.

wamit_1 = read(out_file=inFile+'.out')

write_hdf5(wamit_1,out_file = head + '/openwarp/' + tail + '.h5' )


Exemple #19
0
# Import bemio modules
from bemio.io.wamit import read
from bemio.io.output import write_hdf5

# Load the data
wamit_data = read(out_file='ellipsoid.out')
num_bodies = wamit_data.body[0].num_bodies

# Calculate IRF
for i in xrange(num_bodies):
	wamit_data.body[i].calc_irf_radiation(t_end=100., n_t=1001, n_w=1001)
	wamit_data.body[i].calc_ss_radiation()
	wamit_data.body[i].calc_irf_excitation(t_end=100., n_t=1001, n_w=1001)

# Save the data in HDF5 format
write_hdf5(wamit_data)