earthkit-data
earthkit-data copied to clipboard
How to access latitudes/longitudes on a GribField and FieldList?
At the moment we can access latitudes/longitudes on a GribField as follows (ds
is a FieldList in the examples below):
This call returns a dict: {"lat": array, "lon": array}
ds[0].to_latlon()
This call returns a tuple (lat-array, lon-array)
:
ds[0].data(["lat", "lon"])
This call returns only the latitudes (as an array):
ds[0].data("lat")
We can even use metadata
to get the latitudes, though this type of usage should be discouraged:
ds[0].metadata("latitudes")
On a FieldList we can only call metadata
out of these methods, which would return a list of arrays (one per GribField):
ds.metadata("latitudes")
The following questions arise:
- should we add the convenience methods
latitudes
andlongitudes
to GribField? - should we add
to_latlon
to FieldList? - should we add
data
to FieldList? - should we add
latitudes
andlongitudes
(if we implement them on GribField) to FieldList?