Skip to content

Add NSRDB PSM4 polar and polar TMY iotools#2807

Open
AdamRJensen wants to merge 14 commits into
pvlib:mainfrom
AdamRJensen:add-nsrdb-polar-iotools
Open

Add NSRDB PSM4 polar and polar TMY iotools#2807
AdamRJensen wants to merge 14 commits into
pvlib:mainfrom
AdamRJensen:add-nsrdb-polar-iotools

Conversation

@AdamRJensen

@AdamRJensen AdamRJensen commented Jul 5, 2026

Copy link
Copy Markdown
Member
  • Closes Add NSRDB polar datasets #2639, see also Adding functions for retrieving NSRDB PSM4 Polar datasets #2640
  • I am familiar with the contributing guidelines
  • I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib license
  • Tests added
  • Updates entries in docs/sphinx/source/reference for API changes.
  • 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`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

@AdamRJensen AdamRJensen added io remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen marked this pull request as draft July 5, 2026 04:50
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 5, 2026
@AdamRJensen AdamRJensen marked this pull request as ready for review July 5, 2026 05:34
@AdamRJensen

Copy link
Copy Markdown
Member Author

Ready for review!

Test failures are unrelated.

@IoannisSifnaios IoannisSifnaios left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only (?) difference between the get_nsrdb_psm4_polar and get_nsrdb_psm4_polar_tmy is that the second has year='tmy' (and a different URL). I assume you split it into two functions to follow the iotools convention, but honestly I could easily see it being one function...

I guess you could add a test for a bad request (api_key or location).

Otherwise LGTM (but I couldn't evaluate the readthedocs)!

Comment thread pvlib/iotools/psm4.py
Comment thread pvlib/iotools/psm4.py
Comment thread pvlib/iotools/psm4.py
Comment thread pvlib/iotools/psm4.py Outdated
Comment on lines +656 to +659
latitude : float or int
in decimal degrees, between 60 and 90 degrees north
longitude : float or int
in decimal degrees, between -180 and 180, east is positive

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't easily find the locations where data exists. Is there some link we could provide or something (even the NSRDB API example is a bit confusing because they report longitude first...)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This info has been added to the documentation:

The dataset provides data from 2013 onwards over the exclusive economic zone above 60 degrees north.

@IoannisSifnaios IoannisSifnaios Jul 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ok, I guess my api key did not work yesterday, and I thought that you couldn't ask for any set of coordinates. I tried it now and it worked fine. All good!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's available above 60N for all longitudes? If so, then I'd remove the added sentence about EEZ, that's just awkward.

Comment thread pvlib/iotools/psm4.py Outdated
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 7, 2026
@AdamRJensen

Copy link
Copy Markdown
Member Author

I guess you could add a test for a bad request (api_key or location).

Tests have been added for erroneous inputs (bad location and bad API key).

@AdamRJensen AdamRJensen requested a review from cwhanse July 8, 2026 00:15
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jul 8, 2026
@AdamRJensen

Copy link
Copy Markdown
Member Author

I think the only (?) difference between the get_nsrdb_psm4_polar and get_nsrdb_psm4_polar_tmy is that the second has year='tmy' (and a different URL). I assume you split it into two functions to follow the iotools convention, but honestly I could easily see it being one function...

The separate functions for PSM4 vs. PSM4_TMY was decided here: #2326 (comment)

Comment thread pvlib/iotools/psm4.py
"""
Retrieve timeseries weather data from the PSM4 NSRDB Polar API.

The NSRDB is described in [1]_ and the NSRDB PSM4 NSRDB Polar v4 dataset

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The NSRDB is described in [1]_ and the NSRDB PSM4 NSRDB Polar v4 dataset
The NSRDB is described in [1]_ and the NSRDB Polar dataset

Comment thread pvlib/iotools/psm4.py
Comment on lines +650 to +651
The dataset provides data from 2013 onwards over the exclusive economic
zone above 60 degrees north. The data have a spatial resolution of 4 km

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EEZ is an awkward description, but taken from the NSRDB webpage. I've contacted them to see if they can clarify.

@AdamRJensen AdamRJensen Jul 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but looking at maps from the NSRDB Polar, then the data availability matches the EEZ.

I've updated the latitude/longitude parameters to mention this.

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if the data don't extend to the pole. then we need something like that statement.

But there are multiple EEZs (they are national, not one international). What about "...above 60 degrees north and within an exclusive economic zone."

Comment thread pvlib/iotools/psm4.py Outdated
Comment on lines +656 to +659
latitude : float or int
in decimal degrees, between 60 and 90 degrees north
longitude : float or int
in decimal degrees, between -180 and 180, east is positive

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's available above 60N for all longitudes? If so, then I'd remove the added sentence about EEZ, that's just awkward.

Comment thread pvlib/iotools/psm4.py
Comment thread pvlib/iotools/psm4.py Outdated
Comment on lines +791 to +798
The NSRDB is described in [1]_ and the NSRDB PSM4 Polar TMY v4 dataset is
described in [2]_, [3]_. The polar dataset extends NSRDB coverage to high
latitude polar regions, that are outside the field of view of the
geostationary satellites.

The dataset provides typical year data over the exclusive economic zone
above 60 degrees north. The data have a spatial resolution of 4 km and a
temporal resolution of 1 hour.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirror the text from get_nsrdb_psm4_polar

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text is already almost identical for the two functions, with the only difference being that the get_nsrdb_psm4_polar_tmy function mentions "typical meterological year".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only meant a reminder to update this text, when comments about EEZ are resolved for the other function.

@cwhanse

cwhanse commented Jul 8, 2026

Copy link
Copy Markdown
Member

@cwhanse cwhanse added this to the v0.15.3 milestone Jul 8, 2026
@AdamRJensen

Copy link
Copy Markdown
Member Author

Need to add two lines to this file: https://github.com/pvlib/pvlib-python/blob/main/docs/sphinx/source/reference/iotools.rst

@cwhanse I don't understand this comment, the two functions have already been added to the page. Maybe I'm missing something.

@cwhanse

cwhanse commented Jul 8, 2026

Copy link
Copy Markdown
Member

Need to add two lines to this file: https://github.com/pvlib/pvlib-python/blob/main/docs/sphinx/source/reference/iotools.rst

@cwhanse I don't understand this comment, the two functions have already been added to the page. Maybe I'm missing something.

I missed it. Please disregard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io remote-data triggers --remote-data pytests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add NSRDB polar datasets

3 participants