Skip to content
Snippets Groups Projects
Commit 5f983c06 authored by BLANCO-GARCIA's avatar BLANCO-GARCIA
Browse files

format compatible with lifetime

parent fed0fa22
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ def readmomapmat(
fname
):
"""
momap_pn, s_indexes, s_array = readmomapmat(fname)
momap_pn, s_indexes, s_array, index_first_element = readmomapmat(fname)
This functions reads a given .mat with momentum aperture data
......@@ -22,17 +22,18 @@ def readmomapmat(
momap: positive and negative sides of momentum aperture
s_indexes: indexes where momap was calculated
s_array: s coordinates of s_indexes
first_element_index : returns the first element index
index_first_element : returns the first element index
0 (in python), 1 (in matlab)
"""
f = scipy.io.loadmat(fname)
# set momap input format for get_lifetime
momap_pn = numpy.array((f['momap']['dppP'][:],
f['momap']['dppN'][:]))
momap_pn = numpy.array((f['momap']['dppP'][0,0][:,0],
f['momap']['dppN'][0,0][:,0]))
momap_pn = numpy.copy(momap_pn.T)
s_indexes=f['momap']['s_indexes'][:]
s_array=f['momap']['s_array'][:]
s_indexes=f['momap']['s_indexes'][0,0][:,0]
s_array=f['momap']['s_array'][0,0][:,0]
nturns=f['momap']['nturns'][0,0][:,0]
index_first_element = f['momap']['index_first_element'][:]
return momap_pn, s_indexes, s_array, index_first_element
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment