NSLS-II-CHX / CHX_BugReport

Unified issue-tracker for bugs in the data analysis JupyterHub at CHX
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

get_each_box_mean_intensity error #8

Closed rheadric closed 8 years ago

rheadric commented 8 years ago

mean_int_sets = get_each_box_mean_intensity( good_series, box_maskr, sampling = 1, timeperframe = md['frame_time']+md['counttime'], plot = True, uid=uid )

gives:

XPCS_GiSAXS.py in get_each_box_mean_intensity(data_series, boxmask, sampling, timeperframe, plot, _argv, *_kwargs) 1295 ax.legend() 1296 -> 1297 fp = path + 'uid=%s--Mean intensity of each box-'%(uid) + '.png' 1298 fig.savefig( fp, dpi=fig.dpi) 1299

NameError: name 'path' is not defined

yugangzhang commented 8 years ago

I updated the code and make path='' as default.

You can add path in that func, something like

mean_int_sets = get_each_box_mean_intensity( good_series, box_maskr, sampling = 1, timeperframe = md['frame_time']+md['counttime'], plot = True, uid=uid, path = data_dir )

Note: data_dir is the directory you will save the results.

rheadric commented 8 years ago

Still same error with

mean_int_sets = get_each_box_mean_intensity( good_series, box_maskr, sampling = 1, timeperframe = md['frame_time']+md['counttime'], plot = True, uid=uid, path=data_dir )

/opt/conda_envs/analysis/lib/python3.5/site-packages/chxanalys-0+untagged.59.gf3a9ec5.dirty-py3.5.egg/chxanalys/XPCS_GiSAXS.py in get_each_box_mean_intensity(data_series, boxmask, sampling, timeperframe, plot, _argv, *_kwargs) 1298 1299 #fp = path + 'uid=%s--Mean intensity of each box-'%(uid) + '.png' -> 1300 fp = path + 'uid=%s--Mean-intensity-of-each-ROI-'%(uid) + '.png' 1301 fig.savefig( fp, dpi=fig.dpi) 1302

NameError: name 'path' is not defined

yugangzhang commented 8 years ago

Please try now.

rheadric commented 8 years ago

UnboundLocalError Traceback (most recent call last)

in () 1 mean_int_sets = get_each_box_mean_intensity( good_series, box_maskr, sampling = 1, ----> 2 timeperframe = md['frame_time']+md['count_time'], plot_ = True, uid=uid, path=data_dir ) /opt/conda_envs/analysis/lib/python3.5/site-packages/chxanalys-0+untagged.59.gf3a9ec5.dirty-py3.5.egg/chxanalys/XPCS_GiSAXS.py in get_each_box_mean_intensity(data_series, box_mask, sampling, timeperframe, plot_, _argv, *_kwargs) 1294 1295 #fp = path + 'uid=%s--Mean intensity of each box-'%(uid) + '.png' -> 1296 if path not in kwargs.keys(): 1297 path='' 1298 else: UnboundLocalError: local variable 'path' referenced before assignment
yugangzhang commented 8 years ago

I updated the code. Please try it again.