Пример #1
0
file = ['pressure.h5', 'octaveFilterSP/spl_octFilt_spectrum.h5']

#%%
#   generates and imports the HDF5 file containing the reformatted pressure time series and BPM spectral data.
if h5_write:
    functions = []
    for f in file:
        f1 = lambda a: wopwop.extract_wopwop_quant(
            case_directory=a, prefix=os.path.splitext(f)[0])
        functions.append(f1)
    wopwop.apply_to_namelist(functions,
                             cases_directory=cases_directory,
                             cases='cases.nam')

output = wopwop.import_from_namelist(file,
                                     cases_directory=cases_directory,
                                     cases='cases.nam')

#%%
#   imports several performance quantities from the MainDict.h5 file.
with h5py.File(os.path.join(cases_directory, 'MainDict.h5'), "r") as f:
    R = f[list(f.keys())[0]]['geomParams']['R'][()]
    T = f[list(f.keys())[1]]['T'][()]
    omega = f[list(f.keys())[1]]['omega'][()]

#%%
# Tip-Mach number
M = np.array(omega) / 60 * 2 * np.pi**R / 340

#   number of observers
nObservers = np.shape(
Пример #2
0
mics = [12,-11]

#   Frequency resolution of spectra [Hz]
df_exp = 2
#   Axis limits specified as: [xmin,xmax,ymin,ymax]
axis_lim = [50, 1e3, 0, 60]

#   Starting time from which to compute the spectra
start_t = 10
#   End time to which to compute the spectra
end_t = 15

#%%

#   imports reformatted data from wopwop in a dictionary
pred = wopwop.import_from_namelist(file, cases_directory=pred_dir, cases='cases.nam')

#%%
#   imports several performance quantities from the MainDict.h5 file.
with h5py.File(os.path.join(pred_dir, 'MainDict.h5'), "r") as f:
    R = f[list(f.keys())[0]]['geomParams']['R'][()]
    th = f[list(f.keys())[0]]['loadParams']['th'][()]
    T = f[list(f.keys())[1]]['T'][()]
    omega = f[list(f.keys())[1]]['omega'][()]

#%%

micR = np.array([65.19,62.97,61.34,60.34,60.00,60.34,61.34,62.97,65.19,67.93,71.14,74.75])
# exp = exp * micR / micR[4]
# Tip-Mach number
M = np.array(omega)/60*2*np.pi**R/340
#%%
form1a_LN = {}
form1a_TN = {}
#   imports several performance quantities from the MainDict.h5 file.
with h5py.File(os.path.join(dir,os.path.basename(os.path.dirname(dir))+'_form1a_LN_sdata.h5'),'r') as f:
    for k, dat in f.items():
        form1a_LN = {**form1a_LN, **{k:dat[()]}}
with h5py.File(os.path.join(dir,os.path.basename(os.path.dirname(dir))+'_form1a_TN_sdata.h5'),'r') as f:
    for k, dat in f.items():
        form1a_TN = {**form1a_TN, **{k:dat[()]}}

#%%

#   imports reformatted data from wopwop in a dictionary
wopwop_dat = wopwop.import_from_namelist(file, cases_directory=dir, cases='cases.nam')

#%%
#   imports several performance quantities from the MainDict.h5 file.
with h5py.File(os.path.join(dir, 'MainDict.h5'), "r") as f:
    R = f[list(f.keys())[0]]['geomParams']['R'][()]
    th = f[list(f.keys())[0]]['loadParams']['th'][()]
    T = f[list(f.keys())[1]]['T'][()]
    omega = f[list(f.keys())[1]]['omega'][()]

#%%

# Tip-Mach number
M = np.array(omega)/60*2*np.pi**R/340

#   number of observers