Permalink
Browse files

added __repr__ to basemap for easier introspection

  • Loading branch information...
1 parent 7335945 commit b787fdb3c5371d15905eaab893aa50e8c93637b2 @ehsteve ehsteve committed Apr 13, 2012
Showing with 16 additions and 1 deletion.
  1. +1 −1 sunpy/cm/cm.py
  2. +15 −0 sunpy/map/basemap.py
View
@@ -3,7 +3,7 @@
"""
from __future__ import absolute_import
-__all__ = ["get_cmap", "show_colormaps", "test_equalize"]
+__all__ = ["get_cmap", "show_colormaps"]
import numpy as np
import matplotlib.pyplot as plt
View
@@ -223,6 +223,21 @@ def __add__(self, other):
return result
+ def __repr__(self):
+ output = "SunPy Map\n"
+ output += "---------\n"
+ output += "Observatory:\t" + self.observatory + "\n"
+ output += "Instrument:\t" + self.instrument + "\n"
+ output += "Detector:\t" + self.detector + "\n"
+ output += "Measurement:\t" + str(self.measurement) + "\n"
+ output += "Obs date:\t" + self.date.strftime("%Y-%m-%d %H:%M:%S") + "\n"
+ #output += "Coordinate System: " + self.coordinate_system + "\n"
+ output += "dt:\t\t" + str(self.exposure_time) + "\n"
+ output += "Dimension:\t[" + str(self.shape[0]) + ', ' + str(self.shape[1]) + "]\n"
+ output += "[dx, dy] =\t[" + str(self.scale['x']) + ', ' + str(self.scale['y']) + "]\n"
+
+ return output + "\n" + super(BaseMap, self).__repr__()
+
def __sub__(self, other):
"""Subtract two maps. Currently does not take into account the
alignment between the two maps.

0 comments on commit b787fdb

Please sign in to comment.