Skip to content

Commit

Permalink
Added a check that LST correction will fail for images without a matc…
Browse files Browse the repository at this point in the history
…hing TOA image
  • Loading branch information
cgmorton committed May 7, 2024
1 parent 144c7c3 commit e204a57
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openet/core/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,12 @@ def test_landsat_c2_sr_lst_correct_values(image_id, xy, expected, uncorrected, t
assert corrected['lst'] is None
else:
assert abs(corrected['lst'] - expected) <= tol


def test_landsat_c2_sr_lst_correct_no_toa():
input_img = ee.Image('LANDSAT/LE07/C02/T1_L2/LE07_030026_20200628')
output_img = common.landsat_c2_sr_lst_correct(
input_img, input_img.multiply(0.0000275).add(-0.2).normalizedDifference(['SR_B4', 'SR_B3'])
)
with pytest.raises(Exception):
utils.point_coll_value(output_img, [-96.7, 48.9], scale=30)

0 comments on commit e204a57

Please sign in to comment.