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

modify the pixel time series tool to return a dataframe #66

Open
sixy6e opened this issue Jun 23, 2015 · 1 comment
Open

modify the pixel time series tool to return a dataframe #66

sixy6e opened this issue Jun 23, 2015 · 1 comment

Comments

@sixy6e
Copy link
Contributor

sixy6e commented Jun 23, 2015

The pixel time series tool could be made more functional by incorporating a function that returns a pandas.DataFrame rather than outputting directly to disk.

Some thing along the lines of:

dataframe = retrieve_pixel_time_series(coord=(x, y), dsets=[ARG25, FC25, PQ25], pq_flags=None)

where:
coord: a tuple of x, y coordinates
dsets: a list of DatasetTypes
pq_flags: If None then no PQ masking is applied.

A pandas.DataFrame is returned containing the same info as currently output, but is time-series aware by having the dataset.start_datetime timestamps set as the DataFrame index

The current class RetrievePixelTimeSeriesTool could make use of the same return structure i.e a pandas.DataFrame allowing multiple outputs formats to be written to disk such as csv, JSON & xls.

What do you think?
I can draft up an example soonish.

@simonoldfield
Copy link
Contributor

The first aspect of this is to move the logic of performing the actual pixel drill into the API proper - e.g. into the datacube.api.utils module like get_dataset_data_stack has been. I'm not sure if the API call should return a pandas.DataFrame or whether it would return some other data structure and then the Retrieve Pixel Time Series command line tool code would wrap it to produce the output format.

This has always been the intention - but it hasn't been a high enough priority to move from my TODO list to the TODONE list.

I'll look at this real soon now.

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