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

Fix solar resource download geocoding issues #1692

Merged
merged 7 commits into from Feb 19, 2024

Conversation

cpaulgilman
Copy link
Collaborator

@cpaulgilman cpaulgilman commented Feb 8, 2024

Pull Request Template

Description

NSRDB downloads from Solar Resource input page was submitting user input string to geocode() function, assuming that the geocoding API parses the string to determine if it is a street address, location, name, or lat/lon pair. However, geocode() function sends input string to the MapQuest Geocode Address API, which requires a street address or location name as input: https://developer.mapquest.com/documentation/geocoding-api/address/get/. The private NREL developer geocoding API is a wrapper for the MapQuest API, and is not designed to take lat/lon as input.

Items fixed:

  • Update Solar Resource UI callback to not use lat/lon as input geocode function. If user input string appears to be lat/lon, submit that directly to NSRDB instead of geocoding it.
  • Update Advanced Download to show lat/lon returned by geocoding function to help with troubleshooting
  • Revise LK geocode() function documentation to remove lat/lon as input option.
  • Change geocode function to return latLon instead of displayLatLon to latLon. See MapQuest documentation for justification.

Note related issues that will be fixed in separate pull requests:

Fixes #1526

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

If user enters a string that appears to be a lat/lon pair in decimal degrees, submit that directly to the  NSRDB API instead of attempting to geocode it.
This shows lat/lon value that is submitted to NSRDB API to help with troubleshooting geocoding issues.
According to MapQuest API documentation:

latLng "Returns the latitude/longitude for routing and is the nearest point on a road for the entrance."

displayLatLng "A lat/lng pair that can be helpful when showing this address as a Point of Interest."

https://developer.mapquest.com/documentation/geocoding-api/address/get
@cpaulgilman cpaulgilman added this to the 2023 Release Patch 1 milestone Feb 8, 2024
@cpaulgilman cpaulgilman self-assigned this Feb 8, 2024
@cpaulgilman cpaulgilman added the requires help revision Requires a Help revision before releasing public version label Feb 8, 2024
@cpaulgilman
Copy link
Collaborator Author

cpaulgilman commented Feb 8, 2024

Testing this requires building SAM-private. to get that to work, I had to modify the SAM-private CMakeLists.txt to comment out the SDK tool settings:

image

To run the private version from Visual Studio 2022:

  1. Build SAMOS. (open source)
  2. Clean SAM solution and rebuild. (SAM private)
  3. Run SAM.

Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

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

For me, SAM-private built without issue using the unmodified CMakeLists.txt in the patch branch.

The more detailed feedback is great:
image

However, -39,105 creates a callback error:
image

* Add support for all available international datasets from NSRDB, including TMYs where available (psm3-2-2-tmy, himawari-tmy, suny-india-tmy)

* For locations with data available from multiple end points prioritize in order: psm3-2-2, himawari, msg-iodc, suny-india

* Fix callback error when lat/lon for unavailable location submitted
@cpaulgilman
Copy link
Collaborator Author

cpaulgilman commented Feb 17, 2024

@sjanzou ea6c555 should resolve the callback issue and also adds support for downloading international data.

Here's a CSV file with a list of location names and lat/lon pairs for places around the world and available NSRDB datasets and and LK script that creates it that might be helpful for testing: nsrdb-endpoints.zip

Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

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

Working for all valid lat/lon tested and for values for which there is no NSRDB data, returns all information we have; e.g.
image

@cpaulgilman cpaulgilman merged commit 081a9b1 into patch Feb 19, 2024
4 checks passed
@cpaulgilman cpaulgilman deleted the solar_resource_download branch February 19, 2024 16:14
@cpaulgilman cpaulgilman added added to release notes PR and/or issue has been added to release notes for a public release and removed requires help revision Requires a Help revision before releasing public version labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added to release notes PR and/or issue has been added to release notes for a public release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NSRDB geocoding issue
2 participants