-
Notifications
You must be signed in to change notification settings - Fork 1.1k
"spectral irradiance" variable defintion/standardisation suggestion #2150
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
Comments
Any irradiance quantity could have a corresponding spectral variable. Broadband irradiance (a single number) is an integration over wavelength of a vector of wavelength-dependent values. I think the plane and nature of the measurement matter. Perhaps "_spectral" is a modifier on |
Maybe the lack of experience or the language barrier, but personally I find
I don't dislike that possibility either, but I don't want to clog a name. Regarding |
Good point, I hadn't considered it in that way. However, this formulation might not be as useful at this time since we do not currently have any functions that require the user to specify individual components of spectral irradiance. We do, however, have functions that operate on any spectral irradiance component as an input, so we still need some general variable to represent any spectral irradiance data (eg function 1 and 3 in the additional context of original post)
Fair enough. Feels good as a function argument for the user but a bit long for writing out calculations (but maybe I am just lazy when I write code)
|
+1 to I still favor adding |
Okay based on the discussion so far this sounds reasonable.
Agreed, I do too (you are ahead of your time Cliff!)
Current functions in |
@kandersolar you might be interested in this discussion |
Since I now see I have left |
Since the function is designed to work with spectra (multiple spectrum) as input, I yield, |
"spectrum" variable --> "spectra" (see pvlib#2150)
"spectrum" variable --> "spectra" (see pvlib#2150)
* create * Update spectrum.rst * Update test_spectrum.py * Update mismatch.py update docstring * Update mismatch.py * Update mismatch.py fix docs typesetting * Update mismatch.py * docs, tests * docs, data checks, tests add checks in function for negative irradiance and invalid data type add tests for these checks update docs maths typesetting * Update mismatch.py still trying to typeset the units without using / / between multiple length units * Update mismatch.py trying unicode superscript * Apply suggestions from code review Co-authored-by: Kevin Anderson <[email protected]> * remove comments, inverse fraction * remove comment * Update irradiance.py * Update test_irradiance.py * Update test_irradiance.py * Update irradiance.py update returns statement, change symbols, suppress runtimewarning for division by zero Co-Authored-By: Kevin Anderson <[email protected]> * mixed up my lambdas and gammas:( * change variable name spectral_irr -> spectrum * update variable name in docstring + error messages * Update irradiance.py * Update test_irradiance.py add test for return np.nan in case of zero si input * Apply suggestions from code review Co-authored-by: Cliff Hansen <[email protected]> * Update irradiance.py * Update v0.11.1.rst * Update irradiance.py apple suggestions from code review Co-Authored-By: Adam R. Jensen <[email protected]> * Update irradiance.py "spectrum" variable --> "spectra" (see #2150) * Update test_irradiance.py "spectrum" variable --> "spectra" (see #2150) * Update test_mismatch.py remove unintentional change * Update v0.11.1.rst apply suggestion from code review Co-Authored-By: Kevin Anderson <[email protected]> * Update irradiance.py sentence correction Co-Authored-By: Kevin Anderson <[email protected]> * update output datatype and associated tests return series in case of dataframe input, add test to verify. Remove unnecessary spaces from tests * Update test_irradiance.py update test for datatype according to suggestion from code review * Update docs/sphinx/source/whatsnew/v0.11.1.rst Co-authored-by: Kevin Anderson <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Cliff Hansen <[email protected]> Co-authored-by: Adam R. Jensen <[email protected]>
Thoughts on the second and third bullet points in the original post?
Is a user guide variable entry necessary, and should existing functions/tests be revised to all use the same |
It is helpful but not necessary
The different input parameter names in |
I am now stuck in a loop of wanting to be helpful but not be unnecessary
Ah good observation, I had not noticed that. Since the input for both |
I don't think we want to do that. There are multiple arrays in the output of The simplest change would be to remove the word
|
Ah of course, you are right
I will have a think about modifying / how to modify |
Is your feature request related to a problem? Please describe.
The user guide definition of variables and symbols section (found here) does not currently have a standard definition for "spectral irradiance".
Describe the solution you'd like
Agree a standard definition for spectral irradiance as a variable
I think having a standard "root" variable that can have super/subscripts added to for function-specific requirements would be good, for example, something like
ghi
/ghi_extra
,aoi
/aoi_projection
, ortemp_air
/temp_cell
/temp_dew
(the "root" here beingghi
,aoi
, andtemp
)Add the definition to the user guide
Update existing code if required
Additional context
pvlib.spectrum.calc_spectral_mismatch_field
takese_sun
ande_ref
as arguments for field and reference spectral irradiance, respectively.pvlib.spectrum.spectrl2
andpvlib.spectrum.get_reference_spectra
both usespectra
inside the code (no spectral irradiance user-facing argument)pvlib.spectrum.average_photon_energy
(PR) could also benefit from thisSuggestions: (updated from comments)
si
, (si_sun
,si_ref
...)spectral_irr
e
spectrum
spectra
spectral_irradiance
_spectral
(suffix, e.g.ghi_spectral
)e_sun
ande_ref
make sense incalc_spectral_mismatch_field()
but, for a function that doesn't require the_sun
/_ref
specification,e
alone might be ambiguous. I likespectral_irr
as it's clear, but it is potentially too long? A shorter alternative issi
.Thoughts? Other suggestions?
The text was updated successfully, but these errors were encountered: