NREL / rex

REsource eXtraction Tool (rex)
https://nrel.github.io/rex
BSD 3-Clause "New" or "Revised" License
19 stars 10 forks source link

How to access OEDI data? #159

Closed rybchuk closed 1 year ago

rybchuk commented 1 year ago

Hello,

I'm trying to access the OEDI offshore wind data, but I'm running into issues identifying the path to the data. Through s3fs, I am able to verify that nrel-pds-wtk/gulf_of_mexico/gulf_2000.h5 is a path

import s3fs

s3 = s3fs.S3FileSystem(anon=True)
s3.ls('nrel-pds-wtk/gulf_of_mexico')
> ['nrel-pds-wtk/gulf_of_mexico/',
> 'nrel-pds-wtk/gulf_of_mexico/gulf_2000.h5',
> 'nrel-pds-wtk/gulf_of_mexico/gulf_2001.h5',
> ...
 > 'nrel-pds-wtk/gulf_of_mexico/gulf_2020.h5',
 > 'nrel-pds-wtk/gulf_of_mexico/yearly_hr']

But when I run the following code, I get OSError: [Errno 404] Not Found

wtk_file2 = '/nrel-pds-wtk/gulf_of_mexico/gulf_2000.h5'
with WindX(wtk_file2, hsds=True) as f:
    meta2 = f.meta
    time_index2 = f.time_index
    # wspd_100m = f['windspeed_100m', :, ::1000]

I'm unfamiliar with S3 systems. Am I misspecifying the location? Thanks!

grantbuster commented 1 year ago

See HSDS instructions: https://nrel.github.io/rex/misc/examples.hsds.html Note the h5pyd.Folder instructions here: https://nrel.github.io/rex/misc/examples.hsds.html#hsds-and-rex-usage-examples

rybchuk commented 1 year ago

Perfect, thanks! After running

with h5pyd.Folder('/nrel/wtk/') as f:
    print(list(f))

I could find the data I wanted.

I was able to open the data with

wtk_file = '/nrel/wtk/gulf_of_mexico/gulf_2000.h5'
my_loc = (28.0000, -85.0000)
with WindX(wtk_file, hsds=True) as f:
    my_loc_wspd = f.get_lat_lon_df('windspeed_100m', my_loc)

Thanks Grant!