simplify generic I/O logic for cpx binary files#642
Merged
yunjunz merged 1 commit intoinsarlab:mainfrom Aug 19, 2021
Merged
Conversation
This PR modifies readfile/writefile to read and write complex binary files (from isce-2) directly in complex data type by default. For plotting in view.py, which requires real data type, I add readfile.get_slice_list(no_complex) option to translate complex into mag/phase for plotting. This option is turn off by default for generic I/O. + readfile: - read_binary_file(): for "slc", set cpx_band to "complex" unless mag/phase is clearly specified. - get_slice_list(): 1) ignore meaningless geo/rdr file extension; 2) add "no_complex" arg to switch between complex (for I/O) and mag/phase (for plotting) + writefile: - write(): for .slc/.int, write complex directly - write_isce_xml(): add "image_type" arg to initiate different ISCE-2 image objects for better compatiability - write_isce_file(): support file_type == 'isce_slc' - comment out obsolete write_complex64() as write_complex_float32() is equivalent but simpler and faster. + subset/multilook: update usage of writefile.write_isce_xml() + view: update usage of readfile.get_slice_list() Other minor changes: + subset.py: add --sub-x/y/lat/lon and --subset-x/y/lat/lon to be consistent with subset option names in other scripts. + view.py: add --nmli / --num-multilook for --multilook-num + simulation.simulation.py: typo fix and add missing wvl arg while calling timeseries2ifgram() + objects.sensor: typo fix for doppler_bandwidth
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
This PR modifies readfile/writefile to read and write complex binary files (from isce-2) directly in complex data type by default.
For plotting in view.py, which requires real data type, I add readfile.get_slice_list(no_complex) option to translate complex into mag/phase for plotting. This option is turn off by default for generic I/O.
readfile:
writefile:
subset/multilook: update usage of writefile.write_isce_xml()
view: update usage of readfile.get_slice_list()
Other minor changes:
Reminders