You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

For many experiment, the analysis of the smalldata h5 files is not too computing intensive and the analysis team can benefit from the quick and iterative nature of the Jupyter notebooks framework over the more involved cube production.

In this section, a few template notebook for common experiments are discussed.

Common features

All templates will start with a section where the experiment and run can be defined:

run = 21
exp = 'xppx47019'
ffb = True

# if 'drp' in socket.gethostname():
#     p = Path('/cds/data/drpsrcf/{}/{}/scratch/hdf5/smalldata'.format(exp[:3], exp))
# else:
#     p = Path('/cds/data/psdm/{}/{}/hdf5/smalldata/'.format(exp[:3], exp))
# #     p = Path('/cds/data/psdm/{}/{}/scratch/ffb/hdf5/smalldata/'.format(exp[:3], exp))
# print(p.exists())

# it = p.glob('{}_Run{:04d}*'.format(exp,run))
# try: f = next(it)
# except: print('No files found at this path.')

# print(f)
# print('\n')

f = Path('./example_ccm_2d_scan.h5') # only for example. Comment or delete later

rr = tables.File(f).root
h5 = h5py.File(f)
print('\n'.join(h5.keys()))

The commented block should be uncommented whenever actual data are being analyzed.

Sets of alias to better find the relevant quantities in the h5 files are also defined in the following cell:

# helper dict to find data in file
dataDict = {'alias': 'path/in/the/h5',
			...
           }

filters =  {}
filters['alias_filt1'] = [0.03,0.35]
filters['alias_filt2'] = [40,230]
	...

print('Filter selection:')
for key,value in filters.items():
	print('\t{} : {}'.format(key, value))
hist_bins = {key: 35 for key in filters.keys()}
  • No labels