Functions to get information out of a MapCube.

I added in three functions:
_maps_have_same_number_of_x_and_y_pixels 
 - tests if all the maps have the same number of x and y pixels

data()
 - takes the image data in a mapcube and returns a 3d numpy array

meta()
 - returns the meta objects from each map in a list

These functions are handy when working with mapcubes.  Often when you have done what you have to do with your mapcubes, you just want the information out (particularly the image data).  These functions make it easy to do that.  If these functions are acceptable I'll work on the documentation and testing.

As for returning the data and the meta objects, I have a question.  Forgive
my ignorance on this matter, but are object properties created on
instantiation?  If this is so, then if I define a self.data property,
wouldn't this double the size of the mapcube object since self.data is
essentially a copy of the data in the maps?  But if I define a method
self.data(), then that is only evaluated when called?

The reason I ask is I think it would be good to make mapcube as small as
possible, as they have the possibility of being very large very easily.

Thanks!


On Sun, Jun 22, 2014 at 9:15 AM, Jack Ireland <jackireland@gmail.com> wrote:

> "all_maps_same_shape" is a better name.
>
>
> On Sun, Jun 22, 2014 at 5:00 AM, Stuart Mumford <notifications@github.com>
> wrote:
>
>> In sunpy/map/mapcube.py:
>>
>> >
>> >          return MapCubeAnimator(self, **kwargs)
>> > +
>> > +    def _maps_have_same_number_of_x_and_y_pixels(self):
>>
>> This could be called all_maps_same_shape or something. Also I think this
>> can be public, it could be handy for users.
>>
>> --
>> Reply to this email directly or view it on GitHub
>> <https://github.com/sunpy/sunpy/pull/1072/files#r14053613>.
>>
>
>