little change
Browse files- neo_reader/neo_node.py +3 -8
neo_reader/neo_node.py
CHANGED
@@ -35,16 +35,11 @@ def _act_to_cmap(act_file: Path) -> np.ndarray:
|
|
35 |
class NEONode(NpzRepresentation):
|
36 |
"""NEO nodes implementation in ngclib repository"""
|
37 |
def __init__(self, node_type: str, name: str):
|
38 |
-
# all neo nodes have 1 dimension.
|
39 |
-
valid_node_types = ["AerosolOpticalDepth", "Albedo", "CarbonMonoxide", "Chlorophyll", "CloudFraction",
|
40 |
-
"CloudOpticalThickness", "CloudParticleRadius", "CloudWaterContent", "Fire",
|
41 |
-
"LeafAreaIndex", "NetRadiation", "NitrogenDioxide", "OutgoingLongwaveRadiation", "Ozone",
|
42 |
-
"ReflectedShortwaveRadiation", "SeaSurfaceTemperature", "SnowCover", "SolarInsolation",
|
43 |
-
"Temperature", "TemperatureAnomaly", "Vegetation", "WaterVapor"]
|
44 |
-
assert node_type in valid_node_types, f"Node type '{node_type}' not in {valid_node_types}"
|
45 |
self.node_type = node_type
|
46 |
self.name = name
|
47 |
-
|
|
|
|
|
48 |
|
49 |
@overrides
|
50 |
def load_from_disk(self, path: Path) -> tr.Tensor:
|
|
|
35 |
class NEONode(NpzRepresentation):
|
36 |
"""NEO nodes implementation in ngclib repository"""
|
37 |
def __init__(self, node_type: str, name: str):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
self.node_type = node_type
|
39 |
self.name = name
|
40 |
+
act_path = Path(__file__).absolute().parent / "cmaps" / f"{self.node_type}.act"
|
41 |
+
assert act_path.exist(), f"Node type '{node_type}' not valid. No act file found: '{act_path}'"
|
42 |
+
self.cmap = _act_to_cmap(act_path)
|
43 |
|
44 |
@overrides
|
45 |
def load_from_disk(self, path: Path) -> tr.Tensor:
|