Giter VIP home page Giter VIP logo

Comments (9)

edzer avatar edzer commented on July 18, 2024 1

There already was a

ss2 %>% st_set_dimensions("time", c("DJF", "MAM", "JJA", "SON"))

but the current setup should make this better. Pls test! See also e4d00b2

from stars.

edzer avatar edzer commented on July 18, 2024

from stars.

adrfantini avatar adrfantini commented on July 18, 2024

Thanks! (tested, works)
I am honoured, I really appreciate it.

from stars.

adrfantini avatar adrfantini commented on July 18, 2024

If s %>% st_set_dimensions("time", c("MAM", "JJA", "SON", "DJF")) works, any reason why st_dimensions(s, "time") <- c("MAM", "JJA", "SON", "DJF") should not?

from stars.

edzer avatar edzer commented on July 18, 2024

There is no st_dimensions<-. A good reason to not have one is that st_set_dimensions takes three arguments, and all replacement functions, afaict, take two.

from stars.

adrfantini avatar adrfantini commented on July 18, 2024

all replacement functions, afaict, take two

Ah OK, I did not know this. Thanks for the clarification.

from stars.

mdsumner avatar mdsumner commented on July 18, 2024

@adrfantini I encountered this labelling in these lessons that use Python's xarray https://carpentrieslab.github.io/python-aos-lesson/

Is that labelling and "time.season" functionality common in Python tools, or in the work you do with climate data? (Is it a CMIP5 thing?) I don't see those seasonal labels in the file in the lesson, so I assume it's an xarray idiom - but would like to know if it's widely used? I find it pretty fragile given all the variability in ways that time and dates can be encoded, but maybe in CMIP5 it's reliable enough?

from stars.

adrfantini avatar adrfantini commented on July 18, 2024

@mdsumner I'm not sure I understand what you mean.
Climatological seasons are different from actual seasons, for simplicity.
Labelling seasons with the initials of the respective months is extremely common in climate science (only in the final data-analysis, not in simulations). In Europe for example you will see papers referring to 'DJF' as often as to 'winter', or even more. In the same way, the monsoon season is usually referred to as 'JJAS' in India.

Is this what you were asking?

EDIT: as far as python goes I don't use it much so I'afraid I cannot reply on that one.

from stars.

mdsumner avatar mdsumner commented on July 18, 2024

That answers, thanks! It looks like xarray has auto-interpreters for time and will apply groupby("time.season") as a special case with those month-triplets as output labels.

from stars.

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.