Skip to content
Snippets Groups Projects
Commit a6d3755c authored by leufen1's avatar leufen1
Browse files

added plot routine to population

parent e62cefc0
Branches
Tags
2 merge requests!5New App; stable_night_lights,!4Lukas issue004 feat new app stable night lights
......@@ -8,8 +8,8 @@ Author: Martin Schultz, FZ Juelich (04 May 2016)
import numpy as np
import os
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_POPULATION_DATA
import matplotlib.pyplot as plt
# import matplotlib.pyplot as plt
def read_proxydata(filename, dummy=DEBUG and USE_DUMMY_POPULATION_DATA):
"""Read the ascii file and return the data array together with
......@@ -54,9 +54,11 @@ def read_proxydata(filename, dummy=DEBUG and USE_DUMMY_POPULATION_DATA):
logdata = data.copy()
logdata[logdata <= 1.e-4] = 1.e-4
# plt.contourf(lonvec, latvec, np.log10(logdata))
# plt.savefig('global_population_density.png')
# plt.close()
if DEBUG:
plt.contourf(lonvec, latvec, np.log10(logdata))
plt.savefig('../plots/global_population_density.png')
plt.close()
# set metadata
boundingbox = [lon0, lat0, lonvec.max(), latvec.max()]
......
from django.test import TestCase
# Create your tests here.
from .population_file_extraction import read_proxydata
FILENAME = "pop.txt"
read_proxydata(FILENAME, dummy=False)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment