Skip to content

Commit

Permalink
skip sample locations outside ROI
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Sep 1, 2023
1 parent 1c648a2 commit cd9159e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/area_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,22 +307,22 @@ def reference_sample_agree(
px, py = transform.rowcol(meta["transform"], lat, lon)

try:
ceo_agree_geom.loc[r, "Mapped class"] = int(binary_map[px, py])
if (
row[label_question].lower() == "cropland"
or row[label_question].lower() == "crop"
or row[label_question].lower() == "planted"
):
ceo_agree_geom.loc[r, "Reference label"] = 1
elif (
row[label_question].lower() == "non-cropland"
or row[label_question].lower() == "non-crop"
or row[label_question].lower() == "not planted"
):
ceo_agree_geom.loc[r, "Reference label"] = 0
ceo_agree_geom.loc[r, "Mapped class"] = int(binary_map[px, py])
if (
row[label_question].lower() == "cropland"
or row[label_question].lower() == "crop"
or row[label_question].lower() == "planted"
):
ceo_agree_geom.loc[r, "Reference label"] = 1
elif (
row[label_question].lower() == "non-cropland"
or row[label_question].lower() == "non-crop"
or row[label_question].lower() == "not planted"
):
ceo_agree_geom.loc[r, "Reference label"] = 0
except:
ceo_agree_geom.loc[r, "Mapped class"] = 255
ceo_agree_geom.loc[r, "Reference label"] = 0
ceo_agree_geom.loc[r, "Mapped class"] = 255
ceo_agree_geom.loc[r, "Reference label"] = 0

return ceo_agree_geom

Expand Down

0 comments on commit cd9159e

Please sign in to comment.