data-exchange / dxchange

data exchange supporting tomopy
http://dxchange.readthedocs.io
Other
34 stars 42 forks source link

APS 13-BM example #70

Closed bramgibs closed 5 years ago

bramgibs commented 5 years ago

Created example for APS 13-BM reconstruction that saves exported data as float32 .volume file.

decarlof commented 5 years ago

what about moving:

## Import data.
proj = dx.exchange.read_aps_13bm(files[1], format = 'netcdf4')

## Import flat field files.
flat1 = dx.exchange.read_aps_13bm(files[0], format = 'netcdf4')
flat2 = dx.exchange.read_aps_13bm(files[2], format = 'netcdf4')
flat = np.concatenate((flat1, flat2), axis = 0)    

## Import setup file that has dark.
setup = glob.glob('*.setup')
setup = open(setup[0], 'r')
setup_data = setup.readlines()
result = {}
for line in setup_data:
    words = line[:-1].split(':',1)
    result[words[0].lower()] = words[1]
## Create array for dark.
dark = float(result['dark_current'])
dark = flat*0+dark

## Set data collection angles from proj.
theta = tp.angles(proj.shape[0])

in the read_aps_13bm and have read_aps_13bm return tomo, flat, dark, theta?

this way read_aps_13bm will work as read_aps_32id and its use will be the same for users running at both beamline

bramgibs commented 5 years ago

Great idea. I have updated my code accordingly.

decarlof commented 5 years ago

great! Thanks

decarlof commented 5 years ago

@bramgibs I removed the tomopy dependency with 72; all the rest stays the same, thanks again f