def test_ra_daily_position(lat=s_args['lat'], doy=d_args['doy'], ra=d_args['ra_asce']): assert float(calcs._ra_daily( ee.Number(lat), ee.Number(doy)).getInfo()) == pytest.approx(ra)
def test_ra_daily_image(lat=s_args['lat'], doy=d_args['doy'], ra=d_args['ra_asce']): output = calcs._ra_daily(lat=ee.Image.constant(lat), doy=ee.Number(doy)) \ .reduceRegion(ee.Reducer.first(), geometry=constant_geom, scale=1) \ .getInfo() assert float(output['constant']) == pytest.approx(ra)
def test_ra_daily_refet(lat=s_args['lat'], doy=d_args['doy'], ra=d_args['ra']): assert float(calcs._ra_daily( lat=ee.Number(lat), doy=ee.Number(doy), method='refet').getInfo()) == pytest.approx(ra)