sunpy/sunpy — Issue #93: BaseMap class cannot be used directly
Author: ayshih
Created: 2011-11-15 22:15:43+00:00
State: open

The BaseMap class itself cannot be used directly (i.e., instead of using one of its derived classes) because both `__init__` and `__array_finalize__` call `self.get_properties(header)`, but BaseMap only defines `get_properties(cls)` without defining a `get_properties(cls,header)`. While the latter is defined in all of the derived classes, it seems improper to me for the base class not to be able to initialize itself.

I have currently "fixed" this bug on my own fork by replacing (line 203 of `map\basemap.py`):

def get_properties(cls):

with

def get_properties(cls, header=None):

Someone else should take a look at the class design to figure out if this or some other fix makes sense. For example, perhaps `BaseMap.get_properties` should insist on a `header` argument (i.e., instead of it being optional as I made it), even if it does nothing with it.