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

Make coregistration metadata consistent and public #526

Merged
merged 7 commits into from
May 23, 2024

Conversation

rhugonnet
Copy link
Contributor

@rhugonnet rhugonnet commented May 23, 2024

This PR makes the .meta attribute a public property of Coreg, and makes the attribute names consistent.

In particular:

  • "offset_east_px" is now "shift_x", and is in georeferenced units (instead of pixels) which allows to remove the "resolution" key in the metadata,
  • "offset_north_px" is now "shift_y",
  • "vshift" is now "shift_z",
    Others are renamed to be consistent with BiasCorr.

Will be documented in #502!

Resolves #512

@rhugonnet rhugonnet requested a review from adehecq May 23, 2024 02:54
@rhugonnet
Copy link
Contributor Author

@adehecq @erikmannerfelt Just want to quickly check that you agree with the new names before merging. Also, are we sure about meta? Fine with me, but could use something else if you have ideas.

@rhugonnet
Copy link
Contributor Author

Merging to document in #502, can still make changes on your comments there before releasing

@rhugonnet rhugonnet merged commit c30dbec into GlacioHack:main May 23, 2024
13 checks passed
@rhugonnet rhugonnet deleted the public_coreg_meta branch May 23, 2024 21:08

Estimates a rigid transform (rotation translation) between two DEMs.
The transform is stored in the `self.meta` key "matrix", with rotation centered on the coordinates in the key
"centroid". The translation parameters are also stored individually in the keys "shift_x", "shift_y" and "shift_z"
Copy link
Member

Choose a reason for hiding this comment

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

But these may be misleading, if there is a rotation, no? Should there also be an item "rotation" in the meta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A rotation here is quite complex (3D) and already contained in the affine matrix. Maybe we can have a note pointing at pytransform3d that has routines to convert the affine matrix into its rotation/translation/scaling components? (it's really not trivial)
We could also include the components as rotation_x, rotation_y, rotation_z.
Or just do both!

Nuth and Kääb (2011) DEM coregistration: iterative registration of horizontal and vertical shift using slope/aspect.
Nuth and Kääb (2011) coregistration, https://doi.org/10.5194/tc-5-271-2011.

Estimate horizontal and vertical translations by iterative slope/aspect alignment.
Copy link
Member

Choose a reason for hiding this comment

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

I would write "Estimate horizontal translations iteratively using a relationship between elevation difference, slope and aspect".
Also one thing that we need to discuss/clarify. The Nuth & Kaab (2011) papers suggest to correct the vertical misalignment using the parameters of the sinusoid fit, which we don't. We use a median of the elevation difference. We should maybe add this to the description. And do we want to make the reduction function optional or we assume median is the best? The latter would be easier and is probably fine. But this means that there is no need to follow the NuthKaab method with a VerticalShift.

@adehecq
Copy link
Member

adehecq commented May 28, 2024

@adehecq @erikmannerfelt Just want to quickly check that you agree with the new names before merging. Also, are we sure about meta? Fine with me, but could use something else if you have ideas.

I'm fine with the names used. But before it was clear that the unit of offsets was pixels, because it was in the name, now it's not as clear. I'm wondering if we should have a description somewhere of the possible items in "meta". Would it make sense to have a panda's dataframe instead with a column containing the value and another containing a description?
I don't know if "meta" is the clearest name... By itself it means "beyond, above, transcending". Here I assume it was meant as a short name for metadata. I can't find a good alternative. We could use "params" but it is ambiguous with the parameters of the function. Or "results", but could be ambiguous with the coregistered DEM? Maybe "transformation", to indicate this is the applied transformation? I don't have a definite answer here sorry...

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.

Clarify which angle is needed for DirectionalBias
2 participants