代码更新
parent
e27e358610
commit
1ad2118d2b
|
@ -38,7 +38,7 @@
|
|||
<ParaType>File</ParaType>
|
||||
<DataType>tar.gz</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>F:\MicroWorkspace\S_SAR\AHV\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-Ortho.tar.gz</ParaValue>
|
||||
<ParaValue>F:\xibei_LandCover\S-SAR-西北实验\1116\HJ2E_KSC_QPS_006084_E86.2_N44.4_20231116_SLC_AHV_L10000132474-Ortho.tar.gz</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -51,9 +51,9 @@
|
|||
<ParaChsName>标记数据</ParaChsName>
|
||||
<Description>标记的样本数据</Description>
|
||||
<ParaType>File</ParaType>
|
||||
<DataType>zip</DataType>
|
||||
<DataType>csv</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>F:\al_zhongji\S-SAR-data\landCover\SSAR_landcover_landaCoverSample.zip</ParaValue>
|
||||
<ParaValue>F:\xibei_LandCover\landCoverSamples.csv</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>True</EnMultipleChoice>
|
||||
<Control>UploadInput</Control>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<ParaType>Value</ParaType>
|
||||
<DataType>string</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>0,1,2</ParaValue>
|
||||
<ParaValue>0,1,2,3,4,5,6,7,8,9</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>True</EnMultipleChoice>
|
||||
<Control>UploadInput</Control>
|
||||
|
@ -103,7 +103,7 @@
|
|||
<ParaType>File</ParaType>
|
||||
<DataType>tar.gz</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>D:\micro\SWork\LandCover\Output\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-Ortho-LANDCLASS.tar.gz</ParaValue>
|
||||
<ParaValue>D:\micro\SWork\LandCover\Output\HJ2E_KSC_QPS_006084_E86.2_N44.4_20231116_SLC_AHV_L10000132474-Ortho-LANDCLASS.tar.gz</ParaValue>
|
||||
</Parameter>
|
||||
</Outputs>
|
||||
</AlgCompt>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<Root>
|
||||
<TaskID>CSAR_202107275419_0001-0</TaskID>
|
||||
<WorkSpace>D:\613NET\ComputingNode\ftproot\Production\PL_20240507155658_0002\</WorkSpace>
|
||||
<WorkSpace>D:\micro\SWork\</WorkSpace>
|
||||
<AlgCompt>
|
||||
<DataTransModel>File</DataTransModel>
|
||||
<Artificial>ElementAlg</Artificial>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<ParaType>File</ParaType>
|
||||
<DataType>tar.gz</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>F:\MicroWorkspace\S_SAR\AHV\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-cal.tar.gz</ParaValue>
|
||||
<ParaValue>F:\MicroWorkspace\20240814tw\HJ2E_KRN_QPS_008852_E110.6_N20.1_20240515_SLC_AHV_L10000208028-cal.tar.gz</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -81,9 +81,9 @@
|
|||
<ParaChsName>土壤水分产品</ParaChsName>
|
||||
<Description>土壤水分产品</Description>
|
||||
<ParaType>File</ParaType>
|
||||
<DataType>zip</DataType>
|
||||
<DataType>tif</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>F:\al_zhongji\S-SAR-data\leafAreaIndex\SSAR_leafAreaIndex_SMC.zip</ParaValue>
|
||||
<ParaValue>F:\Tian-GF3-Wenchang\GF3_MYC_QPSI_040611_E110.6_N20.0_20240427_L1A_AHV_L10006928143-cal-SMC.tif</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -96,9 +96,9 @@
|
|||
<ParaChsName>叶面积指数实测数据</ParaChsName>
|
||||
<Description>叶面积指数实测数据</Description>
|
||||
<ParaType>File</ParaType>
|
||||
<DataType>zip</DataType>
|
||||
<DataType>csv</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>F:\al_zhongji\S-SAR-data\leafAreaIndex\SSAR_leafAreaIndex_LAI.zip</ParaValue>
|
||||
<ParaValue>F:\Tian-GF3-Wenchang\LAI\LAi.csv</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -111,9 +111,9 @@
|
|||
<ParaChsName>NDVI</ParaChsName>
|
||||
<Description>NDVI影像,坐标系要求:WGS84</Description>
|
||||
<ParaType>File</ParaType>
|
||||
<DataType>zip</DataType>
|
||||
<DataType>tif</DataType>
|
||||
<ParaSource>Cal</ParaSource>
|
||||
<ParaValue>F:\al_zhongji\S-SAR-data\leafAreaIndex\SSAR_leafAreaIndex_NDVI.zip</ParaValue>
|
||||
<ParaValue>F:\Tian-GF3-Wenchang\NDVI\S2_NDVImed_SMC_GF3.tif</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -128,7 +128,7 @@
|
|||
<ParaType>Value</ParaType>
|
||||
<DataType>string</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>0;1</ParaValue>
|
||||
<ParaValue>-1;1</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>UploadInput</Control>
|
||||
|
@ -141,9 +141,9 @@
|
|||
<ParaChsName>地表覆盖度</ParaChsName>
|
||||
<Description>地表覆盖度数据,坐标系要求:WGS84</Description>
|
||||
<ParaType>File</ParaType>
|
||||
<DataType>zip</DataType>
|
||||
<DataType>tif</DataType>
|
||||
<ParaSource>Cal</ParaSource>
|
||||
<ParaValue>F:\al_zhongji\S-SAR-data\leafAreaIndex\SSAR_leafAreaIndex_LandCover.zip</ParaValue>
|
||||
<ParaValue>F:\Tian-GF3-Wenchang\landCover_Glob30.tif</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>File</Control>
|
||||
|
@ -158,7 +158,7 @@
|
|||
<ParaType>Value</ParaType>
|
||||
<DataType>string</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>empty</ParaValue>
|
||||
<ParaValue>10;20;30;40;50;70;90</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>UploadInput</Control>
|
||||
|
@ -235,7 +235,7 @@
|
|||
<ParaType>File</ParaType>
|
||||
<DataType>tar.gz</DataType>
|
||||
<ParaSource>Cal</ParaSource>
|
||||
<ParaValue>D:\613NET\ComputingNode\ftproot\Production\PL_20240507155658_0002\LeafAreaIndex\Output\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-cal-LAI.tar.gz</ParaValue>
|
||||
<ParaValue>D:\micro\SWork\LeafAreaIndex\Output\HJ2E_KRN_QPS_008852_E110.6_N20.1_20240515_SLC_AHV_L10000208028-cal-LAI.tar.gz</ParaValue>
|
||||
<MaxValue>DEFAULT</MaxValue>
|
||||
<MinValue>DEFAULT</MinValue>
|
||||
<OptionValue>DEFAULT</OptionValue>
|
||||
|
|
|
@ -11,9 +11,13 @@
|
|||
[修改序列] [修改日期] [修改者] [修改内容]
|
||||
1 2022-6-29 石海军 1.兼容GF3元文件和正射校正元文件提取信息
|
||||
"""
|
||||
import json
|
||||
import logging
|
||||
from xml.etree.ElementTree import ElementTree
|
||||
import math
|
||||
|
||||
import xmltodict
|
||||
|
||||
logger = logging.getLogger("mylog")
|
||||
|
||||
class GF3L1AMetaData:
|
||||
|
@ -27,6 +31,18 @@ class GF3L1AMetaData:
|
|||
QualifyValue = float(root.find('imageinfo').find('QualifyValue').find(polarization).text)
|
||||
return QualifyValue
|
||||
|
||||
@staticmethod
|
||||
def get_SubQualifyValue(meta_file_path, polarization, pol_id):
|
||||
try:
|
||||
with open(meta_file_path, 'r', encoding='utf-8') as fp:
|
||||
HeaderFile_dom_str = fp.read()
|
||||
HeaderFile_dom = xmltodict.parse(HeaderFile_dom_str) # 将XML转成json文本
|
||||
HeaderFile_dom_json = json.loads(json.dumps(HeaderFile_dom))
|
||||
QualifyValue = float(HeaderFile_dom_json['product']['imageinfo']['QualifyValue'][pol_id][polarization])
|
||||
return QualifyValue
|
||||
except Exception as e:
|
||||
raise('get QualifyValue failed')
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_Kdb(meta_file_path, polarization):
|
||||
|
@ -89,6 +105,15 @@ class MetaDataHandler:
|
|||
logger.info('GF3L1AMetaData.get_QualifyValue() success!')
|
||||
return QualifyValue
|
||||
|
||||
def get_SubQualifyValue(meta_file_path, polarization, pol_id):
|
||||
try:
|
||||
QualifyValue = OrthoMetaData.get_QualifyValue(meta_file_path, polarization)
|
||||
except Exception:
|
||||
logger.warning('OrthoMetaData.get_QualifyValue() error!')
|
||||
QualifyValue = GF3L1AMetaData.get_SubQualifyValue(meta_file_path, polarization, pol_id)
|
||||
logger.info('GF3L1AMetaData.get_QualifyValue() success!')
|
||||
return QualifyValue
|
||||
|
||||
@staticmethod
|
||||
def get_Kdb(meta_file_path, polarization):
|
||||
try:
|
||||
|
|
|
@ -280,8 +280,8 @@ class BlockProcess:
|
|||
block_y = int(np.ceil(image.shape[0] / out_size)) # todo 修改分块
|
||||
for i in range(block_y):
|
||||
for j in range(block_x):
|
||||
start_x = image.shape[1] - out_size if (j == block_x - 1) else j * out_size
|
||||
start_y = image.shape[0] - out_size if (i == block_x - 1) else i * out_size
|
||||
start_x = image.shape[1] - out_size if (j == block_x - 1 and block_x != 1) else j * out_size
|
||||
start_y = image.shape[0] - out_size if (i == block_y - 1 and block_y != 1) else i * out_size
|
||||
end_x = image.shape[1] if (j + 1) * out_size > image.shape[1] else (j + 1) * out_size
|
||||
end_y = image.shape[0] if (i + 1) * out_size > image.shape[0] else (i + 1) * out_size
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
@Version :1.0.0
|
||||
"""
|
||||
import os
|
||||
from xml.etree.ElementTree import ElementTree
|
||||
|
||||
from PIL import Image
|
||||
from osgeo import gdal
|
||||
from osgeo import osr
|
||||
|
@ -758,6 +760,19 @@ class ImageHandler:
|
|||
|
||||
return quick_view_path
|
||||
|
||||
@staticmethod
|
||||
def get_inc_angle(inc_xml, rows, cols, out_path):
|
||||
tree = ElementTree()
|
||||
tree.parse(inc_xml) # 影像头文件
|
||||
root = tree.getroot()
|
||||
values = root.findall('incidenceValue')
|
||||
angle_value = [value.text for value in values]
|
||||
angle_value = np.array(angle_value)
|
||||
inc_angle = np.tile(angle_value, (rows, 1))
|
||||
ImageHandler.write_img(out_path, '', [0.0, 1.0, 0.0, 0.0, 0.0, 1.0], inc_angle)
|
||||
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
fn = r"C:\Users\sxwcc\Downloads\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-cal-SMC\HJ2E_MYC_QPS_001752_E118.0_N37.7_20230204_SLC_AHV_L10000010458-cal-SMC.tif"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
from xml.etree.ElementTree import ElementTree
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
class DictXml:
|
||||
def __init__(self, xml_path):
|
||||
|
@ -39,18 +41,23 @@ class DictXml:
|
|||
if bottomRight is None:
|
||||
raise Exception("get bottomRight failed")
|
||||
|
||||
lons = [float(topLeft.find("longitude").text), float(topRight.find("longitude").text), float(bottomLeft.find("longitude").text), float(bottomRight.find("longitude").text)]
|
||||
lats = [float(topLeft.find("latitude").text), float(topRight.find("latitude").text), float(bottomLeft.find("latitude").text), float(bottomRight.find("latitude").text)]
|
||||
lon_min = np.min(lons)
|
||||
lon_max = np.max(lons)
|
||||
lat_min = np.min(lats)
|
||||
lat_max = np.max(lats)
|
||||
|
||||
point_upleft = [float(topLeft.find("longitude").text), float(topLeft.find("latitude").text)]
|
||||
point_upright = [float(topRight.find("longitude").text), float(topRight.find("latitude").text)]
|
||||
point_downleft = [float(bottomLeft.find("longitude").text), float(bottomLeft.find("latitude").text)]
|
||||
point_downright = [float(bottomRight.find("longitude").text), float(bottomRight.find("latitude").text)]
|
||||
scopes = [point_upleft, point_upright, point_downleft, point_downright]
|
||||
|
||||
point_upleft_buf = [float(topLeft.find("longitude").text) - 0.6, float(topLeft.find("latitude").text) + 0.6]
|
||||
point_upright_buf = [float(topRight.find("longitude").text) + 0.6, float(topRight.find("latitude").text) + 0.6]
|
||||
point_downleft_buf = [float(bottomLeft.find("longitude").text) - 0.6,
|
||||
float(bottomLeft.find("latitude").text) - 0.6]
|
||||
point_downright_buf = [float(bottomRight.find("longitude").text) + 0.6,
|
||||
float(bottomRight.find("latitude").text) - 0.6]
|
||||
point_upleft_buf = [lon_min - 0.6, lat_max + 0.6]
|
||||
point_upright_buf = [lon_max + 0.6, lat_max + 0.6]
|
||||
point_downleft_buf = [lon_min - 0.6, lat_min - 0.6]
|
||||
point_downright_buf = [lon_max + 0.6, lat_min - 0.6]
|
||||
scopes_buf = ([point_upleft_buf, point_upright_buf, point_downleft_buf, point_downright_buf], )
|
||||
return scopes, scopes_buf
|
||||
|
||||
|
|
Loading…
Reference in New Issue