Skip to content

Commit eb2fbe5

Browse files
committed
Add solar position for PV-sites
1 parent ae1d46b commit eb2fbe5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pvnet/models/multimodal/multimodal.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,16 @@ def forward(self, x):
342342
modes["sensor"] = self.sensor_encoder(x_tmp)
343343

344344
if self.include_sun:
345-
sun = torch.cat(
346-
(x[BatchKey.gsp_solar_azimuth], x[BatchKey.gsp_solar_elevation]), dim=1
347-
).float()
345+
if self.target_key_name == "gsp":
346+
sun = torch.cat(
347+
(x[BatchKey.gsp_solar_azimuth], x[BatchKey.gsp_solar_elevation]), dim=1
348+
).float()
349+
elif self.target_key_name == "pv":
350+
sun = torch.cat(
351+
(x[BatchKey.pv_solar_azimuth], x[BatchKey.pv_solar_elevation]), dim=1
352+
).float()
353+
else:
354+
raise ValueError(f"Unknown target key for sun elevation {self.target_key_name}")
348355
sun = self.sun_fc1(sun)
349356
modes["sun"] = sun
350357

0 commit comments

Comments
 (0)