From fb1a15151f2ca56ac087e6bdcbe176de2207b0af Mon Sep 17 00:00:00 2001 From: tian jiax <446100073@qq.com> Date: Wed, 6 Sep 2023 11:28:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=A4=A7=E6=B0=94=E6=A0=A1=E6=AD=A3?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=B8=AD=E9=97=B4=E7=BB=93=E6=9E=9C=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=9C=B0=E7=90=86=E7=BC=96=E7=A0=81=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=8A=A0=E5=88=B0=E4=BA=A7=E5=93=81=E7=BB=93=E6=9E=9C=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- atmosphericDelay/AtmosphericDelayMain.py | 2 +- tool/algorithm/image/ImageHandle.py | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/atmosphericDelay/AtmosphericDelayMain.py b/atmosphericDelay/AtmosphericDelayMain.py index 552980ad..af2a815a 100644 --- a/atmosphericDelay/AtmosphericDelayMain.py +++ b/atmosphericDelay/AtmosphericDelayMain.py @@ -804,7 +804,7 @@ class AtmosphericMain: self.imageHandler.band_merge(limit_lon, limit_lat, ori_sim) if not os.path.exists(ori_sim): logger.error("create ori_sim failed") - scopes = self.get_scopes(ori_sim) + scopes = self.imageHandler.get_scopes(ori_sim) self.transformZtd(scopes, ori_sim, out_mas_ztd_path, geo_mas_ztd_path) # 主影像ztd进行地理编码 self.transformZtd(scopes, ori_sim, out_aux_ztd_path, geo_aux_ztd_path) # 辅影像ztd进行地理编码 diff --git a/tool/algorithm/image/ImageHandle.py b/tool/algorithm/image/ImageHandle.py index 227b77f9..55724008 100644 --- a/tool/algorithm/image/ImageHandle.py +++ b/tool/algorithm/image/ImageHandle.py @@ -624,11 +624,25 @@ class ImageHandler: lon_arr = self.get_data(lon) lat_arr = self.get_data(lat) temp = np.zeros((2, lon_arr.shape[0], lon_arr.shape[1]), dtype=float) - temp[0, :, :] = lon_arr - temp[1, :, :] = lat_arr + temp[0, :, :] = lon_arr[:, :] + temp[1, :, :] = lat_arr[:, :] self.write_img(ori_sim, '', [0.0, 1.0, 0.0, 0.0, 0.0, 1.0], temp, '0') + def get_scopes(self, ori_sim): + ori_sim_data = self.get_data(ori_sim) + lon = ori_sim_data[0, :, :] + lat = ori_sim_data[1, :, :] + + min_lon = np.nanmin(np.where((lon != 0) & ~np.isnan(lon), lon, np.inf)) + max_lon = np.nanmax(np.where((lon != 0) & ~np.isnan(lon), lon, -np.inf)) + min_lat = np.nanmin(np.where((lat != 0) & ~np.isnan(lat), lat, np.inf)) + max_lat = np.nanmax(np.where((lat != 0) & ~np.isnan(lat), lat, -np.inf)) + + scopes = [[min_lon, max_lat], [max_lon, max_lat], [min_lon, min_lat], [max_lon, min_lat]] + return scopes + + # if __name__ == '__main__': # path = r'D:\BaiduNetdiskDownload\GZ\lon.rdr' # path2 = r'D:\BaiduNetdiskDownload\GZ\lat.rdr'