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

time_series subsetting functions need to take multiples of "unit" arguments. #24

Open
Jwely opened this issue May 21, 2015 · 7 comments

Comments

@Jwely
Copy link
Member

Jwely commented May 21, 2015

presently, there isn't any way to group by some custom interval without multiple representation of each subset.

for example, if i want 3 day summaries, i can use time_series.make_subsets("%d",overlap_width = 1), but this produces a subset centered around every day, while i may want only a subset every 3 days with each data point only represented a single time.

@RyanMurphyRI
Copy link

@Jwely, has there been any resolution to this? I am hoping to make 10 day averages from a modis time series, with each data point represented once. Thank you for your work on this!

@Jwely
Copy link
Member Author

Jwely commented Oct 26, 2015

I think we worked around it. You can already get what you want out of this function by running a 10 day moving average and throwing out the points that you don't want. It's not a clean solution, so If you need additional syntax help post here again.

@RyanMurphyRI
Copy link

@Jwely Yes I would like some syntax help. If I would like to average a 10 year modis time series to 10 day averages, so that for each pixel I would potentially be averaging 10*10 or 100 values, how would I do this?

@Jwely
Copy link
Member Author

Jwely commented Oct 26, 2015

I think what you want is to create a rast_series instance, then use the group_bins function with days as the input argument first, then use a make_subsets second.

    rs = tsa.rast_series(args)
    rs.group_bins("%j", cyclical=True)
    rs.make_subsets("%j", overlap_width = 5)

Then take raster statistics on rs

@RyanMurphyRI
Copy link

@Jwely as far as I can tell, the "overlap_width" parameter only allows for the creation of a moving window, not a static one to average if I want to get one value for every ten day period that only contains those days that fall within the period, if that makes sense. Have you also seen that even with the specification of a low threshold, make_subsets does not return negative results?

@Jwely
Copy link
Member Author

Jwely commented Oct 29, 2015

Regarding the rolling window: yes you are correct, it produces a rolling average. You can still obtain the results you are after by simply deleting the extra results. For example, with a 5 day overlap width, you would end up with 366 separate results, one centered on each day of the year. By keeping the results from julian days 6, 27, 38, 49, 60, etc (according to 6 + 11n) you will have a time series with 11 day averages where each value is represented only a single time.

Regarding negative results, you'll have to be more specific.

@RyanMurphyRI
Copy link

Aha! I will try that, although as I understand it the rolling average would
produce an average for each day over the entire time series, i.e. 13 years.
I would then throw out all unnecessary averages and average those remaining
to one single Is that correct?

Thanks Jeff,

On Thu, Oct 29, 2015 at 1:49 PM, Jeff Ely notifications@github.com wrote:

Regarding the rolling window: yes you are correct, it produces a rolling
average. You can still obtain the results you are after by simply deleting
the extra results. For example, with a 5 day overlap width, you would end
up with 366 separate results, one centered on each day of the year. By
keeping the results from julian days 6, 27, 38, 49, 60, etc (according to 6

  • 11n) you will have a time series with 11 day averages where each value is
    represented only a single time.

Regarding negative results, you'll have to be more specific.


Reply to this email directly or view it on GitHub
#24 (comment).

Ryan Murphy
International Agricultural Development Graduate Group
University of California, Davis

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

No branches or pull requests

2 participants