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

Scale on load #21

Merged
merged 7 commits into from
Jul 24, 2020
Merged

Scale on load #21

merged 7 commits into from
Jul 24, 2020

Conversation

MRossol
Copy link
Collaborator

@MRossol MRossol commented Jul 24, 2020

Add ability to scale datasets during rechunk

@MRossol MRossol added the feature New feature or request label Jul 24, 2020
@MRossol MRossol requested a review from grantbuster July 24, 2020 16:36
@MRossol
Copy link
Collaborator Author

MRossol commented Jul 24, 2020

@grantbuster If you don't have time to review np, I tested this on the Solar Vietnam data for Paul. That said I did add a really cool Retry Decorator from my hsds_etl package that I had forgotten about that you should check out!

@grantbuster
Copy link
Member

Yeah the rechunk utils are your domain, go for it!

@grantbuster
Copy link
Member

Send me a link to the retry decorator?

@MRossol MRossol merged commit af6401b into master Jul 24, 2020
@MRossol MRossol deleted the scale_on_load branch July 24, 2020 16:44
github-actions bot pushed a commit that referenced this pull request Jul 24, 2020
@ryancoe
Copy link
Contributor

ryancoe commented May 12, 2022

@grantbuster - When I do the following, do I need to apply a scale factor, or is this applied automatically? (From what I can see, I would guess that I do need to scale it manually.)

from rex import WindX

wtk_file = '/nrel/wtk/hawaii/Hawaii_2010.h5'
lat_lon = (19.3131, -163) # xy[0,:]
with WindX(wtk_file, hsds=True) as f:
    wspd = f.get_lat_lon_df('windspeed_100m', lat_lon)

@MRossol
Copy link
Collaborator Author

MRossol commented May 12, 2022

@ryancoe you do not need to do any manual scalig. rex scales the resource data back to native units automatically. That's one of its primary functions.

@ryancoe
Copy link
Contributor

ryancoe commented May 12, 2022

Thanks @MRossol! I think I must be messing something up, because to me it looks like at 100m up at an offshore location near Hawaii, the average wind speed in 2010 was 130 m/s?

from rex import WindX

wtk_file = '/nrel/wtk/hawaii/Hawaii_2010.h5'
lat_lon = (19.3131, -163) # xy[0,:]
with WindX(wtk_file, hsds=True) as f:
    wspd = f.get_lat_lon_df('windspeed_100m', lat_lon)

fig, ax = plt.subplots()
wspd.plot(ax=ax)
ax.axhline(nwtc_wspd.mean().values,color='r')

output

Hawaii_FINAL_SPD100m_26July04
https://energy.hawaii.gov/wp-content/uploads/2011/10/Hawaii_FINAL_SPD100m_26July04.pdf

@MRossol
Copy link
Collaborator Author

MRossol commented May 12, 2022

Hmm, that does look suspect. Can you try:

  1. a different location?
  2. a different year?

@ryancoe
Copy link
Contributor

ryancoe commented May 12, 2022

Thanks again for your help @MRossol.

Looks similarly fishy for 22°00'00.0"N 159°00'00.0"W in 2012 (which shows up on the AWS sheet above as 7.5-8.0 m/s).

output

@MRossol
Copy link
Collaborator Author

MRossol commented May 12, 2022

Fishy indeed! @grantbuster Do you know if the Hawaii data has been updated recently? Might be worth checking with Jay or John to see if the scaling is messed up in HSDS.

@grantbuster
Copy link
Member

on Eagle, the hawaii wind data hasnt been updated since 2020. I'll forward this chain to Jay and see if he can check the hsds data.

@ryancoe
Copy link
Contributor

ryancoe commented May 25, 2022

hi guys - any updates on this? Should we create a separate issue?

@grantbuster
Copy link
Member

This isnt a software issue as far as i can tell. Pretty sure you just need to get Jay to reupload the data to hsds. I asked but he's busy.

@MRossol
Copy link
Collaborator Author

MRossol commented May 25, 2022

@ryancoe try submitting an issue here:
https://github.com/openEDI/documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants