diff --git a/openet/core/interpolate.py b/openet/core/interpolate.py index 2dbe844..cf55031 100644 --- a/openet/core/interpolate.py +++ b/openet/core/interpolate.py @@ -419,8 +419,7 @@ def from_scene_et_fraction( Notes ----- - This function currently assumes that "mask" and "time" bands already exist - in the scene collection. + This function assumes that "mask" and "time" bands are not in the scene collection. """ # Get interp_method @@ -584,59 +583,53 @@ def et_reference_adjust(input_img): if ('et_reference' in variables) and ('et_fraction' not in interp_vars): interp_vars.append('et_fraction') - # The time band is needed for interpolation - # (until interpolate_prep below is added) - interp_vars.append('time') - # TODO: Look into implementing et_fraction clamping here # (similar to et_actual below) - # ############ - # def interpolate_prep(img): - # """Prep WRS2 scene images for interpolation - # - # "Unscale" the images using the "scale_factor" property and convert to double. - # Add a mask and time band to each image in the scene_coll since - # interpolator is assuming time and mask bands exist. - # The interpolation could be modified to get the mask from the - # time band instead of setting it here. - # The time image must be the 0 UTC time - # - # """ - # mask_img = ( - # img.select(['et_fraction']).multiply(0).add(1).updateMask(1).uint8() - # .rename('mask') - # ) - # time_img = ( - # img.select(['et_fraction']).double().multiply(0) - # .add(utils.date_0utc(ee.Date(img.get('system:time_start'))).millis()) - # .rename('time') - # ) - # - # # Set the default scale factor to 1 if the image does not have the property - # scale_factor = ( - # ee.Dictionary({'scale_factor': img.get('scale_factor')}) - # .combine({'scale_factor': 1.0}, overwrite=False) - # ) - # - # return ( - # img.select(interp_vars) - # .double().multiply(ee.Number(scale_factor.get('scale_factor'))) - # .addBands([mask_img, time_img]) - # .set({ - # 'system:time_start': ee.Number(img.get('system:time_start')), - # 'image_id': ee.String(img.get('system:index')), - # }) - # ) - # - # # Filter scene collection to the interpolation range - # # This probably isn't needed since scene_coll was built to this range - # # Then add the time and mask bands needed for interpolation - # scene_coll = ee.ImageCollection( - # scene_coll.filterDate(interp_start_date, interp_end_date) - # .map(interpolate_prep) - # ) - # ############ + def interpolate_prep(img): + """Prep WRS2 scene images for interpolation + + "Unscale" the images using the "scale_factor" property and convert to double. + Add a mask and time band to each image in the scene_coll since + interpolator is assuming time and mask bands exist. + The interpolation could be modified to get the mask from the + time band instead of setting it here. + The time image must be the 0 UTC time + + """ + mask_img = ( + img.select(['et_fraction']).multiply(0).add(1).updateMask(1).uint8() + .rename(['mask']) + ) + time_img = ( + img.select(['et_fraction']).double().multiply(0) + .add(utils.date_0utc(ee.Date(img.get('system:time_start'))).millis()) + .rename(['time']) + ) + + # Set the default scale factor to 1 if the image does not have the property + scale_factor = ( + ee.Dictionary({'scale_factor': img.get('scale_factor')}) + .combine({'scale_factor': 1.0}, overwrite=False) + ) + + return ( + img.select(interp_vars) + .double().multiply(ee.Number(scale_factor.get('scale_factor'))) + .addBands([mask_img, time_img]) + .set({ + 'system:time_start': ee.Number(img.get('system:time_start')), + 'system:index': ee.String(img.get('system:index')), + }) + ) + + # Filter scene collection to the interpolation range + # This probably isn't needed since scene_coll was built to this range + # Then add the time and mask bands needed for interpolation + scene_coll = ee.ImageCollection( + scene_coll.filterDate(interp_start_date, interp_end_date) + .map(interpolate_prep) + ) # For count, compute the composite/mosaic image for the mask band only if 'count' in variables: @@ -656,18 +649,11 @@ def et_reference_adjust(input_img): .set({'system:time_start': ee.Date(start_date).millis()}) ) - # import pprint - # print('Prep Collection') - # pprint.pprint(scene_coll.select(['et_fraction']).getInfo()) - # pprint.pprint(scene_coll.select(['ndvi']).getInfo()) - # pprint.pprint(scene_coll.select(['time']).getInfo()) - # pprint.pprint(scene_coll.select(['mask']).getInfo()) - # print('DEADBEEF 3') - # Interpolate to a daily time step + # The time band is needed for interpolation daily_coll = daily( target_coll=daily_et_ref_coll, - source_coll=scene_coll.select(interp_vars), + source_coll=scene_coll.select(interp_vars + ['time']), interp_method=interp_method, interp_days=interp_days, use_joins=use_joins, @@ -864,6 +850,17 @@ def from_scene_et_actual( interp_source : str interp_band : str interp_resample : {'nearest', 'bilinear', 'bicubic'} + et_reference_source : str + Reference ET collection ID. + Must be set if computing reference ET or ET fraction. + et_reference_band : str + Reference ET band name. + Must be set if computing reference ET or ET fraction. + et_reference_factor : float, None, optional + Reference ET scaling factor. The default is 1.0 which is + equivalent to no scaling. + et_reference_resample : {'nearest', 'bilinear', 'bicubic', None}, optional + Reference ET resampling. The default is 'nearest'. et_fraction_min : float et_fraction_max : float use_joins : bool, optional @@ -872,8 +869,6 @@ def from_scene_et_actual( This parameter is passed through to interpolate.daily(). model_args : dict Parameters from the MODEL section of the INI file. - The reference source and other parameters will need to be set here if computing - reference ET or ET fraction. t_interval : {'daily', 'monthly', 'annual', 'custom'} Time interval over which to interpolate and aggregate values. The 'custom' interval will aggregate all days within the start and end @@ -889,8 +884,7 @@ def from_scene_et_actual( Notes ----- - This function currently assumes that "mask" and "time" bands already exist - in the scene collection. + This function assumes that "mask" and "time" bands are not in the scene collection. """ # Get interp_method @@ -1067,46 +1061,46 @@ def et_reference_adjust(input_img): .select([interp_args['interp_band']]) ) - # ############ - # def interpolate_prep(img): - # """Prep WRS2 scene images for interpolation - # - # "Unscale" the images using the "scale_factor" property and convert to double. - # Add a mask and time band to each image in the scene_coll since - # interpolator is assuming time and mask bands exist. - # The interpolation could be modified to get the mask from the - # time band instead of setting it here. - # The time image must be the 0 UTC time - # - # """ - # mask_img = ( - # img.select(['et']).multiply(0).add(1).updateMask(1).uint8() - # .rename('mask') - # ) - # time_img = ( - # img.select(['et']).double().multiply(0) - # .add(utils.date_0utc(ee.Date(img.get('system:time_start'))).millis()) - # .rename('time') - # ) - # - # # Set the default scale factor to 1 if the image does not have the property - # scale_factor = ( - # ee.Dictionary({'scale_factor': img.get('scale_factor')}) - # .combine({'scale_factor': 1.0}, overwrite=False) - # ) - # - # return ( - # img.select(['et']) - # .double().multiply(ee.Number(scale_factor.get('scale_factor'))) - # .addBands([mask_img, time_img]) - # .set({ - # 'system:time_start': ee.Number(img.get('system:time_start')), - # 'system:index': ee.String(img.get('system:index')), - # }) - # ) - # - # scene_coll = scene_coll.map(interpolate_prep) - # ########### + ############ + def interpolate_prep(img): + """Prep WRS2 scene images for interpolation + + "Unscale" the images using the "scale_factor" property and convert to double. + Add a mask and time band to each image in the scene_coll since + interpolator is assuming time and mask bands exist. + The interpolation could be modified to get the mask from the + time band instead of setting it here. + The time image must be the 0 UTC time + + """ + mask_img = ( + img.select(['et']).multiply(0).add(1).updateMask(1).uint8() + .rename('mask') + ) + time_img = ( + img.select(['et']).double().multiply(0) + .add(utils.date_0utc(ee.Date(img.get('system:time_start'))).millis()) + .rename('time') + ) + + # Set the default scale factor to 1 if the image does not have the property + scale_factor = ( + ee.Dictionary({'scale_factor': img.get('scale_factor')}) + .combine({'scale_factor': 1.0}, overwrite=False) + ) + + return ( + img.select(['et']) + .double().multiply(ee.Number(scale_factor.get('scale_factor'))) + .addBands([mask_img, time_img]) + .set({ + 'system:time_start': ee.Number(img.get('system:time_start')), + 'system:index': ee.String(img.get('system:index')), + }) + ) + + scene_coll = scene_coll.map(interpolate_prep) + ########### # For count, compute the composite/mosaic image for the mask band only if 'count' in variables: diff --git a/openet/core/tests/test_interpolate.py b/openet/core/tests/test_interpolate.py index 517f394..c6d0f6c 100644 --- a/openet/core/tests/test_interpolate.py +++ b/openet/core/tests/test_interpolate.py @@ -75,12 +75,12 @@ def scene_coll(variables, etf=[0.4, 0.4, 0.4], et=[5, 5, 5], ndvi=[0.6, 0.6, 0.6 ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044033_20170716') .select(['SR_B3']).double().multiply(0) ) - mask = img.add(1).updateMask(1).uint8() + # mask = img.add(1).updateMask(1).uint8() - # The "date" is used for the time band since it needs to be the 0 UTC time - date1 = ee.Number(ee.Date.fromYMD(2017, 7, 8).millis()) - date2 = ee.Number(ee.Date.fromYMD(2017, 7, 16).millis()) - date3 = ee.Number(ee.Date.fromYMD(2017, 7, 24).millis()) + # # The "date" is used for the time band since it needs to be the 0 UTC time + # date1 = ee.Number(ee.Date.fromYMD(2017, 7, 8).millis()) + # date2 = ee.Number(ee.Date.fromYMD(2017, 7, 16).millis()) + # date3 = ee.Number(ee.Date.fromYMD(2017, 7, 24).millis()) # The "time" is advanced to match the typical Landsat overpass time time1 = ee.Number(ee.Date.fromYMD(2017, 7, 8).advance(18, 'hours').millis()) @@ -90,32 +90,32 @@ def scene_coll(variables, etf=[0.4, 0.4, 0.4], et=[5, 5, 5], ndvi=[0.6, 0.6, 0.6 # TODO: Add code to convert et, et_fraction, and ndvi to lists if they # are set as a single value - # # Don't add mask or time band to scene collection - # # since they are now added in the interpolation calls - # scene_coll = ee.ImageCollection.fromImages([ - # ee.Image([img.add(etf[0]), img.add(et[0]), img.add(ndvi[0])]) - # .rename(['et_fraction', 'et', 'ndvi']) - # .set({'system:index': 'LE07_044033_20170708', 'system:time_start': time1}), - # ee.Image([img.add(etf[1]), img.add(et[1]), img.add(ndvi[1])]) - # .rename(['et_fraction', 'et', 'ndvi']) - # .set({'system:index': 'LC08_044033_20170716', 'system:time_start': time2}), - # ee.Image([img.add(etf[2]), img.add(et[2]), img.add(ndvi[2])]) - # .rename(['et_fraction', 'et', 'ndvi']) - # .set({'system:index': 'LE07_044033_20170724', 'system:time_start': time3}), - # ]) - # Mask and time bands currently get added on to the scene collection - # and images are unscaled just before interpolating in the export tool + # Don't add mask or time band to scene collection + # since they are now added in the interpolation calls scene_coll = ee.ImageCollection.fromImages([ - ee.Image([img.add(etf[0]), img.add(et[0]), img.add(ndvi[0]), img.add(date1), mask]) - .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + ee.Image([img.add(etf[0]), img.add(et[0]), img.add(ndvi[0])]) + .rename(['et_fraction', 'et', 'ndvi']) .set({'system:index': 'LE07_044033_20170708', 'system:time_start': time1}), - ee.Image([img.add(etf[1]), img.add(et[1]), img.add(ndvi[1]), img.add(date2), mask]) - .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + ee.Image([img.add(etf[1]), img.add(et[1]), img.add(ndvi[1])]) + .rename(['et_fraction', 'et', 'ndvi']) .set({'system:index': 'LC08_044033_20170716', 'system:time_start': time2}), - ee.Image([img.add(etf[2]), img.add(et[2]), img.add(ndvi[2]), img.add(date3), mask]) - .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + ee.Image([img.add(etf[2]), img.add(et[2]), img.add(ndvi[2])]) + .rename(['et_fraction', 'et', 'ndvi']) .set({'system:index': 'LE07_044033_20170724', 'system:time_start': time3}), ]) + # # Mask and time bands currently get added on to the scene collection + # # and images are unscaled just before interpolating in the export tool + # scene_coll = ee.ImageCollection.fromImages([ + # ee.Image([img.add(etf[0]), img.add(et[0]), img.add(ndvi[0]), img.add(date1), mask]) + # .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + # .set({'system:index': 'LE07_044033_20170708', 'system:time_start': time1}), + # ee.Image([img.add(etf[1]), img.add(et[1]), img.add(ndvi[1]), img.add(date2), mask]) + # .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + # .set({'system:index': 'LC08_044033_20170716', 'system:time_start': time2}), + # ee.Image([img.add(etf[2]), img.add(et[2]), img.add(ndvi[2]), img.add(date3), mask]) + # .rename(['et_fraction', 'et', 'ndvi', 'time', 'mask']) + # .set({'system:index': 'LE07_044033_20170724', 'system:time_start': time3}), + # ]) return scene_coll.select(variables) @@ -479,8 +479,7 @@ def test_aggregate_to_daily_date_filtering(): def test_from_scene_et_fraction_t_interval_daily_values_interpolated(tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi'], ndvi=[0.2, 0.4, 0.6]), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask'], ndvi=[0.2, 0.4, 0.6]), + scene_coll(['et_fraction', 'ndvi'], ndvi=[0.2, 0.4, 0.6]), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -516,8 +515,7 @@ def test_from_scene_et_fraction_t_interval_daily_values_interpolated(tol=0.0001) def test_from_scene_et_fraction_t_interval_daily_values_et_reference( et_reference_band, et_reference_date, et_reference, tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi'], ndvi=[0.2, 0.4, 0.6]), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask'], ndvi=[0.2, 0.4, 0.6]), + scene_coll(['et_fraction', 'ndvi'], ndvi=[0.2, 0.4, 0.6]), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -543,8 +541,7 @@ def test_from_scene_et_fraction_t_interval_daily_values_et_reference( def test_from_scene_et_fraction_t_interval_monthly_values( et_reference_band, et_reference, tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi']), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask']), + scene_coll(['et_fraction', 'ndvi']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -565,8 +562,7 @@ def test_from_scene_et_fraction_t_interval_monthly_values( def test_from_scene_et_fraction_t_interval_custom_values(tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi']), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask']), + scene_coll(['et_fraction', 'ndvi']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -587,8 +583,7 @@ def test_from_scene_et_fraction_t_interval_custom_values(tol=0.0001): def test_from_scene_et_fraction_t_interval_monthly_et_reference_factor(tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi']), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask']), + scene_coll(['et_fraction', 'ndvi']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -617,8 +612,7 @@ def test_from_scene_et_fraction_t_interval_monthly_et_reference_factor(tol=0.000 def test_from_scene_et_fraction_t_interval_monthly_et_reference_resample( et_reference_band, et_reference, tol=0.0001): output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi']), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask']), + scene_coll(['et_fraction', 'ndvi']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -642,8 +636,7 @@ def test_from_scene_et_fraction_t_interval_monthly_et_reference_resample( def test_from_scene_et_fraction_t_interval_monthly_interp_args_et_reference(tol=0.0001): # Check that the et_reference parameters can be set through the interp_args output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction', 'ndvi']), - scene_coll(['et_fraction', 'ndvi', 'time', 'mask']), + scene_coll(['et_fraction', 'ndvi']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'ndvi', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -665,8 +658,7 @@ def test_from_scene_et_fraction_t_interval_monthly_interp_args_et_reference(tol= def test_from_scene_et_actual_t_interval_daily_values_eto(tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -692,8 +684,7 @@ def test_from_scene_et_actual_t_interval_daily_values_eto(tol=0.0001): def test_from_scene_et_actual_t_interval_daily_values_etr(tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -727,8 +718,7 @@ def test_from_scene_et_actual_t_interval_daily_values_etr(tol=0.0001): def test_from_scene_et_actual_t_interval_monthly_values( et_reference_band, et_reference, et, tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -752,8 +742,7 @@ def test_from_scene_et_actual_t_interval_monthly_values( def test_from_scene_et_actual_t_interval_custom_values_monthly(tol=0.0001): # Check that the custom time interval and monthly time interval match output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -776,8 +765,7 @@ def test_from_scene_et_actual_t_interval_custom_values_monthly(tol=0.0001): def test_from_scene_et_actual_t_interval_monthly_et_reference_factor(tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -808,8 +796,7 @@ def test_from_scene_et_actual_t_interval_monthly_et_reference_factor(tol=0.0001) def test_from_scene_et_actual_t_interval_monthly_et_reference_resample( et_reference_band, et_reference, et, tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -832,8 +819,7 @@ def test_from_scene_et_actual_t_interval_monthly_et_reference_resample( def test_from_scene_et_actual_t_interval_monthly_interp_args_et_reference(tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -857,8 +843,7 @@ def test_from_scene_et_actual_t_interval_monthly_interp_args_et_reference(tol=0. def test_from_scene_et_actual_t_interval_daily_et_fraction_max(tol=0.0001): output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et'], et=[100, 100, 100]), - scene_coll(['et', 'time', 'mask'], et=[100, 100, 100]), + scene_coll(['et'], et=[100, 100, 100]), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -884,8 +869,7 @@ def test_from_scene_et_fraction_t_interval_bad_value(): # Function should raise a ValueError if t_interval is not supported with pytest.raises(ValueError): interpolate.from_scene_et_fraction( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et'], interp_args={'interp_method': 'linear', 'interp_days': 32}, model_args={'et_reference_source': 'IDAHO_EPSCOR/GRIDMET', @@ -899,8 +883,7 @@ def test_from_scene_et_fraction_t_interval_no_value(): # Function should raise an Exception if t_interval is not set with pytest.raises(TypeError): interpolate.from_scene_et_fraction( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'et_fraction', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32}, @@ -914,8 +897,7 @@ def test_from_scene_et_actual_t_interval_bad_value(): # Function should raise a ValueError if t_interval is not supported with pytest.raises(ValueError): interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et'], interp_args={'interp_method': 'linear', 'interp_days': 32, 'interp_source': 'IDAHO_EPSCOR/GRIDMET', @@ -931,8 +913,7 @@ def test_from_scene_et_actual_t_interval_no_value(): # Function should raise an Exception if t_interval is not set with pytest.raises(TypeError): interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et'], interp_args={'interp_method': 'linear', 'interp_days': 32, 'interp_source': 'IDAHO_EPSCOR/GRIDMET', @@ -947,8 +928,7 @@ def test_from_scene_et_actual_t_interval_no_value(): def test_from_scene_et_fraction_interp_args_use_joins_true(tol=0.01): # Check that the use_joins interp_args parameter works output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction']), - scene_coll(['et_fraction', 'time', 'mask']), + scene_coll(['et_fraction']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, 'use_joins': True}, @@ -968,8 +948,7 @@ def test_from_scene_et_fraction_interp_args_use_joins_true(tol=0.01): def test_from_scene_et_fraction_interp_args_use_joins_false(tol=0.01): # Check that the use_joins interp_args parameter works output_coll = interpolate.from_scene_et_fraction( - # scene_coll(['et_fraction']), - scene_coll(['et_fraction', 'time', 'mask']), + scene_coll(['et_fraction']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, 'use_joins': False}, @@ -989,8 +968,7 @@ def test_from_scene_et_fraction_interp_args_use_joins_false(tol=0.01): def test_from_scene_et_actual_interp_args_use_joins_true(tol=0.01): # Check that the use_joins interp_args parameter works output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, @@ -1012,8 +990,7 @@ def test_from_scene_et_actual_interp_args_use_joins_true(tol=0.01): def test_from_scene_et_actual_interp_args_use_joins_false(tol=0.01): # Check that the use_joins interp_args parameter works output_coll = interpolate.from_scene_et_actual( - # scene_coll(['et']), - scene_coll(['et', 'time', 'mask']), + scene_coll(['et']), start_date='2017-07-01', end_date='2017-08-01', variables=['et', 'et_reference', 'count'], interp_args={'interp_method': 'linear', 'interp_days': 32, diff --git a/pyproject.toml b/pyproject.toml index bcf0d52..e1f8d60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openet-core" -version = "0.4.3" +version = "0.5.0" authors = [ { name="Charles Morton", email="charles.morton@dri.edu" }, ]