In [28]:
from chxanalys.chx_packages import *
%matplotlib notebook
plt.rcParams.update({'figure.max_open_warning': 0})
plt.rcParams.update({ 'image.origin': 'lower' })
plt.rcParams.update({ 'image.interpolation': 'none' })
import pickle as cpk
from chxanalys.chx_xpcs_xsvs_jupyter_V1 import *
from eiger_io.pims_reader import EigerImages
In [2]:
CYCLE= '2017_2' #change clycle here
username = getpass.getuser()
data_dir0 = create_user_folder(CYCLE, username)
print( data_dir0 )
In [13]:
data_dir = os.path.join(data_dir0, 'Yang_Pressure/')
os.makedirs(data_dir, exist_ok=True)
print('Results from this analysis will be stashed in the directory %s' % data_dir)
In [14]:
uid = '748501' #(scan num: 3203) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa )
In [15]:
md = get_meta_data( uid )
imgs = load_data( uid, md['detector'], reverse= True )
md.update( imgs.md );Nimg = len(imgs);
#if 'number of images' not in list(md.keys()):
md['number of images'] = Nimg
pixel_mask = 1- np.int_( np.array( imgs.md['pixel_mask'], dtype= bool) )
print( 'The data are: %s' %imgs )
md['acquire period' ] = md['cam_acquire_period']
md['exposure time'] = md['cam_acquire_time']
In [16]:
center = [ md['beam_center_x'], 2167 - md['beam_center_y']] # center of the speckle pattern, read from [image_x, image_y], ((not python y,x))
#Or change to something else:
#center = [ x, y ]
center=[center[0], center[1]]
inc_x0 = center[1]
inc_y0= center[0]
uidstr = 'uid=xxx'
dpix, lambda_, Ldet, exposuretime, timeperframe, center = check_lost_metadata(
md, Nimg, inc_x0 = inc_x0, inc_y0= inc_y0, pixelsize = 7.5*10*(-5) )
timeperframe = md['acquire period' ]
setup_pargs=dict(uid=uidstr, dpix= dpix, Ldet=Ldet, lambda_= lambda_, exposuretime=exposuretime,
timeperframe=timeperframe, center=center, path= data_dir)
print_dict( setup_pargs )
In [ ]:
In [17]:
mask_path = '/XF11ID/analysis/2017_2/masks/'
# mask_name = 'July18_mask.npy' #smaller than 160 C use this one
mask_name = 'Jul5_SAXS.npy' #>= 160 C use this one
In [18]:
mask = load_mask(mask_path, mask_name, plot_ = False, image_name = uidstr + '_mask', reverse= True )
mask *= pixel_mask
show_img(mask,image_name = uidstr + '_mask', save=True, path=data_dir, aspect=1)
In [ ]:
In [ ]:
In [ ]:
p=1.47 GPa
uid=1afc83
uid=1393d2 (center)
uid= 48e966
p= 2.53 GPa P'=3.0 GPa
1 ['171cf5'] (scan num: 3160) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (center)
1 ['171cf5'] (scan num: 3160) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (30 micron away)
P= 3.3 GPa
1 ['178f11'] (scan num: 3169) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (center)
1 ['e4ada9'] (scan num: 3170) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (30 micron away)
P=3.94 GPa 4.5 GPa
1 ['9b08ff'] (scan num: 3180) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (center)
1 ['9bea6f'] (scan num: 3181) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (30 micron-away)
P=5.08 GPa (5.38 GPa)
1 ['293961'] (scan num: 3194) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (center)
1 ['af5b4a'] (scan num: 3195) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (30 microns away)
p=6.27 GPa
1 ['398940'] (scan num: 3202) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (center)
1 ['748501'] (scan num: 3203) (Measurement: XPCS -1.8K frames, 1 Hz: Bi2212, Pressure 1GPa ) (50 microns away) (unprocessed)
In [104]:
uids = { 'p=1.47': [ '1afc83', '1393d2', '48e966'],
'p=2.53': [ '171cf5', ],
'p=3.30': ['178f11', 'e4ada9'],
'p=3.94': ['9b08ff', '9bea6fcb'],
'p=5.08': ['293961', 'af5b4a'],
'p=6.27': ['398940','748501']
}
In [105]:
#uids = { 'p=1.47': [ '1afc83', '1393d2', '48e966'] }
In [ ]:
In [107]:
uids
Out[107]:
In [87]:
%run ~/chxanalys_link/chxanalys/chx_generic_functions.py
In [98]:
%run ~/chxanalys_link/chxanalys/chx_xpcs_xsvs_jupyter_V1.py
In [99]:
#validate_uid_dict( uids )
In [100]:
setup_pargs['filename'] = 'qIq_Pressure_July16_2017.csv'
In [101]:
setup_pargs
Out[101]:
In [108]:
pd = get_iq_from_uids( uids, mask, setup_pargs )
In [ ]:
In [ ]:
In [109]:
pd
Out[109]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: