Using CECMod

102 views
Skip to first unread message

roshni agrawal

unread,
Jun 20, 2025, 11:10:25 AMJun 20
to pvlib-python
Hi everyone,

I want to use recently manufactured module which can be found in one such CECMod database. I have a couple of questions regarding using any module from it.

1. The modelchain object infer aoi_model based on module parameters. However, using any module from CECMod gives this error in infering AOI model.

ValueError: could not infer AOI model from system.arrays[i].module_parameters. Check that the module_parameters for all Arrays in system.arrays contain parameters for the physical, aoi, ashrae, martin_ruiz or interp model; explicitly set the model with the aoi_model kwarg; or set aoi_model="no_loss".

And specifiying it as no loss still gives another error.
mc = ModelChain(system, location, aoi_model = 'no_loss')

Please share your experience in using CECMod database. Please find attached example notebook.

2. Can we access recently updated CEC Module database of SAM using pvlib?

Please share your suggestions.

Kind regards,
Roshni


cecmod example.ipynb

cwh...@sandia.gov

unread,
Jun 20, 2025, 12:27:39 PMJun 20
to pvlib-python
Roshni,

The CECmod data does not include parameters for any AOI model (physical, sapm, ashrae, martin_ruiz) - you have to add those to module_parameters.

What error do you get when setting aoi_model='no_loss'?  That should work.

Cliff

cwh...@sandia.gov

unread,
Jun 20, 2025, 12:31:58 PMJun 20
to pvlib-python
2. Can we access recently updated CEC Module database of SAM using pvlib?

Yes, you should be able to open that file (after saving it locally) using `pvsystem.retrieve_sam`. If you find issues, please report them :)

Cliff

roshni agrawal

unread,
Jun 26, 2025, 7:13:29 AMJun 26
to pvlib-python
Thanks you Cliff.

As CECMod modules don't have parameters for AOI model, using AOI model like no_loss,  physical, sapm, ashrae, and martin_ruiz works. 

mc = ModelChain(system, location, aoi_model = 'physical')
However, while using CECMod, spectral model inferred in modelchain is 'first_solar' which gives an error for missing 'precipitable_water'. Hence, not only I have to specifify AOI model but also compatible spectral model as 'no_loss' to run.

I am able to read SAM's database by specifying path in retrieve_sam. That's quite useful.

Can we change parameters of specified models in modelchain?
As I understand, modelchain with call AOI model 'physical' with its default parameters (pvlib.iam.physical(aoi, n=1.526, K=4.0, L=0.002, *, n_ar=None)). How to specify n_ar and run the modelchain as usual?

Looking forward to your suggestions.

Kind regards,
Roshni

cwh...@sandia.gov

unread,
Jun 26, 2025, 6:33:35 PMJun 26
to pvlib-python
Hi Roshni,

Can we change parameters of specified models in modelchain?

Yes. If you want different parameters for the AOI model, you can add them to module_parameters. The documentation is not clear on that point; something I will note for improvement.

What version of pvlib are you using? In v0.12, we remove the inferring of the spectral model, since we couldn't resolve the error you got in a way that felt right.

Cliff

N Dabouz

unread,
Jun 27, 2025, 5:05:19 AMJun 27
to cwh...@sandia.gov, pvlib-python
Hi Roshni, I encountered the same issue : 
Here’s what I did : 
mc1 = ModelChain(system1, location, aoi_model="no_loss")
weather['precipitable_water'] = 1.5 
weather['ozone'] = 0.3

Hope this works for you ;)

Nadine

--
You received this message because you are subscribed to the Google Groups "pvlib-python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pvlib-python...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pvlib-python/02c6e785-9c8a-4920-a11d-bfea26db3a44n%40googlegroups.com.

Message has been deleted

roshni agrawal

unread,
Jul 1, 2025, 9:24:59 AMJul 1
to pvlib-python
Thanks Cliff. I was using v0.11 and it explains the issue well. v0.13 uses 'no_loss' spectral model and runs without any issue. Also, adding n_ar to module makes it easy to model with specific parameters.

Thanks Nadine for the workaround. I could use 'first_solar' spectral model after adding required fields to weather data.

Kind regards,
Roshni

Reply all
Reply to author
Forward
0 new messages