将大气校正产品中间结果进行地理编码,并加到产品结果中
parent
54f94332c4
commit
fb1a15151f
|
@ -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进行地理编码
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue