Merge branch 'master' of https://github.com/paulscherrerinstitute/pyzebra
This commit is contained in:
commit
833d0d8db4
@ -1,5 +1,5 @@
|
||||
import h5py
|
||||
|
||||
import numpy as np
|
||||
|
||||
def read_h5meta(filepath):
|
||||
"""Read and parse content of a h5meta file.
|
||||
@ -63,3 +63,24 @@ def open_h5meta(filepath):
|
||||
data[file] = read_detector_data(file)
|
||||
|
||||
return data
|
||||
|
||||
def z4frgn(wave,ga,nu):
|
||||
"""CALCULATES DIFFRACTION VECTOR IN LAB SYSTEM FROM GA AND NU
|
||||
|
||||
Args:
|
||||
WAVE,GA,NU
|
||||
|
||||
Returns:
|
||||
Z4
|
||||
"""
|
||||
sin = np.sin
|
||||
cos = np.cos
|
||||
pir = 180/np.pi
|
||||
gar = ga/pir
|
||||
nur = nu/pir
|
||||
z4 = [0., 0., 0.]
|
||||
z4[0]=( sin(gar)*cos(nur) )/wave
|
||||
z4[1]=( cos(gar)*cos(nur)-1. )/wave
|
||||
z4[2]=( sin(nur) )/wave
|
||||
|
||||
return z4
|
||||
|
Loading…
x
Reference in New Issue
Block a user