Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mirzaees
Copy link
Owner

Description of proposed changes

Reminders

  • Fix #xxxx
  • 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.

olliestephenson and others added 30 commits March 17, 2022 22:44
Currently `image_stitch.py` can't correctly merge mask files. It puts the merged arrays into an array initialized as `np.nan`. Nans evaluates to `True`, meaning that we are left with blocks outside the data region that are set to `True`. 

+ Adding a simple check to see if we're merging non-float arrays, then set the default values of `fill_value` to `0` instead of `np.nan` fixes the issue.

+ use vprint() to shorten the print() if check
+ utils.time_func.get_design_matrix4time_func(): resolves a bug that creates design matrices with columns of zeros, when the polynomial order is zero.
+ utils.readfile.read_snap_dim(): bugfix on WAVELENGTH unit

+ asc_desc2horz_vert: pass angles in deg instead of rad

+ utils.plot.auto_adjust_xaxis_date(): fix a bug introduced in #734

+ local_oscilator_drift.get_relative_range_distance(): typo fix

+ docs/README: update aux links in Yunjun et al. (2019)
+ asc_desc2horz_vert.py:
   - use a window-by-window strategy to speedup the pixel-wised inversion
   - add get_design_matrix4east_north_up() for future 3D decomposition
   - bug fix for --oo option during file writing

+ gps.GPS.read_displacement(): add self.date_list member variable, for easy use

+ stack.timeseries: remove get_design_matrix4time_func, as it's not used anywhere in mintpy anymore, to avoid circular imports
+ coord.geo2radar(): support file longitude exceeding 180 in both end, e.g. the GIM IONEX file

+ plot.auto_multilook_num(): turn OFF multilooking for small spatial size, even if the over size is large due to the large time dimension, to speed up the reading. Otherwise, it will do the epoch-by-epoch reading with indexing, which is slow.

+ tsview: for very long TS (> 1000 acquisitions), do not print out displacement TS in the terminal, reduce the default marker size by 10X.
+ add simulation/iono.py sub-module:
   - add iono mapping functions from Yunjun et al. (2022)
   - add JPL high resolution GIM I/O
   - add GIS low resolution GIM downloading, I/O and plotting

+ add iono_tec.py for high level usage
   - auto download IGS TEC files, similar to tropo_pyaps3.py
   - call simulation/iono.py to read and calculate iono ramps

+ add data/top_tec_perc_s1.py from Yunjun et al.. (2022)

+ update docs accordingly
   - docs/api/module_hierarchy.md: add simulation/iono
   - setup.py: add entry point for iono_tec.py
add --suffix option to allow for suffix in the filename.
…values

+ utils/plot.auto_adjust_colormap_lut_and_disp_limit(): add unique_values as the 3rd return arg & update its usage in save_kmz.py, view.py and tsview.py
+ utils/plot.plot_colorbar(): use unique_values to set tick locations if they are <=5
+ utils/plot.read.gmt_lonlat_file(): ignore comment lines
+ utils/utils.read_timeseries_yx(): bugfix for dis_std unit conversion
+ objects/sensor: add a few paramters for the GaoFen-3 sensor
+ objects/gps.get_gps_los_obs(): bugfix when input site_names are not consistent with CSV file
+ add Yunjun et al. (2022) with DOI to the following files:
   - defaults/smallbaselineApp.cfg: SET option
   - iono_tec.py
   - solid_earth_tides.py
   - simulation/iono.py
+ replace fig.canvas.draw() with "fig.canvas.draw_idle()" and "fig.canvas.flush_events()", as recommended by matplotlib (https://matplotlib.org/stable/users/explain/interactive_guide.html). This fixed the non-resposive point TS plot, with the latest version of matplotlib version 3..5.1. It's unknown since which version of matplotlib that this behavior change started to happen. Involved scripts are:
   - tsview.py
   - plot_transection.py
   - plot_coherence_matrix.py

+ tsview: update bar() plot in the slider, to make sure the vertical lines are within the slider extent

+ utils.plot: add add_arrow() from stack overflow

+ plot_transection: plot the profile location as dashed arrow instead of dashed line, to indicate the profile direction, via plot.add_arrow().
+ tsview: switch to a new look of "slider" in tsview.py. The main changes are:

1. use a narrower slider on the Y-axis, for a more compact looking.

2. The slider is solely based on image number, instead of time, to be agnostic against TS files with different time gaps.

3. Plot the reference date as a "gray" dot on the slider, to be more visible.

4. use subplot() with tight_layout() to better scale the subplots

+ utils.ptime: add get_compact_isoformat()
+ tsview.py: bugfix for cartopy feature while initializing projection

+ timeseries2velocity.read_inps2model(): add print_msg

+ objects/sensor.SEN: fix antenna and PRF parameters

+ smallbaselineApp.py:_read_template(): align the print out "copy for backup" msg
…768)

