Commit 6ad13e53 authored by Tilmann Sager's avatar Tilmann Sager
Browse files

Added some logging/mapping notes

parent 639909b0
......@@ -43,8 +43,9 @@ job_df = job_df.progress_apply(flight_filtering.filter_flights, axis=1)
"""
TRANSFORMATION
"""
print('Running CDA/thresholding')
print('Running CDA')
job_df = job_df.progress_apply(transformation.cda_preprocess, axis=1)
print('Running thresholding')
job_df = job_df.progress_apply(transformation.threshold, axis=1)
"""
......
......@@ -8,3 +8,33 @@ def scale_coord_to_arr_dim(lat_lon, h_w, input_points):
# y must be reversed because the orientation of the image in the matplotlib.
# image - (0, 0) in upper left corner; coordinate system - (0, 0) in lower left corner
return int(x), h_w[1] - int(y)
def scale_arr_points_to_coord(lat_lon, h_w, input_points):
new = (input_points[2], input_points[0])
old = (0, h_w[1])
y = ((lat_lon[0] - old[0]) * (new[1] - new[0]) / (old[1] - old[0])) + new[0]
new = (input_points[1], input_points[3])
old = (0, h_w[0])
x = ((lat_lon[1] - old[0]) * (new[1] - new[0]) / (old[1] - old[0])) + new[0]
# y must be reversed because the orientation of the image in the matplotlib.
# image - (0, 0) in upper left corner; coordinate system - (0, 0) in lower left corner
return int(x), h_w[1] - int(y)
"""
NOTES
# use ndi for mapping coordinates
# importing numpy package for
# creating arrays
import numpy as np
# importing scipy
from scipy import ndimage
# creating an array from 0 to 15 values
a = np.arange(16.).reshape((4, 4))
# finding coordinates
ndimage.map_coordinates(a, [[0.3, 1], [0.5, 1]], order=1)
"""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment