Skip to content

Coherence Change Detection using Coherence in IfgramStack.h5#37

Merged
yunjunz merged 11 commits intoinsarlab:mainfrom
mgovorcin:main
Mar 7, 2022
Merged

Coherence Change Detection using Coherence in IfgramStack.h5#37
yunjunz merged 11 commits intoinsarlab:mainfrom
mgovorcin:main

Conversation

@mgovorcin
Copy link
Contributor

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@yunjunz yunjunz self-requested a review February 18, 2022 01:58
@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:46Z
----------------------------------------------------------------

  1. I would recommend adding a date, after your name.
  2. For Stephenson et al. (2021), could you add the link to the published version?
  3. "References" maybe change this to "Relevant literature" instead, since this notebook is not the exact implementation of these papers? At least the "CCD refinement" part is different from https://github.com/aria-jpl/slcp2cod.

mgovorcin commented on 2022-02-24T05:08:14Z
----------------------------------------------------------------

Applied all comments, thanks @yunjunz

@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:47Z
----------------------------------------------------------------

Line #5.    import os, sys, numpy as np

please use single line import for each module, as below:

import os

import sys
import numpy as np



@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:48Z
----------------------------------------------------------------

Line #19.        mintpyObj.open()

This should be stackObj .


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:48Z
----------------------------------------------------------------

"mean" and "stack" in the variable name and labels seems a little bit complicated to me, could we move the averaging into getCoherence() and use pre_coherence and co_coherence instead?


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:49Z
----------------------------------------------------------------

Line #15.    ccd_histmatch = exposure.match_histograms(mco_cohStack, mpre_cohStack, multichannel=False)

Nice!


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:50Z
----------------------------------------------------------------

Could we merge this cell into the one above, to be consistent with the similar cells below?


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 18, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-18T02:45:51Z
----------------------------------------------------------------

Not a big deal: maybe you want to use a sequential colormap like magma ?

@yunjunz
Copy link
Member

yunjunz commented Feb 18, 2022

Thank you @mgovorcin, this is a very interesting notebook!

I left a couple of inline comments above.

Could you also add a link to this notebook in the README under "applications"?

@yunjunz yunjunz requested a review from hfattahi February 18, 2022 02:48
@yunjunz yunjunz changed the title Tutorial on Coherence Change Detection using Coherence Timeseries in IfgramStack.h5 Coherence Change Detection using Coherence in IfgramStack.h5 Feb 18, 2022
- applied Yunjun commits
- make the notebook shorter
Copy link
Contributor Author

Applied all comments, thanks @yunjunz


View entire conversation on ReviewNB

@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:12Z
----------------------------------------------------------------

Line #32.          mask          ::  float      - mask value, used to mask the CCD values below the defined value

I would recommend:

  1. using coherence_threshold and min_ccd_value for clarity.
  2. use mask argument to feed a 2D array in bool, e.g. from waterMask.h5 file to remove the edges in the final result.

@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:12Z
----------------------------------------------------------------

Line #125.            sys.exit()

It's better to use raise ValueError(f"un-recognized CCD method {method}!")


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:13Z
----------------------------------------------------------------

Line #156.                method = ''

How about limiting method string to difference, histogram_matching and ratio throughout all occurrences, so that we don't need to worry about translating / checking in the code?


yunjunz commented on 2022-03-01T01:09:35Z
----------------------------------------------------------------

I find the methods dict below unnecessary, could we use methods = ['difference', 'histogram_matching', 'ratio'] instead? This values are exposed to the users, thus, I prefer them to be clear without ambiguity, even though it might be longer.

    # methods
    methods = {
        'diff':'Difference',
        'hist':'Histogram Matching',
        'ratio':'Ratio',
    }

@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:14Z
----------------------------------------------------------------

Line #25.    co_coherence_data  =  []

Would suggest to use ccd_list,pre_coherence_list and co_coherence_list for clarity.


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:14Z
----------------------------------------------------------------

Could you add a short paragraph on the rationale of the "coherence thresholding"? It would help the reader to understand this part quickly?


@review-notebook-app
Copy link

review-notebook-app bot commented Feb 27, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-02-27T00:34:15Z
----------------------------------------------------------------

Line #15.    for mthd in enumerate(methods):

Use for i, method in enumerate(methods): , then method would be a pure string.


@yunjunz
Copy link
Member

yunjunz commented Feb 27, 2022

Thank you @mgovorcin for addressing my previous comments. The notebook looks much simpler and cleaner now, which is very nice!

I added a few more minor suggestions on the newer version, which I hope you could address without much effort.

Copy link
Member

yunjunz commented Mar 1, 2022

I find the methods dict below unnecessary, could we use methods = ['difference', 'histogram_matching', 'ratio'] instead? This values are exposed to the users, thus, I prefer them to be clear without ambiguity, even though it might be longer.

    # methods
    methods = {
        'diff':'Difference',
        'hist':'Histogram Matching',
        'ratio':'Ratio',
    }

View entire conversation on ReviewNB

change method option definition
from: 'diff', 'hist', 'ratio' to 'difference', histogram_matching', 'ratio'

make the code for plot function shorter and add option to flip axes if option orbit_direction used
Copy link
Contributor Author

@yunjun I addressed all new comments, thank you for suggesting them as they improve the notebook greatly.

@review-notebook-app
Copy link

review-notebook-app bot commented Mar 3, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-03-03T20:31:06Z
----------------------------------------------------------------

We are almost done here @mgovorcin. This ceill used to plot the initial CCD result without refinement, but not shown in this latest version. Shall we still plot it, or was it on purpose to remove it?


mgovorcin commented on 2022-03-07T18:06:39Z
----------------------------------------------------------------

there should be a plot, as I did not remove plotting of initial results. It seems that ReviewNB failed to generate the plot. I noticed that it started acting weird after the third PR

yunjunz commented on 2022-03-07T19:24:50Z
----------------------------------------------------------------

Right, the plot is shown in your forked repo: https://nbviewer.org/github/mgovorcin/MintPy-tutorial/blob/main/applications/coherence_change_detection.ipynb.

@review-notebook-app
Copy link

review-notebook-app bot commented Mar 3, 2022

View / edit / reply to this conversation on ReviewNB

yunjunz commented on 2022-03-03T20:31:07Z
----------------------------------------------------------------

Not a big deal at all: the shown plots is a little bit distracting, I don't see calling plot functions here. Why did it happens?


mgovorcin commented on 2022-03-07T18:11:38Z
----------------------------------------------------------------

I believe Jupyter notebook plots this image as an output of save_kmz.py. I added the line "%matplotlib notebook" before this line in the new version to prevent plotting .kmz file.

Copy link
Contributor Author

there should be a plot, as I did not remove plotting of initial results. It seems that ReviewNB failed to generate the plot. I noticed that it started acting weird after the third PR


View entire conversation on ReviewNB

Copy link
Contributor Author

I believe Jupyter notebook plots this image as an output of save_kmz.py. I added the line "%matplotlib notebook" before this line in the new version to prevent plotting .kmz file.


View entire conversation on ReviewNB

Little cleanup following PEP8 style and renaming of variables to fit snake_case style
Copy link
Member

yunjunz commented Mar 7, 2022

Right, the plot is shown in your forked repo: https://nbviewer.org/github/mgovorcin/MintPy-tutorial/blob/main/applications/coherence_change_detection.ipynb.


View entire conversation on ReviewNB

Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you @mgovorcin for this very cool notebook!

@yunjunz yunjunz merged commit 3215c2f into insarlab:main Mar 7, 2022
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