It’s been a while since I used Sunpy, but I know that this piece of code was working when I used it last. The relevant parts are:
m = sunpy.map.Map(file)
this leads to an error:
WARNING: FITSFixedWarning: ‘datfix’ made the change ‘Set MJD-OBS to 55888.840631 from DATE-OBS’. [astropy.wcs.wcs]
ScaleValueError Traceback (most recent call last)
—> 85 m.plot()
ScaleValueError: Scale ‘utc (tbr)’ is not in the allowed scales [‘local’, ‘tai’, ‘tcb’, ‘tcg’, ‘tdb’, ‘tt’, ‘ut1’, ‘utc’]
It seems that it might have to do with the value of TIMESYS in the fits header:
TIMESYS = ‘UTC (TBR)’ /
Is there a workaround for this? Is this a known problem. I’m trying to view a Hinode XRT image.
Can you provide an example of the data file you are trying to open?
If this used to work, hopefully it is something we can patch in sunpy.
Could you provide the version of sunpy you are using as well?
sunpy.__version__ should tell you.
Thanks your response Nabil. The sunpy version is 2.1.5
How do I upload a fits file here? I suppose I could post it somewhere and provide a link. The example is in the Hinode XRT archive:
If you have the URL that will also work for me.
I will see if I can dig that file out of the archive.
Unfortunately that version of sunpy is not supported anymore, you can upgrade to 4.0.2 and see if that resolves the issue.
Hmm, I just did a “conda update sunpy”. That’s for a python 3.7 environment. I’ll use a different environment.
Sunpy 4.0 dropped support for 3.7, at the least it should have found sunpy 3.1.
That bug was fixed by this PR (No more modify meta by dstansby · Pull Request #5501 · sunpy/sunpy · GitHub) which was included in sunpy v3.1. If you upgrade to a version >=3.1, it should be fixed.
Yeah, I upgraded to 4.0.1 in my python 3.8 environment and that problem goes away. For some reason anaconda doesn’t want to upgrade sunpy beyond 2…1.5 for my python 3.7 environment.