About Python ssc.data_get_number() function

  • rhodria
  • Topic Author
More
21 Dec 2017 15:25 #5980 by rhodria
Hi everyone,
I am trying to get some values using ssc.data_get_number() function in Python. I can get values like
subarray1_gcr,
subarray2_gcr,
subarray1_tilt,
kwh_per_kw, and
annual_energy,
but it didn't work for values like
solar_resource,
subarray1_nstrings,
subarray2_nstrings,
total_inverter_capacity,
annual_ac_inv_clip_loss_percent, etc.

We also have a LK code in which we can use get() function to get all of these values. I want to ask how we can get these values in Python.

Here's part of our Python code.
system_capacity_dc[sim_count] = ssc.data_get_number(data, b'system_capacity')
total_inverter_capacity[sim_count] = ssc.data_get_number(data, b'total_inverter_capacity')
dc_ac_ratio[sim_count] = 0#system_capacity_dc[sim_count] / total_inverter_capacity[sim_count]
annual_ac_inv_clip_loss_percent[sim_count] = ssc.data_get_number(data, b'annual_ac_inv_clip_loss_percent')
poa_shading_loss[sim_count] = ssc.data_get_number(data, b'annual_poa_shading_loss_percent')
res_total_installed_cost[sim_count] = ssc.data_get_number(data, b'total_installed_cost')

And here's part of our LK code.
system_capacity_dc[sim_count]=get('system_capacity');
total_inverter_capacity[sim_count]=get('total_inverter_capacity');
dc_ac_ratio[sim_count] = system_capacity_dc[sim_count]/total_inverter_capacity[sim_count];
annual_ac_inv_clip_loss_percent[sim_count]=get('annual_ac_inv_clip_loss_percent');
poa_shading_loss[sim_count]=get('annual_poa_shading_loss_percent');
total_installed_cost[sim_count] = get('total_installed_cost');

Thanks.

Please Log in or Create an account to join the conversation.

  • pgilman
More
02 Jan 2018 13:40 #5981 by pgilman
Replied by pgilman on topic About Python ssc.data_get_number() function
Hello,

I'm not sure exactly what is preventing your code from reading the values of those variables, but here are some things to check:
  • For any variable that is a result, be sure to run a simulation before you try to read its value.
  • Be careful to use the correct function for the data type of the variable that you are reading. For example, don't try to read an array as a number.
  • Make sure that the variable you are reading is either an input or output variable for the compute module you are using.

Your strategy of using LK to test your code and variables is a good one. You can use the data container and module browser in SDKtool to investigate problems with the code because you can quickly see what values of variables are, and what variables are being used.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum