diff --git a/population-density/population_file_extraction.py b/population-density/population_file_extraction.py index 5053da75934e816f2712c3be86cfc18e7b6f483e..5682b47a53ed789094df97e44f383f70a73e4088 100644 --- a/population-density/population_file_extraction.py +++ b/population-density/population_file_extraction.py @@ -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() diff --git a/stable_night_lights/nightlights_file_extraction.py b/stable_night_lights/nightlights_file_extraction.py index 65490e9e6dc0437f62efebac36d85cba72242002..6f65af80d207f12494d31da27cc4870d85ba6e0a 100644 --- a/stable_night_lights/nightlights_file_extraction.py +++ b/stable_night_lights/nightlights_file_extraction.py @@ -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() diff --git a/topography-tandem-x/topography_file_extraction.py b/topography-tandem-x/topography_file_extraction.py index 9454e127d6aa4d15db27f95ea8d13d6b447ed2a0..38afb60bdcc71ab22ef1631138788716204ee884 100644 --- a/topography-tandem-x/topography_file_extraction.py +++ b/topography-tandem-x/topography_file_extraction.py @@ -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()