def test_import_numpy_files(self):
		"""check that a dict is created with the correct
		keys and with gdal objects as values."""
		data = import_numpy_files(path=self.sample_path)
		keys = data.keys()
		expected_keys = self.sample_data.keys()
		self.assertEqual(expected_keys, keys)
		assert_dict_value_type_equal(self.sample_data, data)
Example #2
0
    def test_import_numpy_files(self):
        """check that a dict is created with the correct
		keys and with gdal objects as values."""
        data = import_numpy_files(path=self.sample_path)
        keys = data.keys()
        expected_keys = self.sample_data.keys()
        self.assertEqual(expected_keys, keys)
        assert_dict_value_type_equal(self.sample_data, data)
Example #3
0
def run (country=COUNTRY, env=ENV):
    
    print ("running %s in %s" % (colored(env, SUCCESS), colored(country, SUCCESS)))
    import_path = IMPORT_PATH % (env, country)
    
    print ("loading data")
    # Load the numpy data into memory:
    data = viz.import_numpy_files(import_path)
    
    print ("missing data")
    # Handle missing data
    data = handle_missing_data(data)
    
    
    print ("loading outline")
    # Load country outline:
    (line_x, line_y) = viz.country_outline(SHAPE_PATH)
    
    if env == "evi":
        print ("normalising")
        data = normalise(data)

    print ("sorting")
    dates = sorted([date for date in data.keys()])
    
    font = {'family' : 'Arial',
            'weight' : 'normal',
            'size'   : 16}
    plt.rc('font', **font)
    
    if GENERATE_MAP:
        generate_map(data, dates)
    
    if SAVE_MAT:
        print ("saving mat file")
        save_mat(data)