I thought I would open a new issue to track the fixes we need to make to HMI maps. See #158 for an example of how to implement a map source.
(dev) Davids-MBP-3:doc dstansby$ python ../examples/finding_data/plot_hmi.py
WARNING: FITSFixedWarning: CRDER1 = 'nan '
a floating-point value was expected. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: CRDER2 = 'nan '
a floating-point value was expected. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'unitfix' made the change 'Changed units:
'Degree' -> 'deg'. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'celfix' made the change 'In CUNIT2 : Invalid symbol in EXPON context in 'Sine Latitude''. [astropy.wcs.wcs]
Traceback (most recent call last):
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 566, in _do_parse
return cls._parse_unit(s, detailed_exception=False)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 487, in _parse_unit
raise ValueError()
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 459, in _get_unit
return cls._parse_unit(t.value)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 483, in _parse_unit
raise ValueError(
ValueError: Degree is not a valid unit. Did you mean degree or exadegree?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/core.py", line 1854, in __call__
return f.parse(s)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 551, in parse
result = cls._do_parse(s, debug=debug)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 569, in _do_parse
return cls._parser.parse(s, lexer=cls._lexer, debug=debug)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/extern/ply/yacc.py", line 331, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/extern/ply/yacc.py", line 1061, in parseopt_notrack
lookahead = get_token() # Get the next token
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/extern/ply/lex.py", line 350, in token
newtok = func(tok)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 165, in t_UNIT
t.value = cls._get_unit(t)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/format/generic.py", line 461, in _get_unit
raise ValueError(
ValueError: At col 0, Degree is not a valid unit. Did you mean degree or exadegree?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../examples/finding_data/plot_hmi.py", line 24, in <module>
hmi_map.plot()
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/decorators.py", line 234, in wrapper
return_ = wrapped_function(*func_args, **func_kwargs)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/sunpy/map/mapbase.py", line 1719, in plot
axes = wcsaxes_compat.gca_wcs(self.wcs)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/sunpy/map/mapbase.py", line 294, in wcs
w2.wcs.cdelt = u.Quantity(self.scale)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/sunpy/map/mapbase.py", line 706, in scale
return SpatialPair(self.meta.get('cdelt1', 1.) * self.spatial_units[0] / u.pixel,
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/sunpy/map/mapbase.py", line 714, in spatial_units
return SpatialPair(u.Unit(self.meta.get('cunit1')),
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.8/site-packages/astropy/units/core.py", line 1874, in __call__
raise ValueError(msg)
ValueError: 'Degree' did not parse as unit: At col 0, Degree is not a valid unit. Did you mean degree or exadegree? If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see http://docs.astropy.org/en/latest/units/combining_and_defining.html