pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

Add retrieval function for horizon profile from MINES Paris Tech

Open AdamRJensen opened this issue 4 years ago • 7 comments

  • [x] I am familiar with the contributing guidelines
  • [x] Tests added
  • [x] Updates entries to docs/sphinx/source/api.rst for API changes.
  • [x] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • [x] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • [x] Pull request is nearly complete and ready for detailed review.
  • [x] Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

The proposed function retrieves the local horizon profile for a specific location (latitude, longitude, and elevation). The returned horizon profile has a resolution of 1 degree in the azimuth direction. The service is provided by MINES ParisTech though I cannot find any official documentation for it.

The function added in this PR (pvlib.iotools.get_mines_horizon) is very similar to the function added in #1395 (pvlib.iotools.get_pvgis_horizon).

AdamRJensen avatar Aug 26 '21 10:08 AdamRJensen

@mikofski @cwhanse I saw your discussions in #758 and #1290 and figured I'd share the code I had laying around for downloading the local horizon profile from SRTM. Does this have any interest to you?

AdamRJensen avatar Aug 26 '21 10:08 AdamRJensen

I'm lovin' this! Could we also look into retrieving pvgis horizon data, how do they compare to the SRTM from MINES?

mikofski avatar Aug 26 '21 16:08 mikofski

MINES appears to have slightly changed their API, we need to skip one more row (to 26) horizon = pd.read_csv(io.StringIO(res.text), skiprows=26, nrows=360, delimiter=';')

bgpierc avatar Mar 04 '22 21:03 bgpierc

Thank you @bgpierc! If you are already using it, I'd be happy to hear if you find it useful and how it may compare to other sources you are using.

Within a month or so I'll return and hopefully finish this PR fyi.

AdamRJensen avatar Mar 11 '22 23:03 AdamRJensen

Thanks, I've implemented a similar function to pull from pvgis and one to calculate directly from a DEM in #1395, all three methods appear to line up well (within ~2 degrees MAE) with each other and field data I've taken, so it's looking good

bgpierc avatar Mar 14 '22 15:03 bgpierc

@YvesMSaintDrenan Are you ok with adding this function to pvlib?

AdamRJensen avatar May 28 '23 10:05 AdamRJensen

I'm reluctant to merge this PR without something satisfying in the References section :/

The service has a notably better azimuthal resolution than PVGIS, but I agree that the missing documentation is a bummer.

@YvesMSaintDrenan could you perhaps add a subpage to the SoDa Pro website or upload a short note describing the service somewhere?

AdamRJensen avatar Jun 08 '23 14:06 AdamRJensen