Commits
44 44 | fitResult.count++; |
45 45 | fitResult.chiSqAvg += (chiSquared - fitResult.chiSqAvg) / |
46 46 | static_cast<float>(fitResult.count); |
47 47 | if (chiSquared < fitResult.chiSqMin) |
48 48 | fitResult.chiSqMin = chiSquared; |
49 49 | if (chiSquared > fitResult.chiSqMax) |
50 50 | fitResult.chiSqMax = chiSquared; |
51 51 | } |
52 52 | } |
53 53 | |
54 + | /* |
55 + | * Produces a record from information accumulated for every fit that |
56 + | * is calculated by the UVContSub TVI (addOneFit()). This is used at |
57 + | * the moment to hold basic goodness-of-fit information. The record |
58 + | * produced by this function is meant to be returned as result by the |
59 + | * UVContSub TVI and can be returned by the uvcontsub task. The result |
60 + | * record/dictionary would look like: |
61 + | * |
62 + | * {'description': 'summary of data fitting results in uv-continuum subtraction', |
63 + | * 'goodness_of_fit': {'field': {'0': {'scan': {'3': {'spw': {'0': |
64 + | * {'polarization': {'0': {'chi_squared': {'average': {'imag': 0.0001153, |
65 + | * 'real': 0.0001143}, |
66 + | * 'max': {'imag': 0.0001199, |
67 + | * 'real': 0.0001255}, |
68 + | * 'min': {'imag': 0.0001117, |
69 + | * 'real': 0.0001069}}, |
70 + | * 'count': 16}, |
71 + | * '1': {'chi_squared': {'average': {'imag': 0.0001143, |
72 + | * 'real': 0.0001150}, |
73 + | * ... |
74 + | * |
75 + | * @retunrs record of results accumulated by the UVContSub TVI throughout iterations |
76 + | */ |
54 77 | Record UVContSubResult::getAccumulatedResult() const |
55 78 | { |
56 79 | Record fieldRec; |
57 80 | for (const auto fieldIt : accum) { |
58 81 | Record srec; |
59 82 | for (const auto scanIt : fieldIt.second) { |
60 83 | Record sprec; |
61 84 | for (const auto spwIt : scanIt.second) { |
62 85 | Record polrec; |
63 86 | for (const auto polIt : spwIt.second) { |