keflavich / cube-line-extractor

4 stars 1 forks source link

Moment images no longer have attribute FITSFigure #27

Closed jmangum closed 2 years ago

jmangum commented 2 years ago

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.

keflavich commented 2 years ago

you need to pip install aplpy to fix this

jmangum commented 2 years ago

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?

keflavich commented 2 years ago

yes, this has been an issue for a while... https://github.com/radio-astro-tools/spectral-cube/issues/835

jmangum commented 2 years ago

Resolved by PR #28