Is your feature request related to a problem? Please describe.
If we have a fieldlist to_numpy() gives back a 2D numpy array containing all the field values per field. We can slice this array according to the second (per field axis) like that:
ds = from_source("file", "my.grib")
v = ds.to_numpy(flatten=True)[:, :4]
This could be done in a more memory efficient way if we performed the slicing on the field level and to_numpy() returned the already sliced 2D array. This could be done e.g. by implementing the following interface:
ds = from_source("file", "my.grib")
v = ds.to_numpy(flatten=True, index=slice(None, 4))
Is your feature request related to a problem? Please describe.
If we have a fieldlist
to_numpy()
gives back a 2D numpy array containing all the field values per field. We can slice this array according to the second (per field axis) like that:This could be done in a more memory efficient way if we performed the slicing on the field level and
to_numpy()
returned the already sliced 2D array. This could be done e.g. by implementing the following interface:Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
Organisation
ECMWF