- Posts: 2
pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required
- NRCan_EH
- Topic Author
Less
More
09 Jan 2023 14:40 #11813
by NRCan_EH
pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required was created by NRCan_EH
I am getting an error using pvwattsv8 when using self defined weather data.
I have made sure all the weather data length are 8760.
the error I am getting is
Code:
import PySAM.Pvwattsv8 as pv8
PVWATTSNONE = pv8.default('PVWattsNone')
def sam_pvwatts8(system_capacity=1, tilt=None, losses=0.2, array_type=0,
GHI=None, DNI=None, DHI=None, lat=None, lon=None, temp=None,
wind_speed=None, time_zone_UTC=None, elev=None, albedo=None,
filename=None, **kwargs):
pv_model = pv.new()
pv_model.SystemDesign.assign(PVWATTSNONE.SystemDesign.export())
pv_model.AdjustmentFactors.assign(PVWATTSNONE.AdjustmentFactors.export())
if albedo is None:
albedo = np.full(8760, 0.2)
# print('creating solar_resource_data')
solar_resource_data = {'solar_resource_data':
{'lat': lat,
'lon': lon,
'tz': time_zone_UTC,
'tdry': tuple(temp),
'alb': tuple(albedo),
'wspd': tuple(wind_speed),
'dn': tuple(DNI),
'df': tuple(DHI),
'gh': tuple(GHI)}}
if not (elev is None):
solar_resource_data['solar_resource_data']['elev'] = elev
# print('assigning locationandresource data')
pv_model.LocationAndResource.assign(solar_resource_data)
if tilt is None:
tilt = lat
# print('assigning systemdesign data')
# add tilt and losses to kwargs dictionary
kwargs['system_capacity'] = system_capacity
# print(tilt)
kwargs['tilt'] = tilt
kwargs['losses'] = 100*losses
kwargs['array_type'] = array_type
# convert losses to percentage. is passed in as decimal to be
# consistent with wind power function.
pv_model.SystemDesign.assign(kwargs)
# print('before execute')
pv_model.execute()
return pv_model
I have made sure all the weather data length are 8760.
the error I am getting is
Code:
pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required in weather data for subhourly data or data that is not continuous over one year.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
10 Jan 2023 10:51 #11821
by pgilman
Replied by pgilman on topic pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required
Hi Eric,
If your weather data has fewer or more than 8760 hourly records, you should provide year, month, day, hour, and minute values for each time step. The pvwattsv8 module uses these values for sun angle calculations.
Best regards,
Paul.
If your weather data has fewer or more than 8760 hourly records, you should provide year, month, day, hour, and minute values for each time step. The pvwattsv8 module uses these values for sun angle calculations.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- NRCan_EH
- Topic Author
Less
More
- Posts: 2
10 Jan 2023 12:27 #11824
by NRCan_EH
Replied by NRCan_EH on topic pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required
is there a format the year, month, day, hour, and minute needs to be?
I am now getting this error
I am creating those data here:
I am now getting this error
Code:
compute fail(pvwattsv8): hour_of_year input month, day, or hour out of correct range for m-d-h: 1=0-0
I am creating those data here:
Code:
time = pd.DatetimeIndex(pd.date_range(start=f'2019-01-01', end='2019-12-31 23:00', freq='H'))solar_resource_data = {'solar_resource_data':
{'lat': lat,
'lon': lon,
'tz': time_zone_UTC,
'tdry': tuple(temp),
'alb': tuple(albedo),
'wspd': tuple(wind_speed),
'dn': tuple(DNI),
'df': tuple(DHI),
'gh': tuple(GHI)
'year': time.year,
'month': time.month,
'day': time.day,
'hour': time.hour,
'minute': time.minute
}}
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
11 Jan 2023 15:17 #11826
by pgilman
Replied by pgilman on topic pvwattsv8 execution error. exec fail(pvwatsv8): Minute column required
Hi Eric,
Those time stamp inputs also need to be tuples. See this example:
github.com/NREL/pysam/blob/master/Examples/NonAnnualSimulation.ipynb
Best regards,
Paul.
Those time stamp inputs also need to be tuples. See this example:
github.com/NREL/pysam/blob/master/Examples/NonAnnualSimulation.ipynb
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman