Skip to content

Commit

Permalink
NSRDB TMY files select most recently created
Browse files Browse the repository at this point in the history
  • Loading branch information
tobin-ford committed Nov 26, 2024
1 parent 1015197 commit ac94639
Show file tree
Hide file tree
Showing 5 changed files with 713 additions and 3,102 deletions.
3 changes: 2 additions & 1 deletion pvdeg/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,8 @@ def addLocation(
weather_db = "NSRDB"
weather_arg = {
"satellite": satellite,
"names": year,
# "names": year, # allow user to choose tmy or year
"names":"TMY",
"NREL_HPC": True,
"attributes": nsrdb_attributes,
}
Expand Down
10 changes: 10 additions & 0 deletions pvdeg/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,17 @@ def get_NSRDB(
return weather_df, meta.to_dict()

elif geospatial:
# new versions have multiple files per satellite-year to reduce filesizes
# this is great for yearly data but TMY has multiple files
# the year attached to the TMY file in the filesystem/name is seemingly
# the year it was created. this creates problems, we only want to combine the files
# if they are NOT TMY

nsrdb_fnames, hsds = get_NSRDB_fnames(satellite, names, NREL_HPC)

if (isinstance(names, str) and names.lower() in ["tmy", "tmy3"]):
nsrdb_fnames = nsrdb_fnames[-1:] # maintain as list with last element

weather_ds, meta_df = ini_h5_geospatial(nsrdb_fnames)

if attributes is not None:
Expand Down
2,515 changes: 103 additions & 2,412 deletions scripts/pysam_america.ipynb

Large diffs are not rendered by default.

692 changes: 18 additions & 674 deletions scripts/pysam_geospatial.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit ac94639

Please sign in to comment.