I'm going to try to get this to run on the IDF / DP0.2, as not everyone on our team has their USDF account set up yet, but in the mean time, here's one other thing I noticed right away that needs a solution:
Something about how afw.display works with different back ends has led you to have a big branch in your code on Firefly vs. matplotlib, and that was definitely not the goal for how afw.display should work:
if matplot != None:
|
afwDisplay.setDefaultBackend('matplotlib')
|
|
for i, ref in enumerate(datasetRefs):
|
|
calexp = butler.getDirect(ref)
|
print('Visit: ', calexp.visitInfo.getId(), ', Detector: ',calexp.detector.getId())
|
fig, ax = plt.subplots(1, 3, figsize=(14, 7))
|
plt.sca(ax[0]) # set the first axis as current
|
plt.xlabel('Image with Mask Overlay')
|
display1 = afwDisplay.Display(frame=fig)
|
display1.scale('asinh', -1, 30)
|
display1.mtv(calexp)
|
plt.sca(ax[1]) # set the second axis as current
|
display2 = afwDisplay.Display(frame=fig)
|
display2.mtv(calexp.mask)
|
plt.tight_layout()
|
plt.sca(ax[2])
|
display3 = afwDisplay.Display(frame=fig)
|
display3.scale('asinh', 'zscale')
|
display3.mtv(calexp.variance)
|
plt.tight_layout()
|
plt.show()
|
remove_figure(fig)
|
|
if i == display_num:
|
print('...')
|
break
|
|
else:
|
afwDisplay.setDefaultBackend('firefly')
|
for i, ref in enumerate(datasetRefs):
|
|
calexp = butler.getDirect(ref)
|
print('Visit: ', calexp.visitInfo.getId(), ', Detector: ',calexp.detector.getId())
|
display = afwDisplay.Display(frame=3*i)
|
display.scale('asinh', -1, 30)
|
display.mtv(calexp)
|
display = afwDisplay.Display(frame=3*i+1)
|
display.setMaskTransparency(90)
|
display.mtv(calexp.mask)
|
display = afwDisplay.Display(frame=3*i+2)
|
display.scale('asinh', 'zscale')
|
display.mtv(calexp.variance)
|
|
if i == display_num:
|
print('...')
|
break
|
The goal is for this sort of thing to be necessary only rarely, even in a case like this where you are laying out a grid. So I hope after we get the actual bugs fixed we can look at this.
Hi, Brianna Smart, thank you for reporting this.
The code sample has
I'm assuming this collection is on the USDF?