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

integrate advanced time func with UQ into the routine workflow #795

Merged
merged 6 commits into from
Jun 17, 2022

Conversation

yunjunz
Copy link
Member

@yunjunz yunjunz commented Jun 17, 2022

Description of proposed changes

  • integrate the advanced time function fitting into smallbaselineApp.py via new template options:

    • mintpy.timeFunc.polynomial
    • mintpy.timeFunc.periodic
    • mintpy.timeFunc.step
    • mintpy.timeFunc.exp
    • mintpy.timeFunc.log
  • integrate the uncertainty quantification of time function parameters into smallbaselineApp.py via new template options:

    • mintpy.timeFunc.uncertaintyQuantification = residue / covariance / bootstrap
    • mintpy.timeFunc.timeSeriesCovFile
  • [BREAKING CHANGES] rename the previous mintpy.velocity.* options to mintpy.timeFunc.* for consistency with the above changes.

  • code refactoring on the following scripts to support these changes:

    • timeseries2velocity.py
    • utils.arg_group.py
    • load_data.py
    • ptime.py
    • utils.time_func.py
  • remove the following unused scripts to legacy dir:

    • ifgram_reconstruction.py
    • tropo_pyaps.py

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

yunjunz added 2 commits June 16, 2022 20:44
+ add the following two new template options into smallbaselineApp.cfg
   - mintpy.velocity.uncertaintyQuantification = residue / covariance / bootstrap, to replace the previous mintpy.velocity.bootstrap option
   - mintpy.velocity.timeSeriesCovFile with the default value of no

+ timeseries2velocity: re-use arg_group.add_reference_argument(plot=False) in timeseries2velocity.py

+ load_data: write S1A/B_date.txt file from SAFE_files.txt file if the latter exists in its default location (same level as reference folder)
+ integrate the advanced time func fitting into smallbaselineApp.py, via the following template options:
   - mintpy.timeFunc.polynomial
   - mintpy.timeFunc.periodic
   - mintpy.timeFunc.step
   - mintpy.timeFunc.exp
   - mintpy.timeFunc.log

+ rename the following options for consistency **[BREAKING CHANGES]**:
   - mintpy.velocity.excludeDate --> mintpy.timeFunc.excludeDate
   - mintpy.velocity.startDate --> mintpy.timeFunc.startDate
   - mintpy.velocity.endDate --> mintpy.timeFunc.endDate
   - mintpy.velocity.uncertaintyQuantifiction --> mintpy.timeFunc.uncertaintyQuantification
   - mintpy.velocity.timeSeriesCovFile --> mintpy.timeFunc.timeSeriesCovFile
   - mintpy.velocity.bootstrapCount --> mintpy.timeFunc.bootstrapCount

+ utils.time_func.py:
   - add MODEL_EXAMPLE as the single-sourced example for the time function model/configuration setup
   - add inps2model() to parse/convert the namespace "inps" object into time function dict "model" object
   - add get_num_param() to estimate the num of unknown parameters from a given model dict object

+ utils.readfile.read_template(): add "skip_chars" argument to skip certain characters in the template values, e.g. the commonly template typo from users "[" and "]". This is to simplify the read_template2inps() functions.
   - leverage the new read_template() in following scripts:
      - dem_error.py
      - geocode.py
      - modify_network.py
      - reference_point.py
      - timeseries2velocity.py
   - the insarmaps-related code is removed, and they are messy and they can and should be implemented separately in insarmaps repo if needed.

+ utils.ptime.py: add get_exclude_date_list() from previous ts2vel.py

+ utils.arg_group.py:
   - add_time_func_argument(): fix typo and better alignment for comments to improve the readability
   - adjust indentation throughout the script

+ timeseries2velocity: support time function inputs from template files
   - add time function inputs into the config keys to be saved in the h5 file
   - remove the comments on contributing authors, as they are visible in the git commit history
   - merge init_exp_log_dicts() and read_inps2model() into utils.time_func.inps2model()
   - refactor and move read_exclude_date() into utils.ptime.get_exclude_date_list()
   - read_template2inps(): support the new time function template options
   - model2hdf5_dataset(): modify the periodic/exp/log dataset names, to be more clear on the time unit

+ move ifgram_reconstrunction.py to /legacy since it's not frequently used at all

+ move tropo_pyaps.py to /legacy since it's unavailable anymore (due to the takedown of EarthDef and Python2) and not actively used.
@yunjunz yunjunz requested a review from yuankailiu June 17, 2022 03:58
@yunjunz
Copy link
Member Author

yunjunz commented Jun 17, 2022

@yuankailiu Could you please take a look at the changes, especially the ones related to the following, and let me know if you have any suggestions?

  • mintpy.timeFunc.* template options' naming
  • changes in timeseries2velocity.py

FYI, I have the ionosphere loading with on-the-fly resizing ready for another PR once this is merged. Cheers!

@yunjunz yunjunz changed the title integrate time func with UQ into the routine workflow integrate advanced time func with UQ into the routine workflow Jun 17, 2022
Copy link
Contributor

@yuankailiu yuankailiu left a comment

Choose a reason for hiding this comment

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

Hi @yunjunz, thank you for making these changes!
I have finished my review on the template file and the timeseries2velocity.py, and the time_func.py. I don't have other suggestions other than the comments I made inline. All look good to me right now.

mintpy/defaults/smallbaselineApp.cfg Outdated Show resolved Hide resolved
mintpy/defaults/smallbaselineApp.cfg Show resolved Hide resolved
@yunjunz yunjunz merged commit 8ed98c1 into insarlab:main Jun 17, 2022
@yunjunz yunjunz deleted the ts2vel branch June 17, 2022 20:29
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