Skip to content

Commit 9d3d6c6

Browse files
committed
save weather with irradiance outputs from pysam
1 parent 17d65c4 commit 9d3d6c6

File tree

2 files changed

+602
-106
lines changed

2 files changed

+602
-106
lines changed

pvdeg/pysam.py

+28
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,16 @@ def _handle_pysam_return(pysam_res_dict : dict, weather_df: pd.DataFrame) -> xr.
400400
"subarray1_poa_front" : (("time", ), da.array(subarray1_poa_front)),
401401
"subarray1_poa_rear" : (("time", ), da.array(subarray1_poa_rear)),
402402

403+
# weather data
404+
"temp_air":(("time", ), da.array(weather_df["temp_air"].values)),
405+
"wind_speed":(("time", ), da.array(weather_df["wind_speed"].values)),
406+
"wind_direction":(("time", ), da.array(weather_df["wind_direction"].values)),
407+
"dhi":(("time", ), da.array(weather_df["dhi"].values)),
408+
"ghi":(("time", ), da.array(weather_df["ghi"].values)),
409+
"dni":(("time", ), da.array(weather_df["dni"].values)),
410+
"relative_humidity":(("time", ), da.array(weather_df["relative_humidity"].values)),
411+
"albedo":(("time", ), da.array(weather_df["albedo"].values)),
412+
403413
# spatio-temporal
404414
"ground_irradiance" : (("time", "distance"), ground_irradiance_values),
405415
},
@@ -426,6 +436,24 @@ def _handle_pysam_return(pysam_res_dict : dict, weather_df: pd.DataFrame) -> xr.
426436
"surface_albedo",
427437
]
428438

439+
INSPIRE_GEOSPATIAL_TEMPLATE_SHAPES = {
440+
"annual_poa": ("gid",),
441+
"annual_energy": ("gid",),
442+
"poa_front": ("gid", "time"),
443+
"poa_rear": ("gid", "time"),
444+
"subarray1_poa_front": ("gid", "time"),
445+
"subarray1_poa_rear": ("gid", "time"),
446+
"temp_air": ("gid", "time"),
447+
"wind_speed": ("gid", "time"),
448+
"wind_direction": ("gid", "time"),
449+
"dhi": ("gid", "time"),
450+
"ghi": ("gid", "time"),
451+
"dni": ("gid", "time"),
452+
"relative_humidity": ("gid", "time"),
453+
"albedo": ("gid", "time"),
454+
"ground_irradiance": ("gid", "time", "distance")
455+
}
456+
429457
def inspire_ground_irradiance(weather_df, meta, config_files):
430458
"""
431459
Get ground irradiance array and annual poa irradiance for a given point using pvsamv1

scripts/inspire_notebooks/pysam_geospatial.ipynb

+574-106
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)