NREL/nsrdb

Generate coordinates dataset for final NSRDB output

Closed this issue · 4 comments

Why this feature is necessary:
Coordinates datasets are often added to final NSRDB data. Might as well have that generated when running nsrdb pipeline.

coordinates:
shape = (n, 2)
dtype = np.float32
order = (lat, lon)

There should probably be an instance method in the reV outputs handler that creates the coordinates dataset with proper chunks, then add a kwarg add_coords=False (false by default, we dont usually need this) to a common entry point:

https://github.com/NREL/reV/blob/d8a5d2c2789246d85690ad581eb3731f80c66bb5/reV/handlers/outputs.py#L874

Actually probably in here (forgot we subclass the reV outputs handler for NSRDB applications):

def init_h5(cls, fout, dsets, attrs, chunks, dtypes, time_index, meta,

bnb32 commented

added coordinate chunks here

if add_coords:
coords = meta[['latitude', 'longitude']].to_numpy()
coords_chunks = ArrayChunkSize.compute(coords)
chunks['coords'] = coords_chunks
and coordinate output here
if add_coords:
f['coords'] = coords.astype(np.float32)