Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 45 additions & 28 deletions satpy/enhancements/ahi.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,51 @@ def _jma_true_color_reproduction(img_data, platform=None):

"""
# Conversion matrix dictionaries specifying sensor and platform.
ccm_dict = {"himawari-8": np.array([[1.1629, 0.1539, -0.2175],
[-0.0252, 0.8725, 0.1300],
[-0.0204, -0.1100, 1.0633]]),

"himawari-9": np.array([[1.1619, 0.1542, -0.2168],
[-0.0271, 0.8749, 0.1295],
[-0.0202, -0.1103, 1.0634]]),

"goes-16": np.array([[1.1425, 0.1819, -0.2250],
[-0.0951, 0.9363, 0.1360],
[-0.0113, -0.1179, 1.0621]]),
"goes-17": np.array([[1.1437, 0.1818, -0.2262],
[-0.0952, 0.9354, 0.1371],
[-0.0113, -0.1178, 1.0620]]),
"goes-18": np.array([[1.1629, 0.1539, -0.2175],
[-0.0252, 0.8725, 0.1300],
[-0.0204, -0.1100, 1.0633]]),
"goes-19": np.array([[0.9481, 0.3706, -0.2194],
[-0.0150, 0.8605, 0.1317],
[-0.0174, -0.1009, 1.0512]]),

"mtg-i1": np.array([[0.9007, 0.2086, -0.0100],
[-0.0475, 1.0662, -0.0414],
[-0.0123, -0.1342, 1.0794]]),

"geo-kompsat-2a": np.array([[1.1661, 0.1489, -0.2157],
[-0.0255, 0.8745, 0.1282],
[-0.0205, -0.1103, 1.0637]]),
ccm_dict = {"himawari-8": np.array([[1.1495, 0.1534, -0.2203],
[-0.0245, 0.8741, 0.1321],
[-0.0203, -0.1102, 1.0685]]),

"himawari-9": np.array([[1.1485, 0.1537, -0.2196],
[-0.0264, 0.8765, 0.1316],
[-0.0200, -0.1105, 1.0686]]),

"goes-16": np.array([[1.1293, 0.1810, -0.2277],
[-0.0940, 0.9377, 0.1380],
[-0.0111, -0.1180, 1.0673]]),
"goes-17": np.array([[1.1306, 0.1809, -0.2289],
[-0.0941, 0.9367, 0.1391],
[-0.0112, -0.1179, 1.0672]]),
"goes-18": np.array([[1.1328, 0.1815, -0.2317],
[-0.0943, 0.9342, 0.1417],
[-0.0112, -0.1176, 1.0669]]),
"goes-19": np.array([[1.1253, 0.1818, -0.2244],
[-0.0937, 0.9403, 0.1351],
[-0.0111, -0.1184, 1.0676]]),

"meteosat-12": np.array([[0.8860, 0.2081, -0.0115],
[-0.0468, 1.0691, -0.0406],
[-0.0121, -0.1345, 1.0847]]),

"geo-kompsat-2a": np.array([[1.1527, 0.1484, -0.2185],
[-0.0248, 0.8762, 0.1303],
[-0.0203, -0.1105, 1.0689]]),

"sentinel-3a": np.array([[2.3828, 0.0046, -1.3048],
[-0.2172, 0.0342, 1.1647],
[-0.0211, -0.0043, 0.9636]]),
"sentinel-3b": np.array([[2.3718, 0.0058, -1.2950],
[-0.2161, 0.0434, 1.1544],
[-0.0211, -0.0055, 0.9646]]),

"sentinel-2a": np.array([[2.0301, 0.0231, -0.9706],
[-0.1801, 0.1302, 1.0316],
[-0.0186, -0.0164, 0.9732]]),
"sentinel-2b": np.array([[1.9942, 0.0289, -0.9405],
[-0.1774, 0.1617, 0.9974],
[-0.0182, -0.0204, 0.9767]]),
"sentinel-2c": np.array([[1.7759, 0.0666, -0.7598],
[-0.1589, 0.3731, 0.7675],
[-0.0161, -0.0470, 1.0013]]),
}

# A conversion matrix, sensor name and platform name is required
Expand Down
12 changes: 6 additions & 6 deletions satpy/tests/enhancement_tests/test_ahi.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def test_jma_true_color_reproduction(self):

from satpy.enhancements.ahi import jma_true_color_reproduction

expected = [[[-109.93, 10.993, 131.916, 252.839, 373.762],
[494.685, 615.608, 736.531, 857.454, 978.377]],
expected = [[[-108.260, 10.826, 129.912, 248.998, 368.084],
[487.170, 606.256, 725.342, 844.428, 963.514]],

[[-97.73, 9.773, 117.276, 224.779, 332.282],
[439.785, 547.288, 654.791, 762.294, 869.797]],
[[ -98.170, 9.817, 117.804, 225.791, 333.778],
[441.765, 549.752, 657.739, 765.726, 873.713]],

[[-93.29, 9.329, 111.948, 214.567, 317.186],
[419.805, 522.424, 625.043, 727.662, 830.281]]]
[[-93.800, 9.380, 112.560, 215.740, 318.920],
[422.100, 525.280, 628.460, 731.640, 834.820]]]

img = XRImage(self.rgb)
jma_true_color_reproduction(img)
Expand Down
Loading