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

to create plots, variable PLOT_DATA and DEBUG need to be True both

parent f346f9f5
No related branches found
No related tags found
2 merge requests!8New App wheat production,!6Resolve "New App: Wheat Production"
......@@ -7,7 +7,7 @@ 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
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_POPULATION_DATA, PLOT_DATA
import matplotlib.pyplot as plt
......@@ -58,7 +58,7 @@ def read_proxydata(filename, dummy=DEBUG and USE_DUMMY_POPULATION_DATA):
logdata = data.copy()
logdata[logdata <= 1.e-4] = 1.e-4
if DEBUG:
if DEBUG and PLOT_DATA:
plt.contourf(lonvec, latvec, np.log10(logdata))
plt.savefig('../plots/global_population_density.png')
plt.close()
......
......@@ -8,7 +8,7 @@ Author: Lukas Leufen, FZ Juelich (21th May 2019)
"""
import numpy as np
import os
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_STABLE_NIGHT_LIGHTS_DATA
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_STABLE_NIGHT_LIGHTS_DATA, PLOT_DATA
from django.contrib.gis.gdal import GDALRaster
import matplotlib.pyplot as plt
# import gdal
......@@ -52,7 +52,7 @@ def read_proxydata(filename, dummy=DEBUG and USE_DUMMY_STABLE_NIGHT_LIGHTS_DATA)
boundingbox = [lon0, latvec.min(), lonvec.max(), lat0]
# plot data
if DEBUG:
if DEBUG and PLOT_DATA:
plt.contourf(lonvec, latvec, data)
plt.savefig('../plots/global_nighttime_lights.png')
plt.close()
......
......@@ -8,7 +8,7 @@ Author: Lukas Leufen, FZ Juelich (04 December 2018)
"""
import numpy as np
import os
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_TOPOGRAPHY_TANDEM_DATA
from toar_location_services.settings import DATA_DIR, DEBUG, USE_DUMMY_TOPOGRAPHY_TANDEM_DATA, PLOT_DATA
from django.contrib.gis.gdal import GDALRaster
import matplotlib.pyplot as plt
......@@ -53,7 +53,7 @@ def read_proxydata(filename, dummy=DEBUG and USE_DUMMY_TOPOGRAPHY_TANDEM_DATA):
# set metadata
boundingbox = [lon0, latvec.min(), lonvec.max(), lat0]
if DEBUG:
if DEBUG and PLOT_DATA:
plt.contourf(lonvec, latvec, data)
plt.savefig('../plots/topography.png')
plt.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment