Skip to content

Commit

Permalink
Merge pull request #131 from openclimatefix/jacob/solar-location
Browse files Browse the repository at this point in the history
Add solar position for PV-sites
  • Loading branch information
jacobbieker authored Feb 9, 2024
2 parents 767c775 + 74aae2b commit a405b06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def make_clean_data_config(input_path, output_path, placeholder="PLACEHOLDER"):

if "nwp" in config["input_data"]:
for source in config["input_data"]["nwp"]:
if config["input_data"]["nwp"][source][f"nwp_zarr_path"] != "":
config["input_data"]["nwp"][source][f"nwp_zarr_path"] = f"{placeholder}.zarr"
if config["input_data"]["nwp"][source]["nwp_zarr_path"] != "":
config["input_data"]["nwp"][source]["nwp_zarr_path"] = f"{placeholder}.zarr"

if "pv" in config["input_data"]:
for d in config["input_data"]["pv"]["pv_files_groups"]:
Expand Down
6 changes: 5 additions & 1 deletion pvnet/models/multimodal/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ def forward(self, x):

if self.include_sun:
sun = torch.cat(
(x[BatchKey.gsp_solar_azimuth], x[BatchKey.gsp_solar_elevation]), dim=1
(
x[BatchKey[f"{self.target_key_name}_solar_azimuth"]],
x[BatchKey[f"{self.target_key_name}_solar_elevation"]],
),
dim=1,
).float()
sun = self.sun_fc1(sun)
modes["sun"] = sun
Expand Down

0 comments on commit a405b06

Please sign in to comment.