network.coherence_matrix(): bugfix for sorting dates before 2000#1385
network.coherence_matrix(): bugfix for sorting dates before 2000#1385yunjunz merged 2 commits intoinsarlab:mainfrom
network.coherence_matrix(): bugfix for sorting dates before 2000#1385Conversation
|
💖 Thanks for opening this pull request! Please check out our contributing guidelines. 💖 |
Reviewer's GuideReplaced two-digit year parsers with four-digit year equivalents and updated date string splitting to underscore-based format in the coherence_matrix function to correctly sort and index pre-2000 dates while preserving existing behavior. Class diagram for updated date handling in coherence_matrix functionclassDiagram
class ptime {
+yyyymmdd_date12(date12_list)
+yyyymmdd(date_list)
-yymmdd_date12(date12_list) // replaced
-yymmdd(date_list) // replaced
}
class network {
+coherence_matrix(date12_list, coh_list, diag_value, fill_triangle)
}
network ..> ptime : uses
direction LR
Flow diagram for updated date parsing in coherence_matrixflowchart TD
A[Input date12_list with date pairs] --> B[Convert date12_list using ptime.yyyymmdd_date12]
B --> C[Split date pairs by underscore]
C --> D[Combine and sort unique dates]
D --> E[Convert date_list using ptime.yyyymmdd]
E --> F[Build coherence matrix using new indices]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @esrivas17 - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
yunjunz
left a comment
There was a problem hiding this comment.
LGTM. Thank you @esrivas17 for finding the issue and the PR!
network.coherence_matrix(): bugfix for sorting dates before 2000
|
🎉 🎉 🎉 Congrats on merging your first pull request! We here at behaviorbot are proud of you! 🎉 🎉 🎉 |
I am trying to use Mintpy to process data coming from GMTSAR for ERS (time span 1993-2010) and I noticed that the coherence matrix is not calculated correctly for dates coming before 2000, given that the coherence matrix function uses the ptime.yymmdd function taking the last values of the year for each day, and it works for images after 2000 but not if the time span cover images from the 90's, (once it sorts the dates, the 99, 98 images from 1999, 1998 will be put last with the highest indexes)
I am proposing these changes that can fix the problem for these dates and keep the functionality for more recent times spans (after 2000/ Sentinel1 time coverage)
I am changing the coherence matrix function that only returns the coherence matrix, so I believe it should not affect any other functionality.
Here is an example of a wrong coherence matrix for my ERS (1995-2010) time span data
And this is the actual network: