Skip to content

Commit

Permalink
Update mowingDetection_UDF.py
Browse files Browse the repository at this point in the history
moved the position of all_na/all_zero conditional in forcepy_pixel to speed up processing
  • Loading branch information
geo-masc authored Mar 24, 2023
1 parent ead8368 commit 60bc5b4
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions python/ts/mowingDetection/mowingDetection_UDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,27 +432,29 @@ def forcepy_pixel(inarray, outarray, dates, sensors, bandnames, nodata, nproc):

np.seterr(all='ignore')
ts = inarray.squeeze()
dateList = []

if profileAnalytics:
for imgDate in dates:
dateList.append(imgDate)
else:
for imgDate in dates:
dateList.append(serial_date_to_string(imgDate))

date = np.array(dateList)


nodata = nodata

all_no_data = np.all(ts == nodata)
all_zero = np.all(ts == 0)

if all_no_data:
return
elif all_zero:
return
else:

dateList = []

if profileAnalytics:
for imgDate in dates:
dateList.append(imgDate)
else:
for imgDate in dates:
dateList.append(serial_date_to_string(imgDate))

date = np.array(dateList)

try:
if profileAnalytics:
x = date
Expand Down

0 comments on commit 60bc5b4

Please sign in to comment.