Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting values at lat lon in YAXArrays 0.5 #313

Closed
BernhardAhrens opened this issue Aug 15, 2023 · 2 comments
Closed

Extracting values at lat lon in YAXArrays 0.5 #313

BernhardAhrens opened this issue Aug 15, 2023 · 2 comments

Comments

@BernhardAhrens
Copy link

In the documentation, an important section on how to extract values a bunch of lat lon pairs is gone. To my mind, it would be important to have something on this in the documentation.

For reference, here is the documentation that was removed lately:

Indexing and subsetting

As for most array types, YAXArray also provides special indexing behavior
when using the square brackets for indexing. Assuming that c is a YAXArray,
there are 3 different semantics to use the square brackets with, depending on
the types of the arguments provided to getindex.

  1. Ranges and Integers only as for example c[1,4:8,:] will access the underlying data according to the provided index in index space and read the
    data into memory as a plain Julia Array. It is equivalent to c.data[1,4:8,:].
  2. Keyword arguments with values or Intervals as for example c[longitude = 30..50, time=Date(2005,6,1), variable="air_temperature"].
    This always creates a view into the specified subset of the data and
    return a new YAXArray with new axes without reading the data. Intervals and
    values are always interpreted in the units as provided by the axis values.
  3. A Tables.jl-compatible object for irregular extraction of a list of points or sub-arrays and random locations.
    For example calling c[[(lon=30,lat=42),(lon=-50,lat=2.5)]] will extract data at the specified coordinates and along all additional axes into memory.
    It returns a new YAXArray with a new Multi-Index axis along the selected
    longitudes and latitudes.

https://github.com/JuliaDataCubes/YAXArrays.jl/blob/ae03f7c44c86cfa98d90204a8626c37b3a60a17a/docs/examples/UserGuide/creating.jl#L37C1-L37C1

@lazarusA
Copy link
Collaborator

thanks for opening this issue. I removed this because now all indexing is handle by DD, and there are several examples across the docs. However, I do agree that a small section on how to do it with the new syntax should be added. I will try to do something later today, after work 😄 (office-hours).

@lazarusA
Copy link
Collaborator

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

No branches or pull requests

2 participants