+ utils.utils1.update_template_file():
   - add "[]()" to the special symbol interpretation list while searching for template option values.
   - use "value2search" for "re.findall()" expression, without changing original value variable, for more robust replace() operation.
)

+ objects.gps.search_gps(): fix a bug that `site_list_file` will not be downloaded when the user specifies the path to it, and pass `site_list_file` to `dload_site_list()`.
* mv requirements.txt to root dir for a shorter path

+ move requirements.txt from ./docs to ./ dir for a shorter path; update path in installations.md and circleci/config.yml

+ utils.utils1.update_template_file(): handle value2seach inside if check, to avoid unnecessary running

* view: add --coastline-lw / --lalo-off / --lalo-fs

+ view: add 3 new options to customize plotting in geo-coordinates:
   - coastline-linewidth
   - lalo-offset
   - lalo-fontsize

+ asc_desc2horz_vert:
   - bugfix on the printout msg during REF_LAT/LON checking
   - bugfix on the output metadata in one output HDF5 fil

+ readfile: GDAL related metadata
   - DATA_TYPE_GDAL2NUMPY/NUMPY2GDAL: add cint16/32 for translation purpose
   - add ".tiff" to GDAL_FILE_EXTS
* Fix spelling errors and typos in different files (mostly online help messages of the CLI).

* Remove the unused `--no-parallel` opt for `subset/prep_roipac.py`

Co-authored-by: Zhang Yunjun <[email protected]>
+ plot_transection.py: fix the "IndexError: index 2 is out of bounds for axis 0 with size 2" due to utils/plot.add_arrow()

+ utils/plot.plot_colorbar(): use len(unique_values) instead of cmap_lut while checking for discrete colorbar ticks

+ view: rm the useless plt.subplots(num), as it shows up in notebooks with %matplotlib widget

+ iono_tec: printout CENTER_LINE_UTC and local solar time

+ diff.check_reference(): simple refactor and bugfix when file1 is absolute w/o REF_DATE.

+ docs/installation: minor comment simplification
+ move shell scripts from `mintpy/sh` to `script`.

+ update setup.py as the shell scripts are no longer installed

* update README.md for the link of the example shell script usage.
+ view: support --ref-lalo out of subset extent for 2D matrix input, similar to the existing support for 3D matrix

+ minor comments update in scripts below:
   - asc_desc2horz_vert.py
   - prep_fringe.py
   - objects/sensor: notes on az*_pix*_size for S1
+ save_kmz(_timeseries).py:
   - use inps.cmap_name for the str and inps.colormap for the mpl colormap object to better book keeping
   - more organized comments

+ save_kmz.py: bugfix for the placemark KMZ file when cbar is not shown after moving the file location

+ save_kmz_timseries.py:  support custom non-mpl colormaps, similar to view/tsview.py
+ add s1ab_range_bias.py to calculate and correct for the S1A/B range bias in the range offset time series, as in Yunjun et al. (2022).
   - use --action to swith between compute / correct, to be able to compute from an TS file, and correct for it from another TS file.
   - add --save/nodisplay optiton, and remove --plot option, so that it works in the same way as plot_network.py

+ safe_list_file2sensor_list(): mv from isce_utils to s1_utils

+ update yunjun et al. (2022) bio info in relevant scripts: title syntax and vol num
+ load ionosphere stack from isce2/topsStack via `load_data.py --ion`
   - add the following new template options for iono file paths to smallbaselineApp.cfg
      - mintpy.load.ionUnwFile
      - mintpy.load.ionCorFile
      - mintpy.load.ionConnCompFile
   - add the mintpy.load.ion*File to auto_path.py to support mintpy.load.autoPath = True
   - split datasetName2templateKey into 4 dict objects, to help to distinguish between regular stack and ion stack, while setting the correct template key
   - add `load_data.py --geom` to load only the geometry files
   - set --ion / geom as mutually exclusive arg for more robust user typo checking
   - add Parameters/Returns comments for most functions
   - rename update_object() to run_or_skip() for consistency and a more intuitive name
   - run_or_skip(): add the checking of dataset list between in/out stack file/obj

+ ifgram_inversion.py: set default output file name based on ionStack.h5 filename

+ stackDict.ifgramStackDict: add get_dataset_list()

+ plot_network: auto handle ionStack.h5 and non-interruptive handle of no dataset found.

+ utils/ptime.py and prep_isce.py: add get_date12_from_path() to simplify code

+ utils/readfile: add .ion file ext to read_binary_file() and get_slice_list()

+ remove the obsolete `ionoPhase` related code and comments in the following files:
   - docs/api/data_structure.md
   - objects/stack.py
   - objects/stackDict.py

Co-authored-by: Zhang Yunjun <[email protected]>
+ ifgram_inversion.py: adjust the default stack quality file for ionStack, add size checking before using it for masking

+ load_data.run_or_skip(): bugfix for the in/out_size comparison, as suggested by @olliestephenson.

+ cluster.DaskCluster.close(): reverse client/cluster.close() order to better avoid the CancelledError.

+ multilook: replace average with mean

+ utils.plot.auto_fig_title(): add extra suffix for ionStack.h5
+ move draw_lalo_label() and draw_scalebar() from mintpy.utils.plot.py into a new sub-module mintpy.utils.map.py, for more independence.

+ refactor mintpy.utils.map.py

+ mv read_gmt_lonlat_file() from plot.py into readfile.py

+ remove unused plot.cmd_line_parse()

+ update module_hierarchiy accordingly.

+ mv constants from utils to objects
+ add mintpy.objects.ionex sub-module to handle all the IONEX file download/reading
   - add ionex.py based on daniestevez notebook, to simplify the IONEX file reading
   - move the following functions from mintpy.simulation.iono, to be more independent:
       - dload_ionex()
       - get_ionex_value()
       - get_ionex_filename()
       - get_ionex_date()
       - get_ionex_height()
       - plot_ionex()
   - simulation.iono.py: remove the obsolete read_ionex_tec()

+ add unit test for objects/ionext.py:
   - add tests/objects/ionex.py
   - add tests/data/jplg3190.15i
   - update .circleci/config.yml

+ update simulation.iono.py and iono_tec.py accordingly

+ update docs:
   - add ionex to docs/api/module_hierarchy.md
   - update .gitignore against the latest github example for python
* ts2vel: add uncertaintyQuantification & timeSeriesCovFile option

+ 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)

* ts2vel: add timeFunc.* options to smallbaselineApp.cfg

+ 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.
+ utils.isce_utils.extract_geometry_metadata():
   - extract LENGTH & WIDTH, as reference for the A/RLOOKS
   - update attribute if box is not None
   - simplify its usage in prep_fringe.py

+ prep_isce.py: simplify and support multiple obs files w/ different resolutions
   - prepare_stack(): update A/R/NCORRLOOKS & AZ/RG_PIXEL_SIZE if the input obs file has a different size than the stack.rsc file, to better reflect the truth, e.g. for low-resolution iono file. 
   - Note that LENGTH/WIDTH/Y/X_FIRST/STEP is already extracted from the obs file, thus, no need for checking or updating to reflect the truth.
   - replace the combination of `-f/-d` with the single `-f` option for a simpler and more robust logic to grab all data files in a given path pattern.

+ objects.stackDict.py:
   - ifgramStackDict.get_size(): add geom_obj arg to be able to use the size from the reference geometry file, for the low-resolution ion file, needed for run_or_skip() checking in load_data.py
   - ifgramStackDict.write2hdf5(): add geom_obj arg, to auto detect the low-reso ion file, for resizing on the fly
   - ifgramDict.read(): add resize2shape arg to resize on the fly using skimage.transform.resize(), and make it compatible with the exiting subset and resampling options.

+ load_data.py: support multiple stack files loading in one command line, which is more flexible and simpler
   - remove the obsolete --ion option, as it's not needed anymore
   - remove the rarely used --output options, and use the hardwired values in the code, for simplification
   - code refactoring
   - update to the latest usage of prep_isce.py, to support loading regular and ion interferograms at the same command line call
   - use a for loop to load the following multiple stack HDF5 files:
       - ifgramStack.h5
       - ionStack.h5
       - offsetStack.h5

+ diff.py: light refactoring
bbuzzanga and others added 29 commits July 27, 2022 15:57
…821)

return empty/None in `main()` for all executable scripts, to avoid the conflict with having error code "0" for normal completion.

Co-authored-by: Zhang Yunjun <[email protected]>
+ `timeseries2velocity.py --periodic`: use `atan2()`, instead of `atan()`, to account for the 4 quadrant outcome of the arc tangent operation, while calculating the phase component of the periodic signals.

+ `prep_hyp3.py`: fix bug of `ORBIT_DIRECTION`.

+ `reference_point.py inputs/ifgramStack.h5 --write-data`: skip pixels with no-data-value (zero) while updating the `unwrapPhase` matrix.

+ `README.md` and `setup.py`: switch MintPy license from `GPLv3` to `GPLv3+`.
+ add `__main__.py` for the initial implementation of the single-entrypoint script
   - add sub-parser grabbing functions `get_*_parser()` for all executable scripts
   - add `_autocomplete()`
   - add the main parser function `get_parser()` with groupped calls for sub-parsers
   - add `main()` with proper logging info and exit code

+ `utils.arg_utils.py`:
   - rename from  `arg_group.py` to `arg_utils.py`
   - add `create_argument_parser()` to create parser with or without sub-parsers
   - call `create_argument_parser()` from all executable scripts in `mintpy` folder.

+ `setup.py`: add the following optional requirements:
   - argcomplete
   - platemotion and astropy

+ `timeseries2velocity.py`: rename `inps.step` to `inps.stepDate` to avoid weird initiation bug in sub-command mode.

Co-authored-by: Zhang Yunjun <[email protected]>
+ version: add release tag for v1.4.0

+ bulk_plate_motion: add ITRF2014_PMM global var for convenience and future options with PMM model name and plate name, instead of typing detailed values manually.

+ geocode.py: add checking for the imcompatible options between "--geo2radar" and "--bbox / --software scipy"

+ subset: replace try/except with if/else for more robustness

+ arg_group: add --title / --fig-title for --figtitle option as alternatives
+ remove "openmp" from all the dependency files, as "conda install pyresample" will install openmp correctly (llvm-openmp for linux, libgomp for linux; https://conda-forge.org/docs/maintainer/knowledge_base.html#openmp)

+ version.py: remove the prefix "v" from the version number, to be consistent with styles from gdal/numpy

+ smallbaselineApp.generate_temporal_coherence_mask(): run plot_result() to populate pic folder before raising errors, to facilitate the trouble shooting

+ reference_point: support more flexible mask dataset name in the mask h5 file.
…o_path` (#826)

+ load_data.py: bugfix when empty file path found, introduced in load iono stack PR 780, due to the additional new iono file path defined in defaults/auto_path.py.
+ version: replace version_num with version for easy re-use, and update its usage in __inti__.py

+ setup: use sys.path.append() to replace open() to grab version from version.py

+ add .github/workflows/publish-to-test-pypi.yml:
   - triggered for push event on insarlab/main branch
   - use "pip install" and "python -m build" to build the binary wheel and source tarball
   - use pypa/gh-action-pypi-publish action to push to PyPI and TestPyPI
   - push to PyPI only for released version and when owner is insarlab

+ repo setting: add github secrets from pypi, to support the above action
+ version: add Tag for version 1.4.1

+ readfile.read_hdf5_file(): speedup the 3D matrix reading when slicing a small fraction of the 1st dimension, by using integer indexing for 3D h5 dataset, instead of 1D boolean array indexing.

+ view.read_data4figure(): bugfix for referencing unwrapPhase while plotting mixed dset types

+ move the following plotting functions to utils.plot.py for a more compact module import, to simplify the UNAVCO notebook:
   - unwrap_error_phase_closure.plot_num_triplet_with_nonzero_integer_ambiguity()
   - timeseries_rms.plot_rms_bar()
   - objects.insar_vs_gps.plot_insar_vs_gps_scatter()

+ plot.plot_insar_vs_gps_scatter(): add preliminary outlier detection
+ save_hdf5eos.py: support radar-coded dataset
   - calculate `data_footprint` for radar-coded files, based on geometry files from both isce and roipac style
   - check the incompatible --subset option with radar-coded dataset
   - add example cmd for radar-coded dataset

+ utils0.py: add `snwe_to_wkt_polygon()`

Co-authored-by: Zhang Yunjun <[email protected]>
+ timeseries2velocity.py:
   - save `residue` for the overall fitting residues, a useful parameter to evaluate the fitting quality
   - save `intercept` for the Y-axis intercept of the polynomial function, to be able to reconstruct the time-series completely.

+ .github/workflows/pypi: publish the release to test-pypi as well
+ readfile.read_attribute: allow ENVI files created by GDAL with `SUFFIX=ADD`, in additional to the current ones created with `SUFFIX=REPLACE`.
+ timeseries2velocity.py:
   - include the reference point as valid pixels for calculation/inversion.
   - use np.full() instead of np.ones() for initiation with nan value.

+ tsview.py: bugfix for keeping the reference point in the valid pixel mask

+ utils/plot.auto_figure_title(): add "_" for the processing flag if not existed already.

Co-authored-by: bbuzz31 <[email protected]>
Co-authored-by: Zhang Yunjun <[email protected]>
+ delete the obsolete `mintpy/legacy/gui` folder, as 1) they are not working nor maintained anymore, 2) they are causing problems while trying pre-commit hooks

+ legacy/transect_legacy.py: update print() from py2 to py3

+ utils/isce_utils.get_processor(): add `data.db` to the supported list of metadata files generated by stripmapStack

+ load_data.py: add more msg for aria if load_data failed
NOTE: re-installation is required after this update, using pip or path setup, as described in docs/installation.md.

+ add `mintpy.cli`: split all CLI scripts in root module `mintpy` into two parts: core functionality (still in `mintpy`), and CLI-related functionalities (into a new sub-module `mintpy.cli`). The `mintpy.cli` module includes the following functions; and enables lazy improts (fast responsive CLI) to the `mintpy` command.
   - create_parser()
   - cmd_line_parse()
   - read_template2inps()
   - main()
   - __main__
   - other very simple sub-functions

+ `mintpy.cli`: use `parse -> import -> run / check / default` order to expand the lazy imports to all the individual *.py commands.

+ `mintpy.__main__`: use absolute imports

+ `mintpy.workflow.__init__`: update the dynamic import to `mintpy.cli`.

+ setup.py: add extras_require field

+ create an overall processing function for the following scripts, to allow for simple main() call in `mintpy.cli`:
   - bulk_plate_motion.py
   - closure_phase_bias.py
   - dem_gsi.py
   - generate_mask.py
   - ifgram_inversion.py
   - info.py
   - iono_tec.py
   - load_data.py
   - lookup_geo2radar.py
   - modify_network.py
   - smallbaselineApp.py

+ ifgram_inversion: remove the unavailable and unused "mintpy.networkInversion.residualNorm" option, to simplify the code.

+ load_data: use `importlib` to import prep_module

+ objects.timeseries():
   - add temporal_derivative() from temporal_derivative.py
   - add temporal_filter() from temporal_filter.py

+ objects.insar_vs_gps: refactor to replace `dateutil` with `datetime` to remove the `dateutil` dependency

+ smallbaselineApp.TimeSeriesAnalysis(): remove all unused `return` statement

+ tropo_gacos: keep only the JGR paper, to accurately reflect the fact that gacos website produced products do not include the GNSS info, as shown in Yu's other papers.

+ utils.utils1.run_or_skip(): rename check_readable to readable, to shortern its calls

+ view: remove unused `PLOT_TEMPLATE` and `--plot-setting` option. This was for insarmaps website, but does not seems to be used. Remove for code simplification.

+ remove the followings scripts, as they are aborted into `mintpy.cli` or `mintpy.objects.stack.timeseries`:
   - prep_snap.py
   - remove_hdf5_dset.py renamed from remove_hdf5_dataset.py
   - remove_ramp.py
   - spatial_average.py
   - temporal_average.py
   - temporal_derivative.py
   - temporal_filter.py

+ docs/installation.md: update the instruction to install mintpy via path setup

+ adjust to make path setup method working on cmd:
   - add `#!/usr/bin/env python3` to the top of all cli/[a-z]*.py scripts
   - run `chmod +x` to all `cli/[a-z]*.py` scripts
   - run `chmod -x` to all `mintpy/[a-z]*.py` scripts, except for two (add_attribute.py and multi_transect.py).

Co-authored-by: Zhang Yunjun <[email protected]>
Co-authored-by: Antonio Valentino <[email protected]>
#851)

+ solid_earth_tides.py:
   - add --comp enu2los / en2az to switch between range / azimuth direction output
   - use ut.get_unit_vector4comp_of_interest() for --comp projection
   - support date_list text file as input, as an alternative to the TS HDF5 file
   - change set_file as optional arg in calc_solid_earth_tides_timeseries()

+ bulk_plate_motion.py:
   - add --comp enu2los / en2az to switch between range / azimuth direction output
   - use ut.get_unit_vector4comp_of_interest() for --comp projection
   - use lower case "enu" and/or "az" for default output filename
   - set pmm_file as optional arg in calc_bulk_plate_motion()

+ utils.utils0.py:
   - add Coordinate / Orbit sub-section to simplify the Geometry sub-section
   - add definition with example values for the following angles: los_inc_angle, los_az_angle, orb_az_angle, head_angle
   - add los2orbit_azimuth_angle()
   - add azimuth2heading_angle(look_direction) and heading2azimuth_angle(look_direction)
   - add en2az()
   - add get_unit_vector4comp_of_interest()
   - add misregistration2coherence() based on Just & Bamler (1994)

+ utils.utils.prepare_geo_los_geometry(): change the output from head_angle to los_az_angle.

+ objects.ionex: move plotting-related modules inside plot_ionex() for more independency

+ objects.stack/giant: use MACRO_CASE for the global variables and update their usages throughout the repo.

+ objects.timeseries.read(): use single indexing to speedup IO

+ smallbaselineApp.plot_result: rm '-u cm' for velocity, as it now has datasets with different units, thus, '-u cm' won't work anymore.

+ tsview: fix the mpl.figure.canvas.set_window_title() bug, as reported and fixed by Jiawei Li

+ view: update example usage in the comments for (cli)/view.py

+ dependency: add `rich` to the formal dependency list, as it's lightweight and prints colorful template content, and plan to be used more.

+ del simulation/configSenDesc.txt, as it's not used in the code anymore.
+ install pre-commit GitHub Apps

+ add `.pre-commit-config.yaml`

+ changes from the initial run of pre-commit against all files
   - end-of-file-fixer
   - trailing-whitespace
   - sort imports via isort
   - modernize python via pyupgrade

+ info: printout h5 dataset compression info

+ tests: consistent script header comments

+ utils.readfile: use MACRO_CASE global var - replace standardMetadataKeys with STD_METADATA_KEYS
+ `smallbaselineApp`: bring back the individual module import (as proposed in the lazy import PR #828), to replace the workflow import, for better speed and robustness.

+ `workflow/__init__.py`: fix the UnboundLocalError of 'mintpy'

+ `info`: support `--compact` output to `--date / --num` options

+ general Codacy style suggestions
updates:
- [github.com/asottile/pyupgrade: v2.37.3 → v2.38.2](asottile/pyupgrade@v2.37.3...v2.38.2)
+ rename `bulk_plate_motion` to `plate_motion`: including changes in:
   - `mintpy.plate_motion.py`
   - `mintpy.cli.plate_motion.py`
   - `mintpy.__main__`
   - `setup.py`

+ `utils.readfile.read()`: add `no_data_values` arg to be able to convert the no-data-value from one number to another number.

+ `utils.network`: del the obsolete `igram_perp_baseline_list()` function

+ use the Python context manager `with` statement to better control the HDF5 file handle/lock (#855).
… last (#860)

+ `utils.readfile`:
   - add sort_dataset_list4velocity() to ensure velocity are the first dataset, and intercept/residue are the last datasets
   - apply the above func in get_dataset/slice_list() for velocity file
   - replace var `k` with `ftype` for code readility

+ tests/smallbaselineApp: use *.tar.gz file, in addition to *.tar.xz file, if exists.

+ add `mintpy.objects.progress.FileProgressObject` class to show a progrerss bar during uncompressing
+ utils.utils1.add_attribute(): support binary file, by writing roipac RSC file, in addition to the existing HDF5 file
+ prep_hyp3.add_hyp3_metadata(): set UNIT to radian for "lv_phi" file

+ objects.stackDict.geometryDict():
   - convert hyp3 azimuthAngle input from gamma to mintpy/isce2 convention
   - convert no-data-value from 0 to nan for azimuthAngle and incidenceAngle

+ docs: add lv_phi file to the example dir structure for hyp3
to ensure the consistency between output metadata and data with the 2-band format, because the input *.unw file may have only 1-band, as produced by `isce2/alosStack`.
* ptime.read_date_txt(): ignore invalid/empty lines

* read_template: bugfix for `skip_chars` arg

* deps: add pre-commit

+ add `pre-commit` to the following dependency files, so that it will be installed automatically in the development version.
   - docs/environment.yml
   - requirements.txt
   - setup.py

+ docs/CONTRIBUTING: add note to install `pre-commit`

+ github PR template: add selection box for pre-commit check.

* Update CONTRIBUTING.md

we need to run `pre-commit sample-config` to have a basic config file before running `pre-commit install`.

Co-authored-by: Yuan-Kai Liu <[email protected]>
@mirzaees mirzaees merged commit 98a0115 into mirzaees:main Oct 22, 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.