-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathos_rwigner.py
38 lines (27 loc) · 994 Bytes
/
os_rwigner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import numpy as np
# the rwigner function takes a 1D numpy array and makes a wigner transform.
#
import osh5io
import osh5def
import osh5vis
import osh5utils
# ******************************************************************
from h5_utilities import *
import matplotlib.pyplot as plt
import sys
# Han Wen's pyVisOS
sys.path.append('/Volumes/Lacie-5TB/codes/pyVisOS/')
def os_rwigner(real_array,xaxis):
nx=real_array.shape
nxh=(nx+1)/2
dx=(xaxis.max-xaxis.min)/nx
kmax=(np.pi)/dx
dk=(2.0*np.pi)/xaxis.max
w_data= rwigner(real_array)
kaxis=osh5def.DataAxis(0,kmax,nx_h,
attrs={'NAME':'k','LONG_NAME':'wave number', 'UNITS': '\omega_0/c'}
data_attrs = data_attrs = { 'UNITS': osh5def.OSUnits('[a.u.]'),
'NAME': 'W_{\phi}', 'LONG_NAME': 'Wigner Transform' }
run_attrs = {'XMAX' : np.array( [kmax, xaxis.max] ) ,
'XMIN' : np.array( [0, xaxis.min ] ) }
os5data_wigner=osh5def.H5Data(w_data,timestamp='x', data_attrs=data_attrs, axes=[kaxis,xaxis])