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 documentation and warnings before 0.1 release #502

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

rhugonnet
Copy link
Contributor

@rhugonnet rhugonnet commented Apr 8, 2024

Ongoing

TO-DO:

  • Add profile curvature and plan curvature formulas on "Terrain attributes" page,
  • Add BlockwiseCoreg to coregistration page,
  • Add "Cheatsheet" page,
  • Add link to PyTransform3d on Affine registration page,
  • Add "Ecosystem" page,
  • Add "Georeferencing intricacies" page,
  • Streamline "Coregistration" and "Bias correction" pages,
  • Detail .meta keys for users (and make the attribute public in a separate PR),
  • Add .info() method for CoregPipeline and BlockwiseCoreg,
  • Update reference for curvature: Update reference for curvature #577,
  • Update reference for TPI: Fix date in surface roughness reference #562,
  • Re-structure/streamline "Spatial statistics for error analysis" guide page,
  • Finalize "Uncertainty analysis" page, add warning that interface might change with Scikit-GStat now supporting directly sum of variogram models,
  • Streamline "Differencing and volume change" into a "Gap-filling" page and add warning that it might be moved to a different package,
  • Add reference attribute for each coregistration method?
  • Proof-read/streamline all gallery examples,
  • Prepare banner to communicate breaking changes with 0.1,
  • Check if figures in "Quick start" are fixed (normal colorbar, vector plotting on top),
  • Check if PROJ error still appears or not in the rendered documentation, fix it if yes,
  • Fix directional bias sinusoid example to always correct,
  • Add "read more" section at the end of each guide page?

Resolves #477 (last step)
Resolves #505
Resolves #464
Resolves #434
Resolves #285
Resolves #275
Resolves #431
Resolves #532
Resolves #528
Resolves #562
Resolves #577
Resolves #583

Copy link
Contributor

@erikmannerfelt erikmannerfelt left a comment

Choose a reason for hiding this comment

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

Wow, such an improvement to the documentation!! Super great job @rhugonnet!

I have some questions, generally pertaining to the non-documentation part of the PR (perhaps in the future changes like this could be a separate PR? :) )


### What are accuracy and precision?

[Accuracy and precision](https://en.wikipedia.org/wiki/Accuracy_and_precision) describe random and systematic errors, respectively.
Copy link
Contributor

Choose a reason for hiding this comment

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

Flip "random and systematic", as accuracy is systematic and precision is random.


### Translating these concepts for elevation data

However, elevation data rarely consists of a single independent measurement but of a **series of measurement** (image grid,
Copy link
Contributor

Choose a reason for hiding this comment

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

"series of measurements"

Accuracy is generally considered from two focus points:

- **Absolute elevation accuracy** describes systematic errors to the true positioning, usually important when analysis focuses on the exact location of topographic features at a specific epoch.
- **Relative elevation accuracy** describes systematic errors with reference to other elevation data that does not necessarily matches the true positioning, important for analyses interested in topographic change over time.
Copy link
Contributor

Choose a reason for hiding this comment

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

"does not necessarily match the true positioning"

@@ -25,8 +25,8 @@
# -- Project information -----------------------------------------------------

project = "xDEM"
copyright = "2021, Erik Mannerfelt, Romain Hugonnet, Amaury Dehecq and others"
author = "Erik Mannerfelt, Romain Hugonnet, Amaury Dehecq and others"
copyright = "2020, GlacioHack"
Copy link
Contributor

Choose a reason for hiding this comment

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

I see some packages leaving the original year while others keep it updated. Any ideas on implications of this?

(ecosystem)=

# Ecosystem

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe not here, but somewhere; should we refer to demcompare as that's still used quite much? Sorry if it already says somewhere.


Elevation data benefits from an uncommon asset, which is that **large proportions of planetary surface elevations
usually remain virtually unchanged through time**. Those static surfaces, sometimes also referred to as "stable terrain",
generally refer to bare-rock, grasslands, and are often isolated by excluding dynamic surfaces such as glaciers,
Copy link
Contributor

Choose a reason for hiding this comment

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

..., rivers, human settlements, lakes, ....

@@ -460,7 +460,7 @@ def __init__(
| Literal["norder_polynomial"]
| Literal["nfreq_sumsin"] = "norder_polynomial",
fit_optimizer: Callable[..., tuple[NDArrayf, Any]] = scipy.optimize.curve_fit,
bin_sizes: int | dict[str, int | Iterable[float]] = 100,
bin_sizes: int | dict[str, int | Iterable[float]] = 1000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this link to an issue? I'm sure it's a good update but it's a bit off topic!

@@ -2627,7 +2701,7 @@ def copy(self: CoregType) -> CoregType:
"""Return an identical copy of the class."""
new_coreg = self.__new__(type(self))

new_coreg.__dict__ = {key: copy.deepcopy(value) for key, value in self.__dict__.items() if key != "pipeline"}
new_coreg.__dict__ = {key: copy.copy(value) for key, value in self.__dict__.items() if key != "pipeline"}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this change do?

@@ -848,6 +788,34 @@ def to_matrix(self) -> NDArrayf:
"""Convert the transform to a 4x4 transformation matrix."""
return self._to_matrix_func()

def to_translations(self) -> tuple[float, float, float]:
"""
Convert the affine transformation matrix to only its X/Y/Z translations.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think something funky will happen here if scaling is involved (I don't remember which order the components are applied in). I feel like a warning should be added to this and the to_rotations() saying something like "Warning: Information may be lost".

And the conversion is less of a conversion and more of an extraction I would say! Since there's no validation that scaling won't mess with the result.

@@ -960,8 +960,7 @@ def test_blockwise_coreg_large_gaps(self) -> None:
ddem_post = (aligned - self.ref).data.compressed()
ddem_pre = (tba - self.ref).data.compressed()
assert abs(np.nanmedian(ddem_pre)) > abs(np.nanmedian(ddem_post))
# TODO: Figure out why STD here is larger since PR #530
# assert np.nanstd(ddem_pre) > np.nanstd(ddem_post)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is an identical assertion commented out here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment