Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Include additional illustrative plots describing input data, methods, testing, a
- [ ] Units are specified
- [ ] Preprocessing steps have been documented and committed to [ReEDS_Input_Processing](https://github.com/ReEDS-Model/ReEDS_Input_Processing)
- [ ] New large data files handled with .h5 instead of .csv
- [ ] If new parameters are added to `d_objective.gms`, they are included in `objective_function_params.yaml` for completeness checking
- [ ] If spatially resolved inputs are modified, the following visualizations for each file are included in the PR description (time-averaged if the inputs are time-resolved):
- [ ] Map of absolute values before
- [ ] Map of absolute values after
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ retail_rate_module/inputs/EIA861/*
postprocessing/retail_rate_module/inputs/EIA861/*

# Large files from remote sources
inputs/profiles_cf
inputs/profiles_demand
inputs/profiles_dr
inputs/profiles_temperature
inputs/profiles*
inputs/remote
inputs/shapefiles/cache

Expand Down
2 changes: 1 addition & 1 deletion cases_test.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ignore,1,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
GSw_Region,cendiv/Pacific,,country/USA,country/USA,country/USA,,st/ID.WY.NE.IA.IL,st/MA,,,,,,,st/WY,interconnect/western,transreg/PJM,st/NY.VT,st/OR,st/NE.NY.PA,st/NE.NY.PA,st/ID.WY.NE.IA.IL,st/KS,country/USA,country/USA,st/NY.NJ,,,,st/MA.RI.CT.NY.NJ.PA.OH,
endyear,2032,,2050,2050,2050,2029,2060,2026,,,,,,,,,,,2035,2030,2030,2060,2035,2050,2050,2050,,,,,
yearset,,,,,,,2010..2060..10,,,,,,,,,,,,,2010..2050..5,2010..2050..5,2010..2060..10,,,2010_2025_2050,2010..2050..5,,,,,
yearset,,,,,,,2010..2060..10,,,,,,,,,,,,,2010..2050..5,2010..2050..5,2010..2060..10,,2010..2050..5,2010_2025_2050,2010..2050..5,,,,,
GSw_ZoneSet,,,,,,,z54,z3109,,,,,,,z3109,z3109,z3109,PJMcounty,,,,z54,z134,z54,z48,,,,,,
GSw_GasCurve,2,,1,1,,,,,,,,,,,,,,,,,,,,1,1,,,,,,
GSw_Geothermal,,,,2,,,,,,,,,,,,,,,,,,,0,,0,,,,,,
Expand Down
2 changes: 0 additions & 2 deletions docs/source/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -1886,8 +1886,6 @@
- **Dollar year:** 2004
- **Citation:** [https://www.nlr.gov/gis/psh-supply-curves.html](https://www.nlr.gov/gis/psh-supply-curves.html)
- [rev_paths.csv](/inputs/supply_curve/rev_paths.csv)
- [sc_point_gid_old2new.csv](/inputs/supply_curve/sc_point_gid_old2new.csv)
- [sitemap.h5](/inputs/supply_curve/sitemap.h5)
- [supplycurve_egs-reference.csv](/inputs/supply_curve/supplycurve_egs-reference.csv)
- [supplycurve_upv-limited.csv](/inputs/supply_curve/supplycurve_upv-limited.csv)
- **Description:** UPV supply curve from reV for the limited siting scenario
Expand Down
2 changes: 0 additions & 2 deletions docs/sources.csv
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@ RelativeFilePath,RelativeFolderPath,FileName_new,FileExtension,Description_new,I
/inputs/supply_curve/PSH_supply_curves_cost_8hr_wExist_wEph_apr2025.csv,/inputs/supply_curve,PSH_supply_curves_cost_8hr_wExist_wEph_apr2025,.csv,,,,,,
/inputs/supply_curve/PSH_supply_curves_cost_8hr_wExist_wEph_mar2024.csv,/inputs/supply_curve,PSH_supply_curves_cost_8hr_wExist_wEph_mar2024,.csv,PSH supply curve cost assuming 8 hour duration and allowing sites using existing reservoirs and on ephemeral streams as used in 2024 Annual Technology Baseline,,2004,https://www.nlr.gov/gis/psh-supply-curves.html,,
/inputs/supply_curve/rev_paths.csv,/inputs/supply_curve,rev_paths,.csv,,,,,,
/inputs/supply_curve/sc_point_gid_old2new.csv,/inputs/supply_curve,sc_point_gid_old2new,.csv,,,,,,
/inputs/supply_curve/sitemap.h5,/inputs/supply_curve,sitemap,.h5,,,,,,
/inputs/supply_curve/supplycurve_egs-reference.csv,/inputs/supply_curve,supplycurve_egs-reference,.csv,,,,,,
/inputs/supply_curve/supplycurve_upv-limited.csv,/inputs/supply_curve,supplycurve_upv-limited,.csv,UPV supply curve from reV for the limited siting scenario,,specified in inputs/supply_curve/dollaryear.csv,https://docs.nlr.gov/docs/fy25osti/91900.pdf,,capacity numbers are in MW_DC and cost numbers are in $/MW_AC
/inputs/supply_curve/supplycurve_upv-open.csv,/inputs/supply_curve,supplycurve_upv-open,.csv,UPV supply curve from reV for the open siting scenario,,specified in inputs/supply_curve/dollaryear.csv,https://docs.nlr.gov/docs/fy25osti/91900.pdf,,capacity numbers are in MW_DC and cost numbers are in $/MW_AC
Expand Down
6 changes: 0 additions & 6 deletions docs/sources_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3167,12 +3167,6 @@
- [rev_paths.csv](/inputs/supply_curve/rev_paths.csv)
---

- [sc_point_gid_old2new.csv](/inputs/supply_curve/sc_point_gid_old2new.csv)
---

- [sitemap.h5](/inputs/supply_curve/sitemap.h5)
---

- [supplycurve_egs-reference.csv](/inputs/supply_curve/supplycurve_egs-reference.csv)
---

Expand Down
66 changes: 1 addition & 65 deletions hourlize/write_site_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,71 +70,7 @@
inflatable = reeds.io.get_inflatable()


#%%### Procedure 1: Create sitemap.h5 from full raster and supply-curve sites ######
#%% Get the full raster from Gabe Zuckerman 20250819
dfraster = pd.read_csv(
filepaths['esri_102008'],
comment='#',
index_col='sc_point_gid',
).drop(columns=['Unnamed: 0'], errors='ignore')

## Geohydro has some weird off-grid sites so leave them out
techs = ['upv', 'wind-ons', 'egs']
#%% Get all sc_point_gid's included in all supply curves
rev_paths = pd.read_csv(
os.path.join(reeds.io.reeds_path, 'inputs', 'supply_curve', 'rev_paths.csv')
)
rev_paths = rev_paths.loc[rev_paths.tech.isin(techs)].copy()
dictin_sc = {}
for i, row in tqdm(rev_paths.iterrows(), total=len(rev_paths)):
dictin_sc[row.tech, row.access_case] = pd.read_csv(
os.path.join(
remotepath,
'Supply_Curve_Data',
row.sc_path,
'reV',
row.original_sc_file,
),
usecols=['sc_point_gid','latitude','longitude']
)
sites = sorted(pd.concat(dictin_sc).sc_point_gid.unique())
#%% Keep those points from the raster and match them to the nearest county
sitemap = (
reeds.plots.df2gdf(dfraster.loc[sites], crs=crs)
.sjoin_nearest(dfcounties, how='left')
.drop(columns=['index_right', 'geometry', 'STATE'], errors='ignore')
)
## Make sure it worked
if len(sitemap) != len(sites):
err = f"Mismatched lengths after county match: {len(sites)} before, {len(sitemap)} after"
raise IndexError(err)
#%% Write it
dfwrite = sitemap.astype({'latitude':np.float32, 'longitude':np.float32}).copy()
## Make sure no missing values
assert (dfwrite.isnull().sum() == 0).all()
## Make sure int32 is ok for the index
assert dfwrite.index.max() <= 2**31-1
dfwrite.index = dfwrite.index.astype(np.int32)
outpath = os.path.join(reeds.io.reeds_path, 'inputs', 'supply_curve', 'sitemap.h5')
if os.path.exists(outpath):
os.remove(outpath)
reeds.io.write_to_h5(
dfwrite.reset_index(),
'data',
outpath,
attrs={'index':'sc_point_gid', 'crs':crs_old},
)
#%% Make sure it worked
assert (dfwrite == reeds.io.read_h5_groups(outpath)).all().all()
#%% Take a look
dfplot = reeds.plots.df2gdf(dfwrite, crs=crs_old)
dfplot.plot(figsize=(14,11), lw=0, marker='s', markersize=1.5)
m = dfplot.explore(color='red')
m.save(os.path.expanduser('~/Desktop/sitemap.html'))



#%%### Procedure 2: Format interconnection costs into .h5 files used in ReEDS ######
#%%### Procedure: Format interconnection costs into .h5 files used in ReEDS ######
#%% Get data
dictin = {
key: pd.read_csv(filepaths[key], index_col='sc_point_gid')
Expand Down
Loading
Loading