I am attempting to use the
module and the
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
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.