Skip to content

Commit

Permalink
Removing old and/or commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
cgmorton committed Feb 12, 2025
1 parent c1f4274 commit c7fc92f
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 603 deletions.
5 changes: 0 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ Contributing to OpenET

Thank you for your interest in supporting the OpenET project.

Versioning
==========

The OpenET project is currently in Beta and the version numbers will be "0.0.X" until a non-Beta release is made.

Coding Conventions
==================

Expand Down
117 changes: 0 additions & 117 deletions openet/core/api.py

This file was deleted.

17 changes: 2 additions & 15 deletions openet/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def landsat_c2_sr_cloud_mask(
filter_flag=False,
saturated_flag=False,
sr_cloud_qa_flag=False,
# cloud_confidence=3,
):
):
"""Compute cloud mask for a Landsat Coll. 2 Level 2 (SR) image using multiple approaches
Parameters
Expand Down Expand Up @@ -213,10 +212,7 @@ def landsat_c2_sr_lst_correct(sr_image, ndvi):
image_geom = sr_image.geometry()
image_extent = image_geom.bounds(1, 'EPSG:4326')

# # Simple clip extent from image geometry bounds
# clip_extent = image_geom.bounds(1, 'EPSG:4326')

# # Server side approach for getting image extent snapped to the ASTER GED grid
# Server side approach for getting image extent snapped to the ASTER GED grid
buffer_cells = 1
cellsize = 0.1
image_xy = ee.Array(image_extent.coordinates().get(0)).transpose().toList()
Expand All @@ -230,13 +226,7 @@ def landsat_c2_sr_lst_correct(sr_image, ndvi):
ymax = ymax.divide(cellsize * buffer_cells).ceil().multiply(cellsize * buffer_cells)
clip_extent = ee.Geometry.Rectangle([xmin, ymin, xmax, ymax], 'EPSG:4326', False)

# Landsat image projection for resample/reproject (
# image_proj = sr_image.projection()
# image_crs = image_proj.crs()
# image_geo = ee.List(ee.Dictionary(ee.Algorithms.Describe(image_proj)).get('transform'))

# Aster Global Emissivity Dataset

ged = ee.Image('NASA/ASTER_GED/AG100_003').clip(clip_extent)

veg_emis = 0.99
Expand Down Expand Up @@ -276,7 +266,6 @@ def get_matched_c2_t1_image(input_img):
ee.String(scene_id.get(0)).cat('_').cat(ee.String(scene_id.get(2)))
.cat('_').cat(ee.String(scene_id.get(3)))
)
# scene_id = ee.String(input_img.get('system:index'))

# Testing if it is any faster to filter each collection separately
# TODO: Test if adding an extra .filterDate() call helps
Expand Down Expand Up @@ -304,7 +293,6 @@ def get_matched_c2_t1_radiance_image(input_img):
ee.String(scene_id.get(0)).cat('_').cat(ee.String(scene_id.get(2)))
.cat('_').cat(ee.String(scene_id.get(3)))
)
# scene_id = ee.String(input_img.get('system:index'))

# TODO: Fix error when images that are in the T1_L2 collections but not in the T1,
# will fail with a .get() error because matched_img is 'None',
Expand Down Expand Up @@ -433,5 +421,4 @@ def get_matched_c2_t1_radiance_image(input_img):
.divide(Rc).add(1.0).log().pow(-1)
.multiply(ee.Number(k2.get(spacecraft_id)))
.rename('lst')
# .set({'system:time_start': sr_image.get('system:time_start')})
)
18 changes: 0 additions & 18 deletions openet/core/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ def mad(ensemble_img, made_scale=2):
# Map the band names to the model index
# The extra combine is to try and account for the ensemble images having
# band names that don't map to one of the model names/indexes
# band_dict = ee.Dictionary(model_index)
band_dict = ee.Dictionary(model_index).combine(ee.Dictionary.fromLists(
output_bands, ee.List.sequence(9, model_count.add(9).subtract(1))))
band_index = model_names.map(lambda x: band_dict.get(x))
# band_index = ee.List.sequence(1, model_count)

# Bit encode the models using the model index values
# Build the index array from the ensemble images so that the index
Expand All @@ -110,22 +108,6 @@ def mad(ensemble_img, made_scale=2):

return output_img

# DEADBEEF
# print(utils.point_image_value(ee.Image(images), [-120, 39], scale=1))
# print(utils.point_image_value(ens_median, [-120, 39], scale=1))
# print(utils.point_image_value(MADe, [-120, 39], scale=1))
# print(utils.point_image_value(upper, [-120, 39], scale=1))
# print(utils.point_image_value(lower, [-120, 39], scale=1))
# print(utils.point_image_value(count_img, [-120, 39], scale=1))
# print(utils.point_image_value(sort_img, [-120, 39], scale=1))
# print(utils.point_image_value(model_drop_mean, [-120, 39], scale=1))

# # Add mean, ens_median, made, upper and lower to ensemble for map display
# ens_mean = ensemble_img.reduce(ee.Reducer.mean()).rename(["mean"])
# ensemble = ensemble_sims_crop.addBands(ens_mean).addBands(ens_median)
# .addBands(MADe).addBands(upper).addBands(lower)
# .addBands(model_drop_mean)


def mean(ensemble_img):
"""Simple arithmetic mean placeholder function
Expand Down
Loading

0 comments on commit c7fc92f

Please sign in to comment.