Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update preview_available_images to use the cloud_thresh in the user's settings #275

Closed
2320sharon opened this issue Jul 18, 2024 · 1 comment

Comments

@2320sharon
Copy link
Collaborator

Update the code max_cloud_cover=95 to be max_cloud_cover=self.settings['cloud_thresh']

       for roi_id in tqdm(selected_ids, desc="Processing", leave=False):
            polygon = common.get_roi_polygon(self.rois.gdf, roi_id)
            if polygon is None:
                raise Exception(f"ROI ID {roi_id} not found in the ROIs GeoDataFrame")
            if polygon:
                # only get the imagery in tier 1
                images_count = count_images_in_ee_collection(
                    polygon,
                    start_date,
                    end_date,
                    satellites=set(self.settings["sat_list"]),
                    max_cloud_cover=95,
                    tiers=[1],
                    months_list=months_list,
                )
                satellite_messages = [f"\nROI ID: {roi_id}"]
                for sat in self.settings["sat_list"]:
                    satellite_messages.append(f"{sat}: {images_count[sat]} images")

                print("\n".join(satellite_messages))

Solution

                max_cloud_cover = self.settings.get("cloud_thresh", 95)
                # convert the max cloud cover to a percentage if it is a fraction
                if max_cloud_cover<1 and max_cloud_cover >=0:
                    max_cloud_cover = max_cloud_cover * 100
                # only get the imagery in tier 1
                images_count = count_images_in_ee_collection(
                    polygon,
                    start_date,
                    end_date,
                    satellites=set(self.settings["sat_list"]),
                    max_cloud_cover=max_cloud_cover,
                    tiers=[1],
                    months_list=months_list,
                )

@2320sharon 2320sharon changed the title Update preview_available_images to uses the max cloud cover in the user's settings Update preview_available_images to use the cloud_thresh in the user's settings Jul 18, 2024
@2320sharon
Copy link
Collaborator Author

I just realized why we don't do this. The cloud thresh controls the cloud cover in the individual image, which is not the same as the max cloud cover property in GEE that is the cloud cover for the entire scene beyond just the ROI. This will not work.

@2320sharon 2320sharon closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2024
2320sharon added a commit that referenced this issue Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant