keflavich/cube-line-extractor

Moment images no longer have attribute FITSFigure

jmangum opened this issue · 4 comments

Change from python 3.7 to python 3.9 environments has resulted in the FITSFigure attribute not being assigned to the moment images created. This messes-up the quicklook plots. Specifically:

if hasattr(mom, 'FITSFigure'):
    mom.FITSFigure.colorbar.show(axis_label_text=labels[moment].format(mom.unit.to_string('latex_inline')))
    mom.FITSFigure.save(filename=figfilename)
    mom.FITSFigure.close()
else:
    mom.figure.savefig(figfilename)

...does not produce the nice quicklook plot as before. Not sure which attribute I should test against now.

you need to pip install aplpy to fix this

I thought I had, but apparently not. Would it make sense to spit out a warning when the FITSFigure attribute is missing with instructions on what to do?

yes, this has been an issue for a while... radio-astro-tools/spectral-cube#835

Resolved by PR #28