Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common/lib/share/mccode-r.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,11 @@ MCDETECTOR detector_import(
switch (detector.rank) {
case 0: strcpy(detector.type, "array_0d"); m=n=p=1; break;
case 1: snprintf(detector.type, CHAR_BUF_LENGTH, "array_1d(%ld)", m*n*p); m *= n*p; n=p=1; break;
case 2: snprintf(detector.type, CHAR_BUF_LENGTH, "array_2d(%ld, %ld)", m, n*p); n *= p; p=1; break;
case 2: if(!strcasestr(detector.format,"list")) {
snprintf(detector.type, CHAR_BUF_LENGTH, "array_2d(%ld, %ld)", m, n*p); n *= p; p=1;
} else {
snprintf(detector.type, CHAR_BUF_LENGTH, "list(%ld, %ld)", m, n*p); n *= p; p=1;
} break;
case 3: snprintf(detector.type, CHAR_BUF_LENGTH, "array_3d(%ld, %ld, %ld)", m, n, p); break;
default: m=0; strcpy(detector.type, ""); strcpy(detector.filename, "");/* invalid */
}
Expand Down
15 changes: 13 additions & 2 deletions tools/Python/mccodelib/mcplotloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ def __str__(self, *args, **kwargs):
class Data0D(DataMcCode):
# Bring back empty 'component' field, courtesy
# of the scan plotter (otherwise we fail abrubtly)
DataMcCode.component=''
def __init__(self):
super(Data0D, self).__init__()
self.component=''
self.filename = ''
self.xlabel = ''
self.ylabel = ''
pass


Expand Down Expand Up @@ -329,13 +334,19 @@ def load(monfile):
if typ == 'array_0d':
print("load_monitor: Not loading 0d dataset %s" % monitorfile)
data = Data0D()
data.title='zero-dim monitor'
elif typ == 'array_1d':
data = _parse_1D_monitor(text)
elif typ == 'array_2d':
data = _parse_2D_monitor(text)
elif typ == 'list':
print('load_monitor: %s is an event list. loading suppressed' % f)
data = Data0D()
data.title='event list'
else:
print('load_monitor: unknown data format %s' % typ)
data = None
data = Data0D()
data.title='Unknown format'
data.filepath = f
return data
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/Python/mcplot/pyqtgraph/plotfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def paint(self, p, *args):

def plot_Data0D(data, plt, log=False, legend=True, icolormap=0, verbose=True, fontsize=10):
''' creates an empty plot '''
plt.setTitle("zero-dim monitor")
plt.setTitle(data.title)
return plt.getViewBox()


Expand Down
Loading