Exemplo n.º 1
0
 def test_HstackTimeSeries_inconsistent_data_geometries(self):
     HT = HstackTimeseries()
     x = np.random.random(100)*2.-1.
     y = np.random.random(1000)*2.-1.
     HT.add_data(x, 'A')
     with self.assertRaises(ValueError):
         HT.add_data(y, 'B')
Exemplo n.º 2
0
 def test_HstackTimeSeries_inconsistent_data_geometries(self):
     HT = HstackTimeseries()
     x = np.random.random(100) * 2. - 1.
     y = np.random.random(1000) * 2. - 1.
     HT.add_data(x, 'A')
     with self.assertRaises(ValueError):
         HT.add_data(y, 'B')
Exemplo n.º 3
0
 def test_HstackTimeSeries(self):
     HT = HstackTimeseries()
     for i in xrange(15):
         x = np.random.random(100) * 2. - 1.
         HT.add_data(x, 'model' + str(i).zfill(3))
     HT.plot(cmap='RdBu_r',
             interpolation='nearest',
             vmin=-1.,
             vmax=1.,
             nclasses=15,
             title='Testtitle')
Exemplo n.º 4
0
 def test_HstackTimeSeries_noplotdone(self):
     HT = HstackTimeseries()
     with self.assertRaises(ValueError):
         HT._add_colorbar()
Exemplo n.º 5
0
 def test_HstackTimeSeries_monthly_ticks(self):
     HT = HstackTimeseries()
     f = plt.figure()
     ax = f.add_subplot(111)
     ax.plot(np.arange(12))
     HT._set_monthly_xtick_labels(ax)
Exemplo n.º 6
0
 def test_HstackTimeSeries_duplicate_keys(self):
     HT = HstackTimeseries()
     x = np.random.random(100) * 2. - 1.
     HT.add_data(x, 'A')
     with self.assertRaises(ValueError):
         HT.add_data(x, 'A')
Exemplo n.º 7
0
 def test_HstackTimeSeries_invalidData(self):
     HT = HstackTimeseries()
     x = np.random.random((50, 60)) * 2. - 1.
     with self.assertRaises(ValueError):
         HT.add_data(x, 'test')
Exemplo n.º 8
0
 def test_HstackTimeSeries_noplotdone(self):
     HT = HstackTimeseries()
     with self.assertRaises(ValueError):
         HT._add_colorbar()
Exemplo n.º 9
0
 def test_HstackTimeSeries_monthly_ticks(self):
     HT = HstackTimeseries()
     f = plt.figure()
     ax = f.add_subplot(111)
     ax.plot(np.arange(12))
     HT._set_monthly_xtick_labels(ax)
Exemplo n.º 10
0
 def test_HstackTimeSeries_duplicate_keys(self):
     HT = HstackTimeseries()
     x = np.random.random(100)*2.-1.
     HT.add_data(x, 'A')
     with self.assertRaises(ValueError):
         HT.add_data(x, 'A')
Exemplo n.º 11
0
 def test_HstackTimeSeries_invalidData(self):
     HT = HstackTimeseries()
     x = np.random.random((50, 60))*2.-1.
     with self.assertRaises(ValueError):
         HT.add_data(x, 'test' )
Exemplo n.º 12
0
 def test_HstackTimeSeries(self):
     HT = HstackTimeseries()
     for i in xrange(15):
         x = np.random.random(100)*2.-1.
         HT.add_data(x, 'model' + str(i).zfill(3) )
     HT.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle')
Exemplo n.º 13
0
"""
This file is part of pyCMBS. (c) 2012-2014
For COPYING and LICENSE details, please refer to the file
COPYRIGHT.md
"""
"""
Hstackplotting
"""

from pycmbs.plots import HstackTimeseries
import numpy as np
import matplotlib.pyplot as plt

plt.close('all')

ht = HstackTimeseries()

for i in xrange(50):
    x = np.random.random(12) * 2. - 1.
    ht.add_data(x, 'model' + str(i).zfill(3))

ht.plot(cmap='RdBu_r',
        interpolation='nearest',
        vmin=-1.,
        vmax=1.,
        nclasses=15,
        title='Testtitle',
        maxheight=0.3,
        monthly_clim_ticks=True)

plt.show()
Exemplo n.º 14
0
This file is part of pyCMBS. (c) 2012-2014
For COPYING and LICENSE details, please refer to the file
COPYRIGHT.md
"""

"""
Hstackplotting
"""

from pycmbs.plots import HstackTimeseries
import numpy as np
import matplotlib.pyplot as plt


plt.close('all')

ht = HstackTimeseries()

for i in xrange(50):
    x = np.random.random(12)*2.-1.
    ht.add_data(x, 'model' + str(i).zfill(3) )

ht.plot(cmap='RdBu_r', interpolation='nearest', vmin=-1., vmax=1., nclasses=15, title='Testtitle', maxheight=0.3, monthly_clim_ticks=True)



plt.show()


#~ set_size_inches(18.5,10.5)