diff --git a/pyglance/glance/compare.py b/pyglance/glance/compare.py index 9f5d80fe93427e45ea023bd582daa9802b8e2386..8d80adef7c28523eba5a763e7a85de7f06c4af41 100644 --- a/pyglance/glance/compare.py +++ b/pyglance/glance/compare.py @@ -1375,16 +1375,16 @@ def reportGen_library_call (a_path, b_path, var_list=[ ], plotFunctionGenerationObjects = [ ] + # if the data is the same size, we can always make our basic statistical comparison plots + if (aData.shape == bData.shape) : + plotFunctionGenerationObjects.append(plotcreate.BasicComparisonPlotsFunctionFactory()) + # if the bin and tuple are defined, try to analyze the data as complex # multidimentional information requiring careful sampling if ('binIndex' in varRunInfo) and ('tupleIndex' in varRunInfo) : plotFunctionGenerationObjects.append(plotcreate.BinTupleAnalysisFunctionFactory()) - else : - - # if the data is the same size, we can always make our basic statistical comparison plots - if (aData.shape == bData.shape) : - plotFunctionGenerationObjects.append(plotcreate.BasicComparisonPlotsFunctionFactory()) + else : # if it's not bin/tuple, there are lots of other posibilities # if it's vector data with longitude and latitude, quiver plot it on the Earth if isVectorData and (not do_not_test_with_lon_lat) : diff --git a/pyglance/glance/plotcreatefns.py b/pyglance/glance/plotcreatefns.py index 013194f4323f9c769126b3982b6f440fdfc9ef08..9da06547b16b46f6b5952036082014acd1053738 100644 --- a/pyglance/glance/plotcreatefns.py +++ b/pyglance/glance/plotcreatefns.py @@ -891,10 +891,21 @@ class BinTupleAnalysisFunctionFactory (PlottingFunctionFactory) : variableDisplayName + " in both files" + "\n" + "for " + binName + " # " + str(binNumber + 1) + " and case # " + caseNumberText) + dataDiff = aData[binNumber][caseNumber] - bData[binNumber][caseNumber] + maskDiff = ~goodInAMask[binNumber][caseNumber] | ~goodInBMask[binNumber][caseNumber] + def make_diffplot(data=dataDiff, badMask=maskDiff, binNumber=binNumber, caseNumberText=caseNumText): + return figures.create_line_plot_figure([(data, badMask, 'm', 'A - B', None)], + "Value of " + variableDisplayName + " in File A - the value in File B\n" + + "for " + binName + " # " + str(binNumber + 1) + " and case # " + caseNumberText) + functionsToReturn[str(binNumber + 1) + 'sample' + str(section + 1) + '.AB.png'] = (make_lineplot, variableDisplayName + " sample in both files", str(binNumber + 1) + 'sample' + str(section + 1) + '.AB.png', new_list) + functionsToReturn[str(binNumber + 1) + 'sample' + str(section + 1) + 'ABdiff.png] '] = (make_diffplot, + variableDisplayName + " difference between files", + str(binNumber + 1) + 'sample' + str(section + 1) + '.ABdiff.png', + new_list) return functionsToReturn