Skip to content

Commit

Permalink
Added nodata attribute to the cultivated data class
Browse files Browse the repository at this point in the history
  • Loading branch information
tebadi committed Nov 1, 2024
1 parent 596c64f commit b63950a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_lc_l4_ctv.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def image_groups(l34, urban, cultivated, woody, pv_pc_50):
"cultivated_class": xr.DataArray(
da.from_array(cultivated, chunks=(1, -1, -1)),
dims=("spec", "y", "x"),
attrs={"nodata": 255},
),
"woody_cover": xr.DataArray(
da.from_array(woody, chunks=(1, -1, -1)),
Expand Down Expand Up @@ -129,14 +130,16 @@ def test_ctv_classes_woody():

stats_l4 = StatsLccsLevel4()
level3 = lc_level3.lc_level3(xx)

lifeform = lc_lifeform.lifeform(xx)
veg_cover = l4_veg_cover.canopyco_veg_con(xx, stats_l4.veg_threshold)

l4_ctv = l4_cultivated.lc_l4_cultivated(
xx.classes_l3_l4, level3, lifeform, veg_cover
)
assert (l4_ctv.compute() == expected_cultivated_classes).all()

assert (l4_ctv.compute() == expected_cultivated_classes).all()


def test_ctv_classes_herbaceous():

Expand Down

0 comments on commit b63950a

Please sign in to comment.