Code Monkey home page Code Monkey logo

Comments (5)

Zeitsperre avatar Zeitsperre commented on July 22, 2024

@agstephens Interesting. You mean how best to implement subset along a z/elevation axis? I think it would make the most sense there as well. I don't imagine it would be too difficult to implement.

from clisops.

agstephens avatar agstephens commented on July 22, 2024

@Zeitsperre: yes, we are talking about the "z" axis. Let's discuss when we meet how to set this up in clisops.core.subset.

I am hoping that the Xarray/Dask lazy evaluation means that we can chain a subset_level function with the other existing functions rather than modifying what already works.

from clisops.

agstephens avatar agstephens commented on July 22, 2024

I think that we should consider this in the same way subset_time is addressed within the subset_bbox function:

def subset_bbox(

subset_bbox has the optional arguments start_date and end_date, at the end of the function there is optionally a call to subset_time.

We could imagine that the 'z' axis could be handled in the same way, by adding (and integrating) the following:

def subset_level(ds, start_level, end_level)

This would need to:

  • check available levels overlap with the level range provided
  • reverse the start_level and end_level if they are ordered differently to the values in the level axis - this is reasonable because the user may not know how the file is structured
  • select the data within the level range provided

from clisops.

Zeitsperre avatar Zeitsperre commented on July 22, 2024

I realize that the number of existing decorators is getting a bit unwieldy but given that checks exist for X and Y dims, the best option I would suggest for the start_level and end_level checks would be to write a check_levels decorator (or expand the check_lons as I mentioned in #65) to be able to add this easily to other subsetting functions.

If a function is written to perform the Z-axis subsetting, it can be added to all other subsetting functions, as needed. In-depth level check could be added to either function or the decorator, I imagine.

With all these different functions, it would be interesting to consider alternative means of calling these functions down-the-line Perhaps something to consider if clisops proceeds with #37.

from clisops.

agstephens avatar agstephens commented on July 22, 2024

Now merged into master.

from clisops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.