ts2vel: add --rm-timefun option for customized TS clean up#1355
Merged
yunjunz merged 6 commits intoinsarlab:mainfrom Jun 2, 2025
Merged
ts2vel: add --rm-timefun option for customized TS clean up#1355yunjunz merged 6 commits intoinsarlab:mainfrom
ts2vel: add --rm-timefun option for customized TS clean up#1355yunjunz merged 6 commits intoinsarlab:mainfrom
Conversation
+ add `timeseries2velocity.py --rm-timfun / --remove-time-functions` option to specify the time function components to be removed from the residual file, for customized TS clean up, like GNSS time series. + add timefun_names2ds_names() to translate the spcified time function names to the corresponding dataset names/index in the design matrix, to facilitate the customized TS clean up. + set default output vel/res filenames for --rm-timefun options + `.circleci/config.yml`: show total num of integration tests for more informative status
Contributor
Reviewer's GuideThis PR introduces a new Sequence Diagram for Residual Calculation with --rm-timefunsequenceDiagram
participant CLI as timeseries2velocity.py CLI
participant RTS2TF as run_timeseries2time_func
participant TFN2DSN as timefun_names2ds_names
CLI->>RTS2TF: invoke with parsed inputs (inps)
RTS2TF->>RTS2TF: Check inps.rm_timefuns
alt 'all' in inps.rm_timefuns
RTS2TF->>RTS2TF: Calculate ts_res = ts_data - np.dot(G, m) (all functions removed)
else Specific time functions provided
RTS2TF->>TFN2DSN: call timefun_names2ds_names(inps.rm_timefuns, ds_dict.keys())
TFN2DSN-->>RTS2TF: return rm_ds_names, rm_ds_inds (indices for specified functions)
RTS2TF->>RTS2TF: Calculate ts_res = ts_data - np.dot(G[:, rm_ds_inds], m[rm_ds_inds, :]) (specific functions removed)
end
RTS2TF->>RTS2TF: Write ts_res to inps.res_file
RTS2TF-->>CLI: Return output filepath
Class Diagram for Updated timeseries2velocity ModulesclassDiagram
class mintpy_timeseries2velocity {
<<Python Module: src/mintpy/timeseries2velocity.py>>
+run_timeseries2time_func(inps) : string
+timefun_names2ds_names(timefun_names, all_ds_names) : tuple
}
class mintpy_cli_timeseries2velocity {
<<Python Module: src/mintpy/cli/timeseries2velocity.py>>
+create_parser(subparsers) : ArgumentParser
+cmd_line_parse(iargs) : Namespace
}
mintpy_cli_timeseries2velocity ..> mintpy_timeseries2velocity : uses
%% mintpy_timeseries2velocity.run_timeseries2time_func calls mintpy_timeseries2velocity.timefun_names2ds_names
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @yunjunz - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
as suggested by sourcery-ai. Reference: https://docs.sourcery.ai/Coding-Assistant/Reference/Rules-and-In-Line-Suggestions/Python/Default-Rules/or-if-exp-identity/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of proposed changes
add
timeseries2velocity.py --rm-timfun / --remove-time-functionsoption to specify the time function components to be removed from the residual file, for customized TS clean up, like GNSS time series.add timefun_names2ds_names() to translate the spcified time function names to the corresponding dataset names/index in the design matrix, to facilitate the customized TS clean up.
set default output vel/res filenames for --rm-timefun options
.circleci/config.yml: show total num of integration tests for more informative statusReminders