Commit 6543234b authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Revised previous commit.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 26034202
Pipeline #8004 canceled with stage
......@@ -882,26 +882,22 @@ class METADATA(object):
# Coordinate Reference System
re_CS_EPSG = re.search(
r'<re:ProductInformation>[\s\S]*'
r'<re:epsgCode>([0-9]*)'
r'</re:epsgCode>[\s\S]*'
'</re:ProductInformation>',
r'<re:epsgCode>([0-9]*)</re:epsgCode>[\s\S]*'
r'</re:ProductInformation>',
mxml_, re.I)
re_CS_TYPE = re.search(
r'<re:ProductInformation>[\s\S]*'
r'<re:projection>([\s\S]*)'
r'</re:projection>[\s\S]*'
'</re:ProductInformation>',
r'<re:projection>([\s\S]*)</re:projection>[\s\S]*'
r'</re:ProductInformation>',
mxml_, re.I)
re_CS_DATUM = re.search(
r'<re:ProductInformation>[\s\S]*'
r'<re:geodeticDatum>([\w+\s]*)'
r'</re:geodeticDatum>[\s\S]*'
'</re:ProductInformation>',
r'<re:geodeticDatum>([\w+\s]*)</re:geodeticDatum>[\s\S]*'
r'</re:ProductInformation>',
mxml_, re.I)
re_CS_UTM_ZONE = re.search(
r'<re:ProductInformation>[\s\S]*'
r'<re:projectionZone>([0-9]*)'
r'</re:projectionZone>[\s\S]*'
r'<re:projectionZone>([0-9]*)</re:projectionZone>[\s\S]*'
r'</re:ProductInformation>',
mxml_, re.I)
self.CS_EPSG = int(re_CS_EPSG.group(1)) if re_CS_EPSG else self.CS_EPSG
......@@ -913,35 +909,27 @@ class METADATA(object):
# Corner Coordinates ## Lon/Lat for all given image corners UL,UR,LL,LR (tuples)
h10_UL = re.findall(
r'<re:topLeft>'
r'<re:latitude>(.*)'
r'</re:latitude>'
r'<re:longitude>(.*)'
r'</re:longitude>'
r'<re:latitude>(.*)</re:latitude>'
r'<re:longitude>(.*)</re:longitude>'
r'</re:topLeft>',
mxml_, re.I)
h10_UR = re.findall(
'<re:topRight>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:topRight>',
r'<re:topRight>'
r'<re:latitude>(.*)</re:latitude>'
r'<re:longitude>(.*)</re:longitude>'
r'</re:topRight>',
mxml_, re.I)
h10_LL = re.findall(
'<re:bottomLeft>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:bottomLeft>',
r'<re:bottomLeft>'
r'<re:latitude>(.*)</re:latitude>'
r'<re:longitude>(.*)</re:longitude>'
r'</re:bottomLeft>',
mxml_, re.I)
h10_LR = re.findall(
'<re:bottomRight>'
'<re:latitude>(.*)'
'</re:latitude>'
'<re:longitude>(.*)'
'</re:longitude>'
'</re:bottomRight>',
r'<re:bottomRight>'
r'<re:latitude>(.*)</re:latitude>'
r'<re:longitude>(.*)</re:longitude>'
r'</re:bottomRight>',
mxml_, re.I)
if h10_UL: # Set Corner Tie Point Coordinates (order = UL,UR,LL,LR)
self.CornerTieP_LonLat.append(tuple([float(h10_UL[0][1]), float(h10_UL[0][0])]))
......@@ -956,8 +944,7 @@ class METADATA(object):
LBA_full_sorted = HLP_F.sorted_nicely(self.LayerBandsAssignment_full)
# Gains + Offsets
h9 = re.findall(r"<re:radiometricScaleFactor>([^<]*)"
r"</re:radiometricScaleFactor>",
h9 = re.findall(r"<re:radiometricScaleFactor>([^<]*)</re:radiometricScaleFactor>",
mxml_, re.I)
self.Gains = dict(zip(LBA_full_sorted, [float(gain) for gain in h9]))
self.Offsets = dict(zip(LBA_full_sorted, [0, 0, 0, 0, 0]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment