示例#1
0
import get_events as ge
import pyqtgraph as pq
import numpy as np
import sys

e=ge.Events(run=131)
frameslist = np.array([54, 159, 1120, 1227, 1228, 3868])
e.get_frameslist(frameslist, False)

n_frames = len(e.frames)
for i in range(0,n_frames):
    pq.show(e.assemble_frame(e.frames[i]))

wait = input("PRESS ENTER TO CONTINUE..")
    
示例#2
0
    detect_layerline = True
    merge_data = False
    #rotate_frames = False
elif mode == 'tmv':
    min_mean = -1000000 * 25 + shooting_silicon * silicon_mean_offset
    max_mean = 4000000 + shooting_silicon * silicon_mean_offset  #225
    determine_orientation = False
    max_n_orientations = 500  #25 # 5 # 500
    min_orientation_snr = 0  #3 # 4 # 0
    detect_asymmetry = False
    detect_layerline = False
    merge_data = False
    #rotate_frames = True

#get geom shape and beam characteristics
e = ge.Events(run=run_numbers[0], det_cen=det_cen)
beam_energy = e.epics.value('BEND:DMP1:400:BDES')
wavelength = e.epics.value('SIOC:SYS0:ML00:AO192')
det_dist = e.epics.value('CXI:DS2:MMS:06.RBV')
e.events(1, 0, roi=False)
m = me.merge_events(wavelength, det_dist,
                    e.assemble_frame_w_geom(e.frames[0], False).shape, det_cen)

for r in range(0, len(run_numbers)):
    print "Getting events for run " + str(run_numbers[r])
    e = ge.Events(run=run_numbers[r], det_cen=det_cen)
    e.events(n_frames, start_frame, roi=True)

    mean_vals = np.zeros([len(e.frames), 2])

    for i in range(0, len(e.frames)):
示例#3
0
import get_events as ge
import merge_events as me
import frame_orientate as fo
import pyqtgraph as pq
import numpy as np
import sys
import matplotlib.pyplot as p

substrate_tilt = 0
wavelength = 0
det_dist = 0
print "Getting events"
e = ge.Events(run=57)

#e.get_hitframes(False) # get frames identified as potential hits
#hitlist = np.array([54, 622, 3868, 3873 ]) #angles 22-27
#hitlist = np.array([54, 159, 1120, 1227, 1228, 3868]) #159
#hitlist = np.array([1120,1227,3785,3873,3874]) #angles 120-135
hitlist = np.array([59])  #angles 120-135
print "Getting frames from event.. "
e.get_frameslist(hitlist, False)
#e.events(4351, 0, roi=False) # get all frames in run (4351 frames for run 131)

r1 = [2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4]
r2 = [
    0.005, 0.01, 0.015, 0.02, 0.005, 0.01, 0.015, 0.02, 0.005, 0.01, 0.015,
    0.02
]

r1 = [3]
r2 = [0.02]
示例#4
0
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as P
import math as m
import h5py
from scipy.optimize import curve_fit
from scipy import asarray as ar, exp
import get_events as ge
import pyqtgraph as pg

# import data from psana
e = ge.Events()
e.events(1, start=12, roi=True)
fd = e.do_fft(e.frames[0])

amp = fd

# calculate polar sums of intensities within sector bins
x, y = np.indices(amp.shape)
center = np.array([(x.max() - x.min()) / 2.0, (x.max() - x.min()) / 2.0])
x = x - center[0]
y = y - center[1]

#print center
r = np.hypot(x, y)

pixelAngles = np.degrees(np.arctan2(y, x))

rayHW = 0  # pixels
angleIncr = 1  # degrees