Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inferring spectral model returns 'first_solar' when not expected #2017

Open
cwhanse opened this issue Apr 25, 2024 · 3 comments · May be fixed by #2253
Open

Inferring spectral model returns 'first_solar' when not expected #2017

cwhanse opened this issue Apr 25, 2024 · 3 comments · May be fixed by #2253

Comments

@cwhanse
Copy link
Member

cwhanse commented Apr 25, 2024

A user reports running a model chain with no spectral model specified and with CEC module parameters. The logic for ModelChain.infer_spectral_model returns first_solar_spectral_loss, which expects 'precipitable_water' to be in the weather input, at which point the user's simulation fails.

To Reproduce
Code posted by user to reproduce the error.

import pandas as pd
import pvlib


from pvlib import clearsky, atmosphere, solarposition
from pvlib.modelchain import ModelChain
from pvlib.location import Location
from pvlib.pvsystem import PVSystem, Array, SingleAxisTrackerMount, AbstractMount, FixedMount
from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS


location = Location(latitude = 40.30117520975112, longitude = -3.6973221576701967, tz = "Europe/Madrid", altitude = 660, name = 'Ormazabal Getafe')
modules = pvlib.pvsystem.retrieve_sam('CECMod')
inverters = pvlib.pvsystem.retrieve_sam('CECInverter')
module = modules['JA_Solar_JAP72S01_330_SC']
inverter = inverters['SMA_America__STP_33_US_41__480V_']
temp_par = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_glass']
system = PVSystem(surface_tilt = 19, surface_azimuth = 170, module_parameters = module, inverter_parameters = inverter,
                  temperature_model_parameters = temp_par, modules_per_string = 17, strings_per_inverter = 6)
modelchain = ModelChain(system, location, aoi_model = 'physical')

times = pd.date_range(start = '2023-06-01', end = '2023-12-15', freq = 'h', tz = location.tz)
solar_position = location.get_solarposition(times)
clearsky = location.get_clearsky(times)

modelchain.run_model(clearsky)

Expected behavior
While the CEC database has enough information (cell technology) to select parameters for the First Solar spectral model, doing so creates an expectation that the user has the inputs for that model. We can't check weather data at the time that ModelChain.spectral_model is set. I am inclined to think that the elif here should go away.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

  • pvlib.__version__: 0.10.5
@mikofski
Copy link
Member

@echedey-ls
Copy link
Contributor

Is anybody working on this? I may be able to fix it next week.

@cwhanse
Copy link
Member Author

cwhanse commented Oct 2, 2024

I am not working on it - you are welcome to fix it.

echedey-ls added a commit to echedey-ls/pvlib-python that referenced this issue Oct 11, 2024
@echedey-ls echedey-ls linked a pull request Oct 11, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants