diff --git a/examples/example.py b/examples/example.py index ab0687cf..d52fe0fb 100644 --- a/examples/example.py +++ b/examples/example.py @@ -8,10 +8,10 @@ def main(): site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25) # run model - predications_df = run_forecast(site=site, ts='2023-10-30') + predictions_df = run_forecast(site=site, ts="2023-10-30") - print(predications_df) - print(f"Max: {predications_df['power_wh'].max()}") + print(predictions_df) + print(f"Max: {predictions_df['power_wh'].max()}") if __name__ == "__main__": diff --git a/quartz_solar_forecast/data.py b/quartz_solar_forecast/data.py index 86919b64..4a368a3c 100644 --- a/quartz_solar_forecast/data.py +++ b/quartz_solar_forecast/data.py @@ -125,7 +125,6 @@ def make_pv_data(site: PVSite, ts) -> xr.Dataset: timestamp = [ts] pv_id = [1] - # would be nice to not use ss_id, should be pv_id da = xr.DataArray( data=generation_wh, dims=["pv_id", "timestamp"], @@ -135,8 +134,8 @@ def make_pv_data(site: PVSite, ts) -> xr.Dataset: timestamp=timestamp, pv_id=pv_id, kwp=(["pv_id"], [site.capacity_kwp]), - tilt=(["pv_id"], [0]), - orientation=(["pv_id"], [0]), + tilt=(["pv_id"], [site.tilt]), + orientation=(["pv_id"], [site.orientation]), ), ) da = da.to_dataset(name="generation_wh") diff --git a/quartz_solar_forecast/pydantic_models.py b/quartz_solar_forecast/pydantic_models.py index 83e5d76a..4e626bfb 100644 --- a/quartz_solar_forecast/pydantic_models.py +++ b/quartz_solar_forecast/pydantic_models.py @@ -2,7 +2,18 @@ class PVSite(BaseModel): - latitude: float = Field(..., description="the latitude of the site", ge=-90, le=90) longitude: float = Field(..., description="the longitude of the site", ge=-180, le=180) capacity_kwp: float = Field(..., description="the capacity [kwp] of the site", ge=0) + tilt: float = Field( + default=35, + description="the tilt of the site [degrees], the panels' angle relative to horizontal ground", + ge=0, + le=90, + ) + orientation: float = Field( + default=180, + description="the orientation of the site [degrees], the angle between north and the direction the panels face, measured on the horizontal plane.", + ge=0, + le=360, + )