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

Updates to install requirements.txt and multiple files for NASA POWER API integration #27

Closed
wants to merge 20 commits into from

Conversation

dakotaramos
Copy link
Collaborator

@dakotaramos dakotaramos commented Apr 18, 2022

PR updating requirements.txt and requirements-dev.txt with >= logic for versions of PySAM and numpy, resolves errors when installing HOPP with a developer version of PySAM.

PR updating multiple files to accommodate global solar and wind resource data from the NASA POWER Temporal Hourly API (https://power.larc.nasa.gov/docs/services/api/temporal/hourly/). Includes updated test_resource_download.py with two additional NASA resource files.

Example API call for solar data:
url = https://power.larc.nasa.gov/api/temporal/hourly/point?start=20120101&end=20121231&latitude=33.617773&longitude=-114.588261&community=RE&parameters=T2M&format=sam&user=TEST

Example API call for wind data:
url = https://power.larc.nasa.gov/api/temporal/hourly/point?start=20120101&end=20121231&latitude=33.617773&longitude=-114.588261&community=RE&parameters=T2M&format=srw&wind-surface=vegtype_4&wind-elevation=80&site-elevation=80

NOTE:
Dependent on PySAM PRs: NREL/pysam#114 and NREL/pysam#115

  • Solar resource file returned by NASA POWER API contains more fields / data points than NSRDB resource file. No post processing of the file was added in case future use cases may utilize extra data provided. All post processing of solar data dictionary for use by SAM and HOPP occurs within PySAM's ResourceTools.py.

  • Wind resource file: NASA POWER cannot return all 4 data points needed (temp, press, wind speed, and direction) at any user specified hub height. NASA can only provide adjusted wind speed and adjusted pressure at a user specified hub height. NASA POWER does provide the following data points:

    • 2 m: Temp, pressure, speed, direction
    • 10 m: speed and direction
    • 50 m: speed and direction
    • User specified hub height: adjusted speed and adjusted pressure
      No post processing of the file was added.
      All post processing of wind data dictionary for use by SAM and HOPP occurs within PySAM's ResourceTools.py.

@dakotaramos
Copy link
Collaborator Author

@barker59 @dguittet updated this PR with all the changes to the tests mentioned in the email thread from 4/20/2022. The only outstanding issue is Lines 139-143 in test_hybrid.py which fails with an AttributeError

image

Copy link
Collaborator

@dguittet dguittet left a comment

Choose a reason for hiding this comment

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

I think to keep the lat/lon of the tests at the old Texas location, we could modify the locations dictionary in hybrid/sites/locations.py to include (35.2018863, -101.945027, 1099), and for the tests, do a combination of the flatirons_site's boundary data with this Texas location:

from hybrid.sites import SiteInfo, flatirons_site, locations
...
@pytest.fixture
def site():
    # reuse flatirons boundary but set to a different lat/lon
    flatirons_site['lat'] = locations[3][0]
    flatirons_site['lon'] = locations[3][1]
    return SiteInfo(flatirons_site)

I reposted this code in test_dispatch.py's comments to situate it in context. But it would apply to test_hybrid.py and test_layout.py

hybrid/sites/flatirons_site.py Show resolved Hide resolved
hybrid/sites/site_info.py Outdated Show resolved Hide resolved
tests/analysis/test_run_hopp_calc.py Outdated Show resolved Hide resolved
tests/hybrid/test_dispatch.py Outdated Show resolved Hide resolved
tests/hybrid/test_dispatch.py Outdated Show resolved Hide resolved
tests/hybrid/test_resource_download.py Show resolved Hide resolved
hybrid/resource/solar_resource.py Outdated Show resolved Hide resolved
hybrid/resource/wind_resource.py Outdated Show resolved Hide resolved
hybrid/resource/wind_resource.py Outdated Show resolved Hide resolved
}}

# Get resource
lat = flatirons_site['lat']
lon = flatirons_site['lon']
prices_file = examples_dir.parent / "resource_files" / "grid" / "pricing-data-2015-IronMtn-002_factors.csv"
site = SiteInfo(flatirons_site, grid_resource_file=prices_file)
site = SiteInfo(flatirons_site, grid_resource_file=prices_file, api='nrel', vegtype='vegtype_8', hub_height=80)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it may be better to rename vegtype to nasa_vegtype to be explicit. Also, in this example, we are using the NREL api so vegtype isn't required, so it may be confusing to specify it explicitly here as opposed to leaving it blank.

start_date: string
Start date for NASA POWER API call
end_date: string
End date for NASA POWER API call
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think of nasa_start_date and nasa_end_date?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, since it looks like the start and end dates are fixed, they shouldn't be listed in the Parameters section here.

[708.140000000014, 0.0]]
},
'urdb_label': "5ca4d1175457a39b23b3d45e"
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment on flatirons_site.py

Copy link
Collaborator

@dguittet dguittet left a comment

Choose a reason for hiding this comment

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

This is ready to be merged now, but we need to wait for release of PySAM 3.0.2 and of updating HOPP to use 3.0.2

@dakotaramos
Copy link
Collaborator Author

@dguittet thank you for tackling this while I was away. Please let me know if anything further is needed on my end.

@camirmas
Copy link
Collaborator

closing for now, feel free to reopen if I made a mistake

@camirmas camirmas closed this Aug 11, 2023
camirmas pushed a commit to camirmas/HOPP that referenced this pull request Sep 8, 2023
use owned parameters for aep in power_source.simulate_financials over…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants