intake / intake-xarray

Intake plugin for xarray
https://intake-xarray.readthedocs.io/
BSD 2-Clause "Simplified" License
76 stars 36 forks source link

Name of xarray object should be name of intake object #15

Open jsignell opened 6 years ago

jsignell commented 6 years ago

Outputting named xarray.DataArrays would make it easier to convert to xarray.Datasets and plot.

This should be very straightforward and large reward.

martindurant commented 6 years ago

Where would the name come from? This applies only to rasterIO or also elsewhere?

jsignell commented 6 years ago

Where would the name come from?

The name is the key in the catalog. It is already an attribute on the intake object. For example:

>>>cat.us_crime.name
'us_crime'

This applies only to rasterIO or also elsewhere?

I think it should apply everywhere, maybe in other plugins as well, but I haven't explored thoroughly. The pandas analogy for an xr.DataArray is a pd.Series which can also have a name. Naming these things just makes it easier to go to the next order object (xr.Dataset or pd.DataFrame)

martindurant commented 6 years ago

I see, that makes sense.