8000 sam iotools #1371 by shirubana · Pull Request #1556 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

sam iotools #1371 #1556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
update samp.py
got it wrong, it should be left labeled. Added other values of use for SAM for wind simulations
  • Loading branch information
shirubana committed Oct 7, 2022
commit 82a24c9eba6d179d2ebeccb1d6b154ba0d41ad34
11 changes: 10 additions & 1 deletion pvlib/iotools/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _is_leap_and_29Feb(s):
((s.index.year % 100 != 0) | (s.index.year % 400 == 0)) & \
(s.index.month == 2) & (s.index.day == 29)

def _averageSAMStyle(df, interval='60T', closed='right', label='right'):
def _averageSAMStyle(df, interval='60T', closed='left', label='left'):
''' Averages subhourly data into hourly data in SAM's expected format.
'''
df = df.resample(interval, closed=closed, label=label).mean()
Expand Down Expand Up @@ -120,6 +120,15 @@ def _fillYearSAMStyle(df, freq='60T'):
if 'poa' in data:
savedata['POA'] = data.poa.values

if 'rh' in data:
savedata['rh'] = data.rh.values

if 'pressure' in data:
savedata['pressure'] = data.pressure.values

if 'wdir' in data:
savedata['wdir'] = data.wdir.values

if 'albedo' in data:
savedata['Albedo'] = data.albedo.values

Expand Down
0