Maps with 8-bit unsigned integer data should probably not set norm
to None
#7259
Labels
Bug
Probably a bug
Effort Low
Requires a small time investment
map
Affects the map submodule
Package Intermediate
Requires some knowledge of the internal structure of SunPy
Priority Medium
Non-urgent action required
There is very old code (from #1432) that sets the
norm
toNone
for maps with 8-bit unsigned integer data (uint8, i.e., 0 to 255):sunpy/sunpy/map/mapbase.py
Lines 236 to 237 in 5bffcc2
Presumably this is done because 8-bit unsigned integer data maps directly to the 8-bit color scale for
matplotlib
. However, this causes later code (written much later) to fail because it assumes that thenorm
keyword exists only if it is actually a normalizer, e.g., inplot()
:sunpy/sunpy/map/mapbase.py
Lines 2529 to 2532 in 5bffcc2
So, possible solutions include:
norm
for uint8 data (i.e., treat it the same as any other data type)norm
at all for uint8 data (i.e.,norm
will not be set inplot_settings
)plot()
specific to uint8 dataChoosing between the options depends on exactly how we would like uint8 data to be visualized.
The text was updated successfully, but these errors were encountered: