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

utils0: use more hardwired EARTH_RADIUS if needed #1261

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mintpy/objects/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def get_unavco_mission_name(meta_dict):
# Table 2 & 6 in https://directory.eoportal.org/web/eoportal/satellite-missions/g/gaofen-3
# https://www.eoportal.org/satellite-missions/gaofen-3
# Li et al. (2018, RS) at https://doi.org/10.3390/rs10121929
# Table I in Yang et al. (2023, IEEE-TGRS) at https://doi.org/10.1109/TGRS.2023.3238707
GF3 = {
# orbit
'altitude' : 755e3, # m
Expand All @@ -377,7 +378,11 @@ def get_unavco_mission_name(meta_dict):
'carrier_frequency' : 5.4e9, # Hz
'antenna_length' : 15, # m
'antenna_width' : 1.5, # m
'pulse_repetition_frequency' : 1412.18, # Hz
'chirp_bandwidth' : 60.00e6, # Hz
'sampling_frequency' : 533.33e6, # Hz
'azimuth_pixel_size' : 4.77, # m, FSII mode
'range_pixel_size' : 2.25, # m, FSII mode
}

# Sentinel-1 Interferometric Wide (IW / TOPS) swath mode
Expand Down
4 changes: 2 additions & 2 deletions src/mintpy/utils/utils0.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def incidence_angle2slant_range_distance(atr, inc_angle):
if isinstance(inc_angle, str):
inc_angle = float(inc_angle)
inc_angle = np.array(inc_angle, dtype=np.float32) / 180 * np.pi
r = float(atr['EARTH_RADIUS'])
r = float(atr.get('EARTH_RADIUS', EARTH_RADIUS))
H = float(atr['HEIGHT'])

# calculate 2R based on the law of sines
Expand Down Expand Up @@ -229,7 +229,7 @@ def azimuth_ground_resolution(atr):

proc = atr.get('PROCESSOR', 'isce')
if proc in ['roipac', 'isce']:
Re = float(atr['EARTH_RADIUS'])
Re = float(atr.get('EARTH_RADIUS', EARTH_RADIUS))
height = float(atr['HEIGHT'])
az_step = float(atr['AZIMUTH_PIXEL_SIZE']) * Re / (Re + height)
elif proc == 'gamma':
Expand Down
15 changes: 15 additions & 0 deletions tests/objects/ionex.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ def test_get_ionex_value():
print(f'Interpolation method ({method:8s}) with rotation ({str(rotate):5s}): Pass.')


def test_plot_ionex():
"""Test mintpy.objects.ionex.plot_ionex()"""
# get IONEX file path
tec_file = ionex.get_ionex_filename(
date_str,
tec_dir=tec_dir,
sol_code=sol_code,
)

# plot IONEX file
ionex.plot_ionex(tec_file, save_fig=True)


if __name__ == '__main__':

print('-'*50)
Expand All @@ -112,3 +125,5 @@ def test_get_ionex_value():
test_read_ionex()

test_get_ionex_value()

#test_plot_ionex()