Skip to content

Commit

Permalink
read_attribute: translate DATA_TYPE ci2 to float32 for roipac (#1064)
Browse files Browse the repository at this point in the history
+ utils.readfile.read_attribute(): translate DATA_TYPE value "ci2" to "float32" for roipac products

+ tests/smallbaselineApp: more comments on example usage
  • Loading branch information
yunjunz authored Aug 8, 2023
1 parent b74fffc commit 2af3905
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/mintpy/utils/readfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,12 +1247,15 @@ def get_hdf5_dataset(name, obj):
atr.update(read_gdal_vrt(metafile))
atr['FILE_TYPE'] = fext

# DATA_TYPE for ISCE products
# DATA_TYPE for ISCE/ROI_PAC products
data_type_dict = {
'byte': 'int8',
'float': 'float32',
# isce2
'byte' : 'int8',
'float' : 'float32',
'double': 'float64',
'cfloat': 'complex64',
# roipac
'ci2' : 'float32',
}
data_type = atr.get('DATA_TYPE', 'none').lower()
if data_type != 'none' and data_type in data_type_dict.keys():
Expand Down
14 changes: 11 additions & 3 deletions tests/smallbaselineApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,18 @@
"""

EXAMPLE = """example:
# regular tests
$MINTPY_HOME/tests/smallbaselineApp.py
$MINTPY_HOME/tests/smallbaselineApp.py --dir ~/test
$MINTPY_HOME/tests/smallbaselineApp.py --dset KujuAlosAT422F650
$MINTPY_HOME/tests/smallbaselineApp.py --nofresh
# fast tests
$MINTPY_HOME/tests/smallbaselineApp.py --nofresh
$MINTPY_HOME/tests/smallbaselineApp.py --dset KujuAlosAT422F650
# change the local test directory
$MINTPY_HOME/tests/smallbaselineApp.py --dir ~/test
# the most complete tests
$MINTPY_HOME/tests/smallbaselineApp.py --test-pyaps --test-isce
"""

def create_parser():
Expand Down

0 comments on commit 2af3905

Please sign in to comment.