Commits
Benjamin Bean authored 8bbd3c22513
17 17 | polarity id: { |
18 18 | summary key: { |
19 19 | cycle: value |
20 20 | } |
21 21 | } |
22 22 | } |
23 23 | } |
24 24 | |
25 25 | Examples: |
26 26 | |
27 - | 1. To get the number of iterations done on the channel 5 during the first minor cycle: |
28 - | chan5iters = ret[5][0][0]['iterDone'] |
27 + | 1. To get the number of iterations done on the channel 5, polarity 0 during the second minor cycle: |
28 + | chan5iters = summMin[5][0]['iterDone'][1] |
29 29 | |
30 30 | 2. To get the number of available channels, and the ids of those channels: |
31 - | nchans = len(ret) |
32 - | avail_chans = ret.keys() |
31 + | nchans = len(summMin) |
32 + | avail_chans = summMin.keys() |
33 33 | |
34 34 | 3. To get the available minor cycle summary statistics: |
35 - | statkeys = ret.rowDescriptions |
35 + | summaryKeys = summMin.rowDescriptions |
36 36 | |
37 37 | There are also a few additional methods: |
38 38 | getMatrix(): returns the original numpy.ndarray matrix |
39 39 | getDict(calc_iterdone_deltas, keep_startvals): to get the iterDone stat for iterations across all channels |
40 40 | |
41 - | Extends the python dictionary interface (try the command "help(dict)" for more information on builtin python dicts).""" |
41 + | Extends the python dictionary interface (try the command "help(dict)" for more information on builtin python dicts). |
42 + | |
43 + | Note that this class will be saved as a plain python dict when saved with methods like pickle.dump() or numpy.save(). |
44 + | This is done to prevent issues when loading later, when this class might not be available to the python interpretter.""" |
42 45 | # 0 1 2 3 4 5 6 7 8 9 10 11 "No Mask" 12 13 14 15 16 17 |
43 46 | rowDescriptionsOldOrder = ["iterDone", "peakRes", "modelFlux", "cycleThresh", "mapperId", "chan", "pol", "cycleStartIters", "startIterDone", "startPeakRes", "startModelFlux", "startPeakResNM", "peakResNM", "masksum", "mpiServer", "peakMem", "runtime", "stopCode"] |
44 47 | rowDescriptions = ["startIterDone", "iterDone", "startPeakRes", "peakRes", "startModelFlux", "modelFlux", "startPeakResNM", "peakResNM", "cycleThresh", "mapperId", "cycleStartIters", "masksum", "mpiServer", "peakMem", "runtime", "stopCode", "chan", "pol"] |
45 48 | rowStartDescs = ["startIterDone", "startPeakRes", "startModelFlux", "startPeakResNM"] |
46 49 | |
47 50 | def __init__(self, summaryminor_matrix, summaryminor_dict = None): |
48 51 | self.summaryminor_matrix = summaryminor_matrix |
49 52 | if (summaryminor_dict == None): |
50 53 | summaryminor_dict = SummaryMinor.indexMinorCycleSummaryBySubimage(self.summaryminor_matrix) |
51 54 | self.summaryminor_dict = summaryminor_dict |