Running irradproc submodule with PySSC

2 posts / 0 new
Last post
caseyzak24
Running irradproc submodule with PySSC

I am attempting to use the irradproc module and the PySSC wrapper to calculate sun zenith angle. Here is my Python code:


sp=SolarProject()
ssc = PySSC()
ssc.module_exec_set_print(0)
#create the data container where everthing gets carried around
wfd = ssc.data_create()
ssc.data_set_array(wfd,b'beam',[0]*8760)
ssc.data_set_array(wfd,b'diffuse',[0]*8760)
ssc.data_set_number(wfd, b'lat', sp._lat)
ssc.data_set_number(wfd, b'lon', sp._lon)
ssc.data_set_number(wfd, b'tz', sp._tz)
ssc.data_set_array(wfd, b'year', sp._year.tolist())
ssc.data_set_array(wfd, b'month', sp._month.tolist())
ssc.data_set_array(wfd, b'day', sp._day.tolist())
ssc.data_set_array(wfd, b'hour', sp._hour.tolist())
ssc.data_set_array(wfd, b'minute', sp._minute.tolist())
ssc.data_set_number(wfd, b'azimuth', sp.azimuth)
ssc.data_set_number(wfd, b'track_mode', 1)

####RUN THE SIMULATION####
module = ssc.module_create(b'irradproc')
if ssc.module_exec(module, wfd) == 0:
print('irradproc simulation error')
idx = 1
msg = ssc.module_log(module, 0)
while (msg != None):
print(' : ' + msg.decode("utf - 8"))
msg = ssc.module_log(module, idx)
idx = idx + 1
SystemExit( "Simulation Error" );
ssc.module_free(module)
#Check the desired output
np.array(ssc.data_get_array(wfd, b'sun_zen'))[:100]

I get the following error:


irradproc simulation error
: ssc variable does not exist: 'global'

I am not sure if the error is because PySSC is setup to only run the pvsamv1 and PySSC is asking for something that ssc doesn't have in this case or if this is an error internal to the compiled ssc libraries. OR, perhaps I am just using the submodule wrong.

Any help with this issue would be greatly appreciated.

ozsolarwind

Casey

See my response to your post on the SAM forum -> https://sam.nrel.gov/comment/8563#comment-8563

Kind regards

Angus

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer