Skip to main content

geo-timeseries-to-image

Summary

This python package provides some simple tools to process and visualise sets of time series data that have a geospatial relationship with one another.

Example of such datasets could include:

  • temperature measurements at different weather stations, or
  • solar power generation at different homes having rooftop solar PV

This package uses existing interpolation packages to interpolate between individual point sources in 2D space (such as weather stations). Currently supported:

  • scipy.interpolate.griddata
  • scipy.interpolate.RBFInterpolator

It also provides an ability to add boundary points, which means that values can be estimated for entire rectangular regions, even with only a small number of time series data sources within the region.

The 2D data that is generated from interpolation can either be accessed as a 2D numpy array of float values, or it can be displayed as a visual image. There is basic support to generate a sequence of images from time series data.


Install

pip install geots2img

Or if you prefer to install this locally (in development mode), run:

git clone git@github.com:juliandehoog/geo-timeseries-to-image.git
make local-install

Description

The core functionality is provided within the ImageGenerator class. When creating an instance of ImageGenerator, you must pass the range of x and y values (max, min for each) that you are interested in, as well as the resolution of the image (the spatial discretisation interval).

You must also pass the coordinates of the source points, in other words the locations where the time series data is being generated. To use the example of weather stations, this would be the longitude / latitude of each weather station.

The ImageGenerator can subsequently be passed the instantaneous values of all source points and generate an image (or 2D array of float values) for the whole area of interest. The accompanying jupyter notebook example_usage.ipynb provides detailed examples of how this package may be used.

In short:

Input:

  • [x_min, x_max], [y_min, y_max], defining a region of interest
  • target resolution of region of interest (spatial discretisation)
  • (x, y) coordinates for all points that generate data within the region
  • values at each of these points for one or more intervals

Output:

Any of the following:

  • A 2D numpy array of values for the entire region
  • A list of values for a set of points of interest within the region (do not have to be the same as the source points)
  • An image that visualises data across the whole region
  • A sequence of images or a video that visualises the time series data in the region over multiple time intervals

Example

Consider if we have temperature time series data like this (each time series correponds to temperature measurements at one postcode in Western Australia):

We can choose one interval, say 2-Nov-2020 12:00, and convert it to an image like this:

In the figure above, green circles indicates locations of source data (where temperature was measured), while red circles indicate boundary points that are synthetically added to ensure that we can interpolate reasonably well across the whole region of interest.

After converting each interval to an image, we can represent the full period of interest as a video, like this:

In this particular example (one day of temperature data), the visualisation is not that interesting in the end -- although it does indicate that one postcode seems to have either faulty sensors or unique characteristics. However, for other types of time series data (like solar PV generation, for example), these types of visualisation can be very helpful.


Release History

  • 0.2.1 - Type hints and other small code improvements
  • 0.2.0 - Added RBFInterpolator support, multiple small improvements to structure
  • 0.1.3 - Fixed minor issue with nans at edge of fitted values
  • 0.1.2 - Fixed makefile, setup, etc. for deployment to pypi
  • 0.1.1 - Multiple minor fixed, improved README, thanks to Peter Ilfrich for the suggestions
  • 0.1.0 - First fully functional release.

Release files for geots2img 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geots2img 0.2.1
File Size Uploaded
geots2img-0.2.1.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for geots2img 0.2.1
File Interpreter ABI Platform
geots2img-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / geots2img-0.2.1.tar.gz

Download URL geots2img-0.2.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4c7feaaa121447dcb7f26f545d23ab6d1476d250e655425ba901f7f10aab6cc0
BLAKE2b-256 checksum
How to use checksums
07631bda25d339dcb5a08f0780625eea1d2cac7ace466b6e9599e8430bc069a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/6.8.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / geots2img-0.2.1-py3-none-any.whl

Download URL geots2img-0.2.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ace295a6f205753c49701a3cffc6a39cc8b5c9ef2eb1b8439773a64cde931a9
BLAKE2b-256 checksum
How to use checksums
e3b2eb82b8b59d367f4c84d42a2d7062ecaddd03f7bb89553dcaea4603f70a31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/6.8.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page