Skip to content

Commit

Permalink
minor changes in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ThesaHel committed Feb 28, 2021
1 parent 93c2354 commit bf0634e
Show file tree
Hide file tree
Showing 14 changed files with 3,516 additions and 10 deletions.
Binary file modified Project_Codes/__pycache__/array_calculations.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/compare_data.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/config.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/data_management.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/fun.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/log.cpython-37.pyc
Binary file not shown.
Binary file modified Project_Codes/__pycache__/zon_statistics.cpython-37.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion Project_Codes/compare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def number_of_items(object_one, object_two):
Compare the number of items of two objects.
:param object_one: Object on which the len() function can be applied
:param object_two: Object on which the len() function can be applied
:return:
"""
try:
if not len(object_one) == len(object_two):
Expand Down
2 changes: 1 addition & 1 deletion Project_Codes/data_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DataManagement:
folder_creation(): Method creates folder at instantiated path if it does not already exists.
get_date(): Method gets the month and the year from the instantiated filenames.
create_date_string(): Method which returns a date string by calling the get_date method.
get_proj_data(): Method which get the projection and geotransformation from a raster file (osgeo.gdal.Dataset).
get_proj_data(): Method which gets the projection and geotransformation from a raster file (osgeo.gdal.Dataset).
save_raster(res_path, array, gt, proj): Static Method which creates and saves raster-file (.tif) from an
existing array using a defined projection.
Expand Down
17 changes: 10 additions & 7 deletions Project_Codes/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def snowdepth(snow_at_start, measured_snow_next_period, satellite_data):
snow_start_array = calc_snow.snow_at_start(snow_end_of_period=snow_at_end_array)
return snow_at_end_array, snowmelt_array, snow_start_array
except TypeError:
print("Input arguments have to be ARRAYS.")
logger.error("TypeError: Input arguments have to be ARRAYS.")


@wrapper(entering, exiting)
Expand All @@ -38,12 +38,15 @@ def check_data(array_one, array_two, path_raster_one, path_raster_two, object_on
:param object_one: object one where len() can be applied, e.g. LIST, TUPLE, STR, etc.
:param object_two: object two where len() can be applied, e.g. LIST, TUPLE, STR, etc.
"""
check = CompareData(array_one=array_one, array_two=array_two, raster_one_path=path_raster_one,
raster_two_path=path_raster_two)
check.compare_shape()
check.compare_projection()
check.compare_geotransform()
check.number_of_items(object_one, object_two)
try:
check = CompareData(array_one=array_one, array_two=array_two, raster_one_path=path_raster_one,
raster_two_path=path_raster_two)
check.compare_shape()
check.compare_projection()
check.compare_geotransform()
check.number_of_items(object_one, object_two)
except TypeError:
logger.error("TypeError: Check type of input arguments.")


def compare_date(filename_one, filename_two):
Expand Down
3,504 changes: 3,504 additions & 0 deletions Project_Codes/logfile.log

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Project_Codes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def snowcalc_over_list(initial_snow, satellite_data, measured_snow_next_period):
snow_end_array, snowmelt_array, snow_start_array = snowdepth(snow_start_month[k],
measured_snow_next_period[m],
satellite_data[k])
# appending results to created result lists
snow_end_month.append(snow_end_array)
snow_melt.append(snowmelt_array)
# avoids appending lastly calculated snow_start_array which describes next period without given input data
Expand Down
1 change: 0 additions & 1 deletion Project_Codes/zon_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def plot_zon_statistics(self):
"""
Method which plots the desired statistical value over time and writes a .png-image
Method can be disabled in config.py (plot_statistic=False)
:return:
"""
ax = plt.gca()
self.get_zon_statistic().plot(y=self.parameter, x="Date", kind='line', marker='o', color='grey',
Expand Down
Binary file modified Results/Plots/coverage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf0634e

Please sign in to comment.