Open shirubana opened 4 years ago
Thanks @shirubana for this initiative.
Would the python code you are preparing need a license separate from pvlib-python? If yes, can you post the license conditions? I suppose the license could be communicated by putting the conditions as comments in the python file, and adding a statement to the pvlib-python license. I'm not sure what conventional practice would be.
Perhaps the wrapper function can require the path to the SMARTS executable as an input.
The license in the Dropbox (for the MATLAB wrapper, not for SMARTS) is the same as for pvlib-python, except for the copyright statement. I think we could put the copyright statement in your python code, and acknowledge the different copyright in pvlib-python's license file.
The SMARTS wrapper is pretty long (line count) with all the comments (which I would retain). I'd put it in it's own file smarts.py rather than adding to irradiance.py
Thanks for looking into this :) That sounds good to me. I'll make the changes.
super excited about this, thanks Silvana! I wonder if someone will take up spectrl2 now?
Hmm... I haven't used that, should look into it. I have a process to go from the SMARTS spectra to spectrally resolved radiance for the cumulative sky for raytrace. That's the motivation behind making this more streamlined.
Ah, IMO spectrl2 is much easier and faster to use than SMARTS, although it may not be as accurate? It's especially useful for inline spectral calculations, because it's limited only to 120 bands that matter, so you can accurately calculate spectral mismatch in real time instead of using a correlation or polynomial fit. There's already a python wrapper by SunPower called SolarUtils but we've talked frequently about porting it to pure python to accelerate it using numba.
@mikofski or anyone else: Just curious, do you know if there are any restrictions on the spectrl2 implementations listed at that link? I don't see a license anywhere on that webpage or in the cited technical report, which also includes a code implementation. Mostly I'm interested in whether the method needs to be implemented de novo or if we could just port one of those implementations.
PS I am aware of the irony of me asking you about NREL's licensing, no need to point it out...
i have a python version of spctrl2 coded, vut haven't tracked down the proper licensing steps for that one yet. it's in my to do...
Sent via the Samsung Galaxy S10, an AT&T 5G Evolution capable smartphone
I have been distributing a Python extension of SOLPOS and SPECTRL2 for years. My view is if it's on the internet then it's public, but they specifically mention the license & disclaimer, so I distribute it with the package here:
In a nutshell the license and disclaimers say:
IMO it's similar to a bsd-2 license
Silvana, AFAIK, this liberal license would allow your port to be a completely license free work. There's no restrictive cop-yright or attribution, in fact the license literally says you can use it anyway you want for free.
paid-up [ie: free] nonexclusive, irrevocable world-wide license to reproduce, prepare derivative works, distribute copies to the public, and perform publicly and display publicly
Therefore it would be awesome if we could pull your port into pvlib. Thanks!
Back in 2018 I sent @cwhanse a Matlab wrapper for SMARTS we used on our UofA laboratory, with permission to publish, but got sidetracked and never documented. I just ported the code to Python and it seems to be working good.
I'll be ding a pull request for the python wrapper.
This is the ` original matlab code_<(https://www.dropbox.com/s/qqmht1vdkq79l8p/SMARTS_MatlabWrapper.rar?dl=0)>
This where some of the highlights from the emails in 2018:
Couple notes: -Not sure how the license extends to the Python code -Right now the functions assume that the SMARTS executable ("smarts295bat.exe") is on the same folder as the function (pvlib folder). This should change depending on how the above wants to be handled, I'd appreciate support for that based on what we decide.
This is kinda related to #71 , but PyRTM had other functionalities as well.