Reading and plotting time series — poets 0.1.0 documentation

### Navigation

- index
- modules |
- poets 0.1.0 documentation »

# Reading and plotting time series

This example shows how to read and plot time series data from the resampled NetCDF file. It presumes that we already set up a Poet class and added the source MODIS_LST as given in `Setting up a Poet base class`_. For plotting, we will use Matplotlib.

Reading the image can be done with the `poets.io.source_base.BasicSource.read_ts` method. You can read time series only for gridpoints given in the defined region(s). To get a list of available gridpoints, you can call `poets.poet.Poet.get_gridpoints`.

In[10]:

    import matplotlib.pyplot as plt

    # Get a list of valid gridpoints
    gridpoints = p.get_gridpoints()

    # Reading the time series for point 1632
    ts = p.sources['MODIS_LST'].read_ts(1632)

    # Plot time series
    ts.plot()
    plt.show()

And this is how the result will look like:

### Navigation

- index
- modules |
- poets 0.1.0 documentation »