Skip to content

Commit

Permalink
Merge pull request #451 from NREL/bnb/meta_enum
Browse files Browse the repository at this point in the history
Bnb/meta enum
  • Loading branch information
ppinchuk authored May 30, 2024
2 parents e1d6163 + b267dac commit 081d70e
Show file tree
Hide file tree
Showing 75 changed files with 11,316 additions and 7,117 deletions.
5 changes: 2 additions & 3 deletions examples/aws_pcluster/make_project_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
from rex import Resource


if __name__ == '__main__':
fp = '/nrel/nsrdb/v3/nsrdb_2019.h5'
fp = '/nrel/wtk/conus/wtk_conus_2007.h5'
Expand All @@ -22,7 +21,7 @@

print(meta[mask])
pp = meta[mask]
pp['gid'] = pp.index.values
pp["gid"] = pp.index.values
pp['config'] = 'def'
pp = pp[['gid', 'config']]
pp = pp[["gid", 'config']]
pp.to_csv('./points_front_range.csv', index=False)
25 changes: 15 additions & 10 deletions examples/bespoke_wind_plants/single_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
"""
An example single run to get bespoke wind plant layout
"""
import numpy as np
import matplotlib.pyplot as plt
from reV.bespoke.bespoke import BespokeSinglePlant
from reV.bespoke.plotting_functions import plot_poly, plot_turbines,\
plot_windrose
from reV import TESTDATADIR
from reV.supply_curve.tech_mapping import TechMapping

import json
import os
import shutil
import tempfile

import matplotlib.pyplot as plt
import numpy as np

from reV import TESTDATADIR
from reV.bespoke.bespoke import BespokeSinglePlant
from reV.bespoke.plotting_functions import (
plot_poly,
plot_turbines,
plot_windrose,
)
from reV.supply_curve.tech_mapping import TechMapping

SAM = os.path.join(TESTDATADIR, 'SAM/i_windpower.json')
EXCL = os.path.join(TESTDATADIR, 'ri_exclusions/ri_exclusions.h5')
RES = os.path.join(TESTDATADIR, 'wtk/ri_100_wtk_{}.h5')
Expand All @@ -29,7 +33,7 @@
'ri_reeds_regions': {'inclusion_range': (None, 400),
'exclude_nodata': False}}

with open(SAM, 'r') as f:
with open(SAM) as f:
SAM_SYS_INPUTS = json.load(f)

SAM_SYS_INPUTS['wind_farm_wake_model'] = 2
Expand All @@ -56,7 +60,8 @@
1E5 * 0.1 + (1 - 0.1))"""
objective_function = "cost / aep"

output_request = ('system_capacity', 'cf_mean', 'cf_profile')
output_request = ('system_capacity', 'cf_mean',
'cf_profile')
gid = 33
with tempfile.TemporaryDirectory() as td:
excl_fp = os.path.join(td, 'ri_exclusions.h5')
Expand Down
5 changes: 3 additions & 2 deletions examples/marine_energy/plot_lcoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
Simple plot script for wave LCOE
"""
import os
import pandas as pd

import matplotlib.pyplot as plt
import pandas as pd

fps = ['./atlantic_rm5/atlantic_rm5_agg.csv',
'./pacific_rm5/pacific_rm5_agg.csv',
]

for fp in fps:
df = pd.read_csv(fp)
a = plt.scatter(df.longitude, df.latitude, c=df['mean_lcoe'],
a = plt.scatter(df.longitude, df.latitude, c=df["mean_lcoe"],
s=0.5, vmin=0, vmax=1500)
plt.colorbar(a, label='lcoe_fcr ($/MWh)')
tag = os.path.basename(fp).replace('_agg.csv', '')
Expand Down
Loading

0 comments on commit 081d70e

Please sign in to comment.