The functions and methods documented in this section are the internal workings of the OpenGHG library. They are subject to change without warning due to the early stages of development of the project.
Normal users should not use any of the functions shown here directly as they may be removed or their functionality may change.
These functions take surface measurement data and standardise it for storage in the object store. They ensure the correct metadata and attributes
are recorded with the data, and that the data is CF compliant. They are called by the
For processing data from the AQMesh network
For processing data from the BEACO2N network
For processing data from the BT Tower site
For processing data from Cranfield
For processing data from CRDS (cavity ring-down spectroscopy) data from the DECC network.
For processing data from the EUROCOM network
For processing data in the form expected by the GCWERKS package
For processing data from the NOAA network
For processing data from NPL
For processing data from the Thames Barrier site
These handle the assignment and standardisation of meta`data`.
Ensuring the NetCDF created during standardisation has the correct attributes assigned to it.
Ensure the required metadata is shared between the metadata and attributes.
These functions and classes handle the lower level storage and retrieval of data from the object store.
This provides the functionality required by all data storage and processing classes, namely the saving, retrieval and loading of data from the object store.
Base class which the other core processing modules inherit
The Datasource is the smallest data provider within the OpenGHG topology. A Datasource represents a data provider such as an instrument measuring a specific gas at a specific height at a specific site. For an instrument measuring three gas species at an inlet height of 100m at a site we would have three Datasources.
Handles the storage of data, metadata and version information for measurements
Handles the storage of emissions data.
Handles the storage of Eulerian model data.
Handles the storage of met data from the ECMWF data.
Handles the storage of footprints / flux data.
Handles the storage of surface measurement data.
These dataclasses are used to facilitate the simple packaging and retrieval of data from the object store.
These handle the retrieval of data from the object store.
Search for data in the object store, accepts any pair of keyword - argument pairs
search(site=”bsd”, inlet=”50m”, species=”co2”)
Handle the retrieval of specific data types, some functions may try to mirror the interface of functions in the Bristol ACRG repository but should hopefully be useful to all users.
These functions handle the storage of data in the object store, in JSON or binary format. Each object and piece of data in the
object store is stored at a specific
key, which can be thought of as the address of the data. The data is stored
bucket which in the cloud is a section of the OpenGHG object store. Locally a
bucket is just a normal
directory in the user’s filesystem specific by the
OPENGHG_PATH environment variable.
Delete an object in the store
Check if an object exists at that key
Get absolute filepaths for objects
Get path to bucket
Get MD5 has of file
Get MD5 hash of passed bytes
Retrieve object from object store
Retrieve JSON object from object store
Get the MD5 hashes of the given files
Set an object in the object store
Create a JSON object in the object store
This module contains all the helper functions used throughout OpenGHG.
These are used to export data to a format readable by the OpenGHG data dashboard.
These handle hashing of data (usually with SHA1)
String cleaning and formatting functions
Helpers to deal with all things datetime.
Create a Timestamp with a UTC timezone
Create a timezone aware timestamp for now
Create a timezone aware timestamp for the UNIX epoch (1970-01-01)
Create a daterange from two timestamp strings
Convert a daterange to string
Create a daterange string from two timestamps or strings
Create a pandas DatetimeIndex from two timestamps
Check if two dateranges overlap
Combine a list of dateranges
Split a daterange string to the component start and end Timestamps
Finds the closest daterange in a list of dateranges
Check if the passed daterange is valid
Find the gaps in a list of dateranges
Removes overlapping dates from to_trim
Checks if one of the passed dateranges contains the other, if so, then split the larger daterange into three sections.
Checks if one daterange contains another
Make sure the daterange is correct and return tzaware daterange.
Check if the given value is NaN, is so return an NA string
Check if the passed string is a valid date or not, if not returns NA
Our own personal
These perform checks to ensure data processed for each site is correct
These handle cloud based functionality
Checks if we’re running in the cloud by checking for the
Custom Data Types#
Customised errors for OpenGHG.
Raised if an invalid site is given
Raised if we don’t recognize the data passed
Raised if there has been an error with a serverless function.
Raised if an error accessing an object at a key in the object store occurs
These are used in conjunction with
mypy to make type hinting easier.