-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide example of CHX'sCSV of XPCS output format #70
Comments
Andi, I think we talked about this a few weeks ago. Is this still on your radar? |
CHX uses csv files to save simple results for readback in notebooks. An example function is Also, I think @qzhang234 and Yugang worked together on something that works for CHX and 8ID-I in terms of an HDF5 files, but I am not sure it is something we can call common to all beamlines as I haven't seen it. However, I am eager to finalize a common results file in this respect... but is that a different task? |
I should get access in the coming days to CHX's repo. I will follow up at that time. |
@ronpandolfi and @ihumphrey, see the comment from @ambarb above. How important is getting this output format at this point? |
Andi, I added your account to the team, so you should be able to have access to https://github.com/NSLS-II/pyCHX. |
The CSV file format is very simple. However, it is more geared towards SAXS and not diffraction so it the CHX version is not broadly implementable. However, it can handle multiple one time results. See the code below. I also noticed that CHX has complicated HDF5 results file option, that is far more powerful than the .csv file. However, it is not the same at 8ID-I's. At the moment, I am a little scared of setting someone down the path of developing something we will not use. I think the larger questions for results viewings are:
def save_g2_general( g2, taus, qr=None, qz=None, uid='uid', path=None, return_res= False ):
'''Y.G. Dec 29, 2016
save g2 results,
res_pargs should contain
g2: one-time correlation function
taus, lags of g2
qr: the qr center, same length as g2
qz: the qz or angle center, same length as g2
path:
uid:
'''
df = DataFrame( np.hstack( [ (taus).reshape( len(g2),1) , g2] ) )
t,qs = g2.shape
if qr is None:
qr = range( qs )
if qz is None:
df.columns = ( ['tau'] + [str(qr_) for qr_ in qr ] )
else:
df.columns = ( ['tau'] + [ str(qr_) +'_'+ str(qz_) for (qr_,qz_) in zip(qr,qz) ] )
#dt =datetime.now()
#CurTime = '%s%02d%02d-%02d%02d-' % (dt.year, dt.month, dt.day,dt.hour,dt.minute)
#if filename is None:
filename = uid
#filename = 'uid=%s--g2.csv' % (uid)
#filename += '-uid=%s-%s.csv' % (uid,CurTime)
#filename += '-uid=%s.csv' % (uid)
filename1 = os.path.join(path, filename)
df.to_csv(filename1)
print( 'The correlation function is saved in %s with filename as %s'%( path, filename))
if return_res:
return df
`` |
No description provided.
The text was updated successfully, but these errors were encountered: