Skip to content

Commit ac94639

Browse files
committed
NSRDB TMY files select most recently created
1 parent 1015197 commit ac94639

File tree

5 files changed

+713
-3102
lines changed

5 files changed

+713
-3102
lines changed

pvdeg/scenario.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,8 @@ def addLocation(
11701170
weather_db = "NSRDB"
11711171
weather_arg = {
11721172
"satellite": satellite,
1173-
"names": year,
1173+
# "names": year, # allow user to choose tmy or year
1174+
"names":"TMY",
11741175
"NREL_HPC": True,
11751176
"attributes": nsrdb_attributes,
11761177
}

pvdeg/weather.py

+10
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,17 @@ def get_NSRDB(
633633
return weather_df, meta.to_dict()
634634

635635
elif geospatial:
636+
# new versions have multiple files per satellite-year to reduce filesizes
637+
# this is great for yearly data but TMY has multiple files
638+
# the year attached to the TMY file in the filesystem/name is seemingly
639+
# the year it was created. this creates problems, we only want to combine the files
640+
# if they are NOT TMY
641+
636642
nsrdb_fnames, hsds = get_NSRDB_fnames(satellite, names, NREL_HPC)
643+
644+
if (isinstance(names, str) and names.lower() in ["tmy", "tmy3"]):
645+
nsrdb_fnames = nsrdb_fnames[-1:] # maintain as list with last element
646+
637647
weather_ds, meta_df = ini_h5_geospatial(nsrdb_fnames)
638648

639649
if attributes is not None:

scripts/pysam_america.ipynb

+103-2,412
Large diffs are not rendered by default.

scripts/pysam_geospatial.ipynb

+18-674
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)