|
| 1 | +from isce3.core import Ellipsoid, LookSide, LUT2d, Orbit |
| 2 | +from isce3.geometry import DEMInterpolator, rdr2geo, geo2rdr |
| 3 | +from typing import Union, Optional |
| 4 | + |
| 5 | + |
| 6 | +def rdr2rdr(t: float, |
| 7 | + r: float, |
| 8 | + orbit: Orbit, |
| 9 | + side: Union[str, LookSide], |
| 10 | + doppler: LUT2d, |
| 11 | + wavelength: float, |
| 12 | + dem: DEMInterpolator = DEMInterpolator(), |
| 13 | + ellipsoid: Ellipsoid = Ellipsoid(), |
| 14 | + doppler_out: Optional[LUT2d] = None, |
| 15 | + orbit_out: Optional[Orbit] = None, |
| 16 | + rdr2geo_params=dict(), |
| 17 | + geo2rdr_params=dict()): |
| 18 | + """ |
| 19 | + Convert coordinates from one radar geometry to another with a different |
| 20 | + Doppler (reskew) or orbit (motion compensation). |
| 21 | +
|
| 22 | + Parameters |
| 23 | + ---------- |
| 24 | + t : float |
| 25 | + Azimuth time, seconds past orbit epoch |
| 26 | + r : float |
| 27 | + Range, m |
| 28 | + orbit : isce3.core.Orbit |
| 29 | + Orbit defining radar motion on input path |
| 30 | + side : {"left", "right", isce3.core.LookSide.Left, isce3.core.LookSide.Right} |
| 31 | + Flag desribing which side the radar is looking. |
| 32 | + doppler : isce3.core.LUT2d |
| 33 | + Doppler look up table vs input range and azimuth time, Hz |
| 34 | + wavelength : float |
| 35 | + Wavelength associated with Doppler, m |
| 36 | + dem : isce3.geometry.DEMInterpolator, optional |
| 37 | + Digital elevation model, m above ellipsoid. Defaults to h=0. |
| 38 | + ellipsoid : isce3.core.Ellipsoid, optional |
| 39 | + Ellipsoid describing surface. Defaults to WGS-84. |
| 40 | + doppler_out : isce3.core.LUT2d, optional |
| 41 | + Doppler look up table vs output range and azimuth time, Hz |
| 42 | + Defaults to input `doppler`. |
| 43 | + orbit_out : isce3.core.Orbit, optional |
| 44 | + Orbit defining radar motion on output path. Defaults to input `orbit`. |
| 45 | + rdr2geo_params : dict, optional |
| 46 | + Dictionary specifying convergence paramters for rdr2geo solver. |
| 47 | + Keys among {"threshold", "maxiter", "extraiter"} |
| 48 | + See isce3.geometry.rdr2geo |
| 49 | + geo2rdr_params: dict, optional |
| 50 | + Dictionary specifying convergence paramters for geo2rdr solver. |
| 51 | + Keys among {"threshold", "maxiter", "delta_range"} |
| 52 | + See isce3.geometry.geo2rdr |
| 53 | +
|
| 54 | + Returns |
| 55 | + ------- |
| 56 | + t_out : float |
| 57 | + Azimuth time in output geometry, seconds past orbit epoch |
| 58 | + r_out : float |
| 59 | + Range in output geometry, m |
| 60 | + """ |
| 61 | + if (orbit_out is None) and (doppler_out is None): |
| 62 | + return t, r |
| 63 | + if orbit_out is None: |
| 64 | + orbit_out = orbit |
| 65 | + if doppler_out is None: |
| 66 | + doppler_out = doppler |
| 67 | + doppler_in = doppler.eval(t, r) |
| 68 | + llh = rdr2geo(t, r, orbit, side, doppler_in, wavelength, dem, ellipsoid, |
| 69 | + **rdr2geo_params) |
| 70 | + tout, rout = geo2rdr(llh, ellipsoid, orbit_out, doppler_out, wavelength, |
| 71 | + side, **geo2rdr_params) |
| 72 | + return tout, rout |
0 commit comments