Skip to content

Commit

Permalink
fix remaining issues, should now be PEP8 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
fnattino committed Nov 20, 2023
1 parent e18caa9 commit b63a065
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dhdt/auxiliary/handler_mgrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ def _mgrs_to_search_geometry(tile_code):
extra = Polygon.from_bounds(-180, -90.0, -174, 90.0)
if extra is not None:
geom = MultiPolygon(polygons=[geom, extra])
return geom
return geom
20 changes: 11 additions & 9 deletions dhdt/processing/coupling_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def match_pair(I1,
X2_grd, Y2_grd = np.squeeze(X2_grd), np.squeeze(Y2_grd)
return X2_grd, Y2_grd, match_metric

def match_image(I, M, D, geoTransform, id_1, id_2, X_grd, Y_grd,

def match_image(Z, M, D, geoTransform, id_1, id_2, X_grd, Y_grd,
temp_radius=2**3, search_radius=2**4,
correlator='robu_corr', subpix='moment',
metric='peak_abs', **kwargs):
Expand All @@ -320,29 +321,30 @@ def match_image(I, M, D, geoTransform, id_1, id_2, X_grd, Y_grd,
list_differential_correlators, list_peak_estimators, \
list_frequency_correlators

I, M = get_data_and_mask(I, M)
X_grd,Y_grd = np.atleast_2d(X_grd), np.atleast_2d(Y_grd)
Z, M = get_data_and_mask(Z, M)
X_grd, Y_grd = np.atleast_2d(X_grd), np.atleast_2d(Y_grd)

correlator = correlator.lower()
if (subpix is not None): subpix=subpix.lower()
subpix = subpix.lower() if subpix is not None else subpix

frequency_based = list_frequency_correlators()
differential_based = list_differential_correlators()
peak_based = list_peak_estimators()

I_grd,J_grd = map2pix(geoTransform, X_grd, Y_grd)
I_grd, J_grd = map2pix(geoTransform, X_grd, Y_grd)

# inside selection and padding
IN = np.logical_and.reduce((I_grd>=0, I_grd<(I.shape[0]-1),
J_grd>=0, J_grd<(I.shape[1]-1)))
IN = np.logical_and.reduce((I_grd >= 0, I_grd < (Z.shape[0] - 1),
J_grd >= 0, J_grd < (Z.shape[1] - 1)))

M2_new = pad_radius(M2, ds2)
i2 += ds2
j2 += ds2

I1,I2,i1,j1,i2,j2,IN = pad_images_and_filter_coord_list(
I1, I2, i1, j1, i2, j2, IN = pad_images_and_filter_coord_list(
I1, I2, geoTransform1, geoTransform2, X_grd, Y_grd,
temp_radius, search_radius, same=True)
temp_radius, search_radius, same=True
)

return

Expand Down
2 changes: 1 addition & 1 deletion dhdt/processing/matching_tools_frequency_subpixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def phase_gradient_descend(data,
return di, dj


def phase_tpss(Q, W, m, p=1e-4, k=4, j=5, n=3): #wip
def phase_tpss(Q, W, m, p=1e-4, k=4, j=5, n=3): # wip
"""get phase plane of cross-spectrum through two point step size iteration
find slope of the phase plane through
Expand Down

0 comments on commit b63a065

Please sign in to comment.