Skip to content

Commit 5987514

Browse files
committed
Updated the dependencies file
1 parent f060bb5 commit 5987514

File tree

3 files changed

+44
-10
lines changed

3 files changed

+44
-10
lines changed

Diff for: dependencies.txt

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1+
IPython
2+
PIL
13
astropy
2-
hdf5storage
4+
cv2
5+
datetime
36
ezdxf
4-
mat73
7+
geopandas
8+
glob
9+
h5py
10+
hdf5storage
511
imageio
6-
ffmpeg-python
12+
inspect
13+
mat73
14+
matplotlib
15+
numpy
16+
os
17+
pandas
18+
pdb
19+
pyproj
20+
requests
21+
scipy
22+
shapely
23+
subprocess
24+
sys
25+
time
26+
tqdm
27+
warnings
28+
xarray

Diff for: edgetrim_mask.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
def edgetrim_mask(edge_trim_array, debug_flag=0, start_trim=0, end_trim=0):
3+
def edgetrim_mask(edge_trim_array, debug_flag=0, start_trim=0, end_trim=0, additional_narrowing=0):
44
"""
55
% (C) Nick Holschuh - Amherst College -- 2022 ([email protected])
66
%
@@ -23,20 +23,31 @@ def edgetrim_mask(edge_trim_array, debug_flag=0, start_trim=0, end_trim=0):
2323
from scipy.interpolate import interp1d
2424
mask = np.zeros(edge_trim_array.shape)
2525

26+
27+
###################################################################
28+
### Here we identify the non-NAN values in the edge_trim matrix ###
29+
###################################################################
2630
et_row,et_col = np.where(~np.isnan(edge_trim_array))
2731
center_split = np.mean(et_row)
2832
left_ind = np.where(et_row < center_split)
2933
right_ind = np.where(et_row >= center_split)
3034

3135

36+
###################################################################
37+
### We interpolate the edge_trim values across all slices ####
38+
###################################################################
3239
col_opts = np.arange(0,edge_trim_array.shape[1])
3340

34-
left_row_interpolator = interp1d(et_col[left_ind],et_row[left_ind],fill_value=np.NaN,bounds_error=0)
35-
right_row_interpolator = interp1d(et_col[right_ind],et_row[right_ind],fill_value=np.NaN,bounds_error=0)
41+
left_row_interpolator = interp1d(et_col[left_ind],et_row[left_ind]+additional_narrowing,fill_value=np.NaN,bounds_error=0)
42+
right_row_interpolator = interp1d(et_col[right_ind],et_row[right_ind]-additional_narrowing,fill_value=np.NaN,bounds_error=0)
3643

3744
left_row = left_row_interpolator(col_opts).astype(int)
3845
right_row = right_row_interpolator(col_opts).astype(int)
3946

47+
48+
###################################################################
49+
### Then we build the mask from the interpolated values ####
50+
###################################################################
4051
for i in col_opts:
4152
mask[left_row[i]:right_row[i]+1,i] = 1
4253
for i in range(start_trim):

Diff for: find_pixelcoords.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def find_pixelcoords(im_filename,original_width,original_height,im_pick_params=0
5555
rinds = ndh.minmax(im_frame[0])
5656
else:
5757
########################## This is meant to handle some spillover of lines and points outside the image
58-
row_sum = np.sum(np_frame[:,:,3] == 255,axis=1)
59-
col_sum = np.sum(np_frame[:,:,3] == 255,axis=0)
58+
row_sum = np.sum(np_frame[:,:,2] == 255,axis=1)
59+
col_sum = np.sum(np_frame[:,:,2] == 255,axis=0)
6060

6161
rinds = ndh.minmax(np.where(row_sum > np.mean(row_sum)))
6262
cinds = ndh.minmax(np.where(col_sum > np.mean(col_sum)))
@@ -113,10 +113,11 @@ def find_pixelcoords(im_filename,original_width,original_height,im_pick_params=0
113113
pick_temp_temp = []
114114
for ind3, cols in enumerate(np.unique(true_x_inds)):
115115
true_x_ind = int(cols)
116+
compare_inds = np.where(true_x_inds == cols)[0]
116117
########## We want to lean toward the top side, so we split the difference between mean and min
117118
y_ind = int(np.mean([
118-
np.mean(rind[true_x_inds == cols]),
119-
np.min(rind[true_x_inds == cols])])
119+
np.mean(rind[compare_inds]),
120+
np.min(rind[compare_inds])])
120121
)
121122
true_y_ind = np.round(yrange[y_ind])
122123
pick_temp_temp.append([true_x_ind,true_y_ind])

0 commit comments

Comments
 (0)