Skip to main content

No project description provided

Project description

ocf-data-sampler

All Contributors

tags badge ease of contribution: easy

ocf-data-sampler contains all the tools needed to create samples and feed them to our models, such as PVNet. The data we work with—typically energy data, satellite imagery, and numerical weather predictions (NWPs)—is usually too heavy to do this on the fly, so that's where this repo comes in: handling steps like opening the data, selecting the right samples, normalising and reshaping, and saving to and reading from disk.

We are currently migrating to this repo from ocf_datapipes, which performs the same functions but is built around PyTorch DataPipes, which are quite cumbersome to work with and are no longer maintained by PyTorch. ocf-data-sampler uses PyTorch Datasets, and we've taken the opportunity to make the code much cleaner and more manageable.

[!Note] This repository is still in early development development and large changes to the user facing functions may still occur.

Documentation

ocf-data-sampler doesn't have external documentation yet; you can read a bit about how our torch datasets work in the README here.

FAQ

If you have any questions about this or any other of our repos, don't hesitate to hop to our Discussions Page!

How does ocf-data-sampler deal with data sources that use different projections (e.g. some are in latitude-longitude, and some in OSGB)?

When creating samples, we make a spatial crop of a preset size centred around a point of interest (POI, usually a solar or wind farm). The size of the crop is set not in miles or kilometres, but in 'pixels', which would be different for different data sources, depending on their spatial resolution, projections they use, and where the POI is. For example, a latitude-longitude source with a 1° resolution will have pixel sizes corresponding to very different 'surface' distances (that you might measure in, e.g., kilometres) from a source with 0.1° resolution. The pixel size will even be different for the same source depending on how close the POI is to the equator!

Instead of trying to accommodate for all these differences and make all the sources use the same spatial grid, we translate the POI's position into the corresponding coordinate system and select the crop using the source's original grid. This 'snapshot' is then passed to the model with no additional information on what specific coordinates it represents; instead, since the size is always the same and the POI is always in the centre, the model gets consistent information on the measurements at a location near the POI and how it affects the target, without any explicit knowledge of where that location is in coordinate system terms.

Development

You can install ocf-data-sampler for development as follows:

pip install git+https://github.com/openclimatefix/ocf-data-sampler.git

Running the test suite

The tests in this project use pytest. Once you have it installed, you can run it from the project's directory:

cd ocf-data-sampler
pytest

Contributing and community

issues badge

Contributors

Thanks goes to these wonderful people (emoji key):

James Fulton
James Fulton

💻
Alexandra Udaltsova
Alexandra Udaltsova

💻
Sukhil Patel
Sukhil Patel

💻 🐛
Peter Dudfield
Peter Dudfield

💻
Vikram Pande
Vikram Pande

💻
Unnati Bhardwaj
Unnati Bhardwaj

📖
Ali Rashid
Ali Rashid

💻
Felix
Felix

💻 ⚠️
Ajani Timothy
Ajani Timothy

💻
Rupesh Mangalam
Rupesh Mangalam

💻
Siddharth
Siddharth

💻
Sachin-G13
Sachin-G13

💻
Dorna Raj Gyawali
Dorna Raj Gyawali

💻

This project follows the all-contributors specification. Contributions of any kind welcome!


Part of the Open Climate Fix community.

OCF Logo

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocf_data_sampler-0.2.30.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocf_data_sampler-0.2.30-py3-none-any.whl (7.4 MB view details)

Uploaded Python 3

File details

Details for the file ocf_data_sampler-0.2.30.tar.gz.

File metadata

  • Download URL: ocf_data_sampler-0.2.30.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.10

File hashes

Hashes for ocf_data_sampler-0.2.30.tar.gz
Algorithm Hash digest
SHA256 98f52a5333c56146aeeea180c1b0ff991ec4ffc841af85c2fd174b18533c9748
MD5 a07e784ed0b409aae1f97e3c89ea76b7
BLAKE2b-256 b5302e6119dc7d2ce43e0fb18f81ec8be60f2eaa87b3d488ead78feaf58b1ccf

See more details on using hashes here.

File details

Details for the file ocf_data_sampler-0.2.30-py3-none-any.whl.

File metadata

File hashes

Hashes for ocf_data_sampler-0.2.30-py3-none-any.whl
Algorithm Hash digest
SHA256 0fbac2f4d588b13a2c459afd8f6c74a73721fa2652225908334e6a4ffbe8b10b
MD5 dc8a7f30015b2efad4407f25c4de6f9c
BLAKE2b-256 eb9d5270fae7d0d58aec87db9d667327c63c6496d4766968838692fa5b649d77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page