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

Handle the case where complement has a GCS #74

Merged
merged 3 commits into from
Jul 5, 2023

Conversation

j9ac9k
Copy link
Collaborator

@j9ac9k j9ac9k commented Jun 9, 2023

When the compliment dataset has a global coordinate system, care must be taken to project that system into a PCS before registration can take place. This is largely due to codem being dependent on the resolution for the transformation matrix associated with the dataset (in a GCS the units are degrees, not meters/feet).

@j9ac9k j9ac9k force-pushed the local-crs-issue-ogi branch from 5bd630a to 58152fb Compare June 9, 2023 17:24
@j9ac9k j9ac9k force-pushed the local-crs-issue-ogi branch from 602278d to 8564d97 Compare June 9, 2023 22:21
@@ -134,6 +136,21 @@ def resolution(self, value: float) -> None:
self._resolution = value
return None

def _PCS_from_GCS(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a great name for this function. What you're doing here is computing a possible UTM zone in which to do your operations.

utm_crs_list = pyproj.database.query_utm_crs_info(
datum_name="WGS 84",
area_of_interest=pyproj.aoi.AreaOfInterest(
west_lon_degree=affine.c,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you passing c and f for both east/north south/west. Is that what you want? Shouldn't you be passing the bounds of the fnd_obj?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this case. This function is called when codem is trying to calculate the resolution for a given dataset. At this stage in the processing pipeline, the compliment and foundation have no knowledge of each other; which is why I call the CRS a best_guess_crs that is later overridden by the foundation CRS.

Given that this is the only time this function is called, the code should likely just be merged into the elif not data.crs.is_projected code-block, I'll make that change.

Given that this is only called in that step, this likely should not be a function, but that bit should be merged into

src/codem/preprocessing/preprocess.py Outdated Show resolved Hide resolved
src/codem/preprocessing/preprocess.py Show resolved Hide resolved
@j9ac9k j9ac9k merged commit d0473da into NCALM-UH:main Jul 5, 2023
@j9ac9k j9ac9k deleted the local-crs-issue-ogi branch July 5, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants