Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

subset_point() output should be compatible with subset_spatial() #555

Closed
forman opened this issue Mar 12, 2018 · 5 comments
Closed

subset_point() output should be compatible with subset_spatial() #555

forman opened this issue Mar 12, 2018 · 5 comments
Assignees

Comments

@forman
Copy link
Member

forman commented Mar 12, 2018

Expected behavior

I'd expect the subset_point() operation to output a xarray.Dataset instance exactly like subset_spatial() does. All metadata and all coordinate variables shall be preserved so that we can also visualize the single spatial cells without making any difference in the code.

Actual behavior

subset_point() returns a dict. This is currently only useful in the API (i.e. Jupyter Notebook). It is useless in the CLI and Cate Deskop GUI, so we can neither plot it nor show it on the globe.

If the dict is really required by some use case, I suggest introducing an optional input output_dict=False.

Specifications

Cate 1 and 2-dev1

@JanisGailis
Copy link
Member

It's used in UC9, but I think that's legacy, as the pearson_correlation() should work just fine with a dataset containing a single pixel.

@JanisGailis JanisGailis self-assigned this Mar 12, 2018
@JanisGailis
Copy link
Member

And it's tseries_point of course. There's no subset_point. @forman, do you think we should rename it, and leave tseries_point as a deprecated alias?

@forman
Copy link
Member Author

forman commented Mar 13, 2018

Sorry Janis, my fault. Marco added this recently to display dataset values in the GUI. We'll fix this here.

@forman forman assigned mzuehlke and unassigned JanisGailis Mar 13, 2018
@forman
Copy link
Member Author

forman commented Mar 13, 2018

@JanisGailis what about:

  • subset_spatial should be able to deal with points
  • tseries_point is a deprecated alias
  • we rename subset_point to something else or make it a private operation

@JanisGailis
Copy link
Member

The interface is different though. tseries_point takes an actual PointLike, while subset_spatial takes a PolygonLike. I'll see if subset_spatial can be converted to taking GeometryLike instead and what that entails. I'll also check how the outputs of the two operations differ. E.g., if tseries_point drops lat and lon coordinates or not, as subset_spatial should not do this.

In any case, subset_spatial should work with any valid Polygon, so it entails also working with a Polygon that would select a single point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